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 | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 84 | O_NEXT_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_NEXT s_client" |
| 85 | else |
| 86 | O_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 87 | O_NEXT_SRV_NO_CERT=false |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 88 | O_NEXT_CLI=false |
| 89 | fi |
| 90 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 91 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 92 | 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] | 93 | G_NEXT_SRV_NO_CERT="$GNUTLS_NEXT_SERV" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 94 | else |
| 95 | G_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 96 | G_NEXT_SRV_NO_CERT=false |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 97 | fi |
| 98 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 99 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 100 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile data_files/test-ca_cat12.crt" |
| 101 | else |
| 102 | G_NEXT_CLI=false |
| 103 | fi |
| 104 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 105 | TESTS=0 |
| 106 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 107 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 108 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 109 | CONFIG_H='../include/mbedtls/mbedtls_config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 110 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 111 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 112 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 113 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 114 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 115 | SHOW_TEST_NUMBER=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 116 | RUN_TEST_NUMBER='' |
| 117 | |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 118 | PRESERVE_LOGS=0 |
| 119 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 120 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 121 | # port which is this plus 10000. Each port number may be independently |
| 122 | # overridden by a command line option. |
| 123 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 124 | PXY_PORT=$((SRV_PORT + 10000)) |
| 125 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 126 | print_usage() { |
| 127 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 128 | printf " -h|--help\tPrint this help.\n" |
| 129 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 130 | printf " -f|--filter\tOnly matching tests are executed (substring or BRE)\n" |
| 131 | printf " -e|--exclude\tMatching tests are excluded (substring or BRE)\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 132 | 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] | 133 | 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] | 134 | printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 135 | printf " --outcome-file\tFile where test outcomes are written\n" |
| 136 | printf " \t(default: \$MBEDTLS_TEST_OUTCOME_FILE, none if empty)\n" |
| 137 | printf " --port \tTCP/UDP port (default: randomish 1xxxx)\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 138 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 139 | 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] | 140 | } |
| 141 | |
| 142 | get_options() { |
| 143 | while [ $# -gt 0 ]; do |
| 144 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 145 | -f|--filter) |
| 146 | shift; FILTER=$1 |
| 147 | ;; |
| 148 | -e|--exclude) |
| 149 | shift; EXCLUDE=$1 |
| 150 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 151 | -m|--memcheck) |
| 152 | MEMCHECK=1 |
| 153 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 154 | -n|--number) |
| 155 | shift; RUN_TEST_NUMBER=$1 |
| 156 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 157 | -s|--show-numbers) |
| 158 | SHOW_TEST_NUMBER=1 |
| 159 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 160 | -p|--preserve-logs) |
| 161 | PRESERVE_LOGS=1 |
| 162 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 163 | --port) |
| 164 | shift; SRV_PORT=$1 |
| 165 | ;; |
| 166 | --proxy-port) |
| 167 | shift; PXY_PORT=$1 |
| 168 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 169 | --seed) |
| 170 | shift; SEED="$1" |
| 171 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 172 | -h|--help) |
| 173 | print_usage |
| 174 | exit 0 |
| 175 | ;; |
| 176 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 177 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 178 | print_usage |
| 179 | exit 1 |
| 180 | ;; |
| 181 | esac |
| 182 | shift |
| 183 | done |
| 184 | } |
| 185 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 186 | # Make the outcome file path relative to the original directory, not |
| 187 | # to .../tests |
| 188 | case "$MBEDTLS_TEST_OUTCOME_FILE" in |
| 189 | [!/]*) |
| 190 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" |
| 191 | ;; |
| 192 | esac |
| 193 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 194 | # Read boolean configuration options from mbedtls_config.h for easy and quick |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 195 | # testing. Skip non-boolean options (with something other than spaces |
| 196 | # and a comment after "#define SYMBOL"). The variable contains a |
| 197 | # space-separated list of symbols. |
Jerry Yu | d0fcf7f | 2021-12-10 18:45:51 +0800 | [diff] [blame] | 198 | CONFIGS_ENABLED=" $(echo `$P_QUERY -l` )" |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 199 | # Skip next test; use this macro to skip tests which are legitimate |
| 200 | # in theory and expected to be re-introduced at some point, but |
| 201 | # aren't expected to succeed at the moment due to problems outside |
| 202 | # our control (such as bugs in other TLS implementations). |
| 203 | skip_next_test() { |
| 204 | SKIP_NEXT="YES" |
| 205 | } |
| 206 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 207 | # 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] | 208 | requires_config_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 209 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 210 | *" $1"[\ =]*) :;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 211 | *) SKIP_NEXT="YES";; |
| 212 | esac |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 213 | } |
| 214 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 215 | # 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] | 216 | requires_config_disabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 217 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 218 | *" $1"[\ =]*) SKIP_NEXT="YES";; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 219 | esac |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 220 | } |
| 221 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 222 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 223 | # This function uses the query_config command line option to query the |
| 224 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 225 | # program. The command will always return a success value if the |
| 226 | # configuration is defined and the value will be printed to stdout. |
| 227 | # |
| 228 | # Note that if the configuration is not defined or is defined to nothing, |
| 229 | # the output of this function will be an empty string. |
| 230 | ${P_SRV} "query_config=${1}" |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 231 | } |
| 232 | |
| 233 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 234 | VAL="$( get_config_value_or_default "$1" )" |
| 235 | if [ -z "$VAL" ]; then |
| 236 | # Should never happen |
| 237 | echo "Mbed TLS configuration $1 is not defined" |
| 238 | exit 1 |
| 239 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 240 | SKIP_NEXT="YES" |
| 241 | fi |
| 242 | } |
| 243 | |
| 244 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 245 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 246 | if [ -z "$VAL" ]; then |
| 247 | # Should never happen |
| 248 | echo "Mbed TLS configuration $1 is not defined" |
| 249 | exit 1 |
| 250 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 251 | SKIP_NEXT="YES" |
| 252 | fi |
| 253 | } |
| 254 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 255 | requires_config_value_equals() { |
| 256 | VAL=$( get_config_value_or_default "$1" ) |
| 257 | if [ -z "$VAL" ]; then |
| 258 | # Should never happen |
| 259 | echo "Mbed TLS configuration $1 is not defined" |
| 260 | exit 1 |
| 261 | elif [ "$VAL" -ne "$2" ]; then |
| 262 | SKIP_NEXT="YES" |
| 263 | fi |
| 264 | } |
| 265 | |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 266 | # Require Mbed TLS to support the given protocol version. |
| 267 | # |
| 268 | # Inputs: |
| 269 | # * $1: protocol version in mbedtls syntax (argument to force_version=) |
| 270 | requires_protocol_version() { |
| 271 | # Support for DTLS is detected separately in detect_dtls(). |
| 272 | case "$1" in |
| 273 | tls12|dtls12) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2;; |
| 274 | tls13|dtls13) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3;; |
| 275 | *) echo "Unknown required protocol version: $1"; exit 1;; |
| 276 | esac |
| 277 | } |
| 278 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 279 | # Space-separated list of ciphersuites supported by this build of |
| 280 | # Mbed TLS. |
| 281 | P_CIPHERSUITES=" $($P_CLI --help 2>/dev/null | |
XiaokangQian | 4b82ca1 | 2021-11-18 08:27:17 +0000 | [diff] [blame] | 282 | grep 'TLS-\|TLS1-3' | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 283 | tr -s ' \n' ' ')" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 284 | requires_ciphersuite_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 285 | case $P_CIPHERSUITES in |
| 286 | *" $1 "*) :;; |
| 287 | *) SKIP_NEXT="YES";; |
| 288 | esac |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 289 | } |
| 290 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 291 | # detect_required_features CMD [RUN_TEST_OPTION...] |
| 292 | # If CMD (call to a TLS client or server program) requires certain features, |
| 293 | # arrange to only run the following test case if those features are enabled. |
| 294 | detect_required_features() { |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 295 | case "$1" in |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 296 | *\ force_version=*) |
| 297 | tmp="${1##*\ force_version=}" |
| 298 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 299 | requires_protocol_version "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 300 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 301 | |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 302 | case "$1" in |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 303 | *\ force_ciphersuite=*) |
| 304 | tmp="${1##*\ force_ciphersuite=}" |
| 305 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 306 | requires_ciphersuite_enabled "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 307 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 308 | |
Gilles Peskine | 740b734 | 2022-04-08 19:29:27 +0200 | [diff] [blame] | 309 | case " $1 " in |
| 310 | *[-_\ =]tickets=[^0]*) |
| 311 | requires_config_enabled MBEDTLS_SSL_TICKET_C;; |
| 312 | esac |
| 313 | case " $1 " in |
| 314 | *[-_\ =]alpn=*) |
| 315 | requires_config_enabled MBEDTLS_SSL_ALPN;; |
| 316 | esac |
| 317 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 318 | unset tmp |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 319 | } |
| 320 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 321 | requires_certificate_authentication () { |
| 322 | if [ "$PSK_ONLY" = "YES" ]; then |
| 323 | SKIP_NEXT="YES" |
| 324 | fi |
| 325 | } |
| 326 | |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 327 | adapt_cmd_for_psk () { |
| 328 | case "$2" in |
| 329 | *openssl*) s='-psk abc123 -nocert';; |
| 330 | *gnutls-*) s='--pskkey=abc123';; |
| 331 | *) s='psk=abc123';; |
| 332 | esac |
| 333 | eval $1='"$2 $s"' |
| 334 | unset s |
| 335 | } |
| 336 | |
| 337 | # maybe_adapt_for_psk [RUN_TEST_OPTION...] |
| 338 | # If running in a PSK-only build, maybe adapt the test to use a pre-shared key. |
| 339 | # |
| 340 | # If not running in a PSK-only build, do nothing. |
| 341 | # If the test looks like it doesn't use a pre-shared key but can run with a |
| 342 | # pre-shared key, pass a pre-shared key. If the test looks like it can't run |
| 343 | # with a pre-shared key, skip it. If the test looks like it's already using |
| 344 | # a pre-shared key, do nothing. |
| 345 | # |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 346 | # This code does not consider builds with ECDHE-PSK or RSA-PSK. |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 347 | # |
| 348 | # Inputs: |
| 349 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: client/server/proxy commands. |
| 350 | # * $PSK_ONLY: YES if running in a PSK-only build (no asymmetric key exchanges). |
| 351 | # * "$@": options passed to run_test. |
| 352 | # |
| 353 | # Outputs: |
| 354 | # * $CLI_CMD, $SRV_CMD: may be modified to add PSK-relevant arguments. |
| 355 | # * $SKIP_NEXT: set to YES if the test can't run with PSK. |
| 356 | maybe_adapt_for_psk() { |
| 357 | if [ "$PSK_ONLY" != "YES" ]; then |
| 358 | return |
| 359 | fi |
| 360 | if [ "$SKIP_NEXT" = "YES" ]; then |
| 361 | return |
| 362 | fi |
| 363 | case "$CLI_CMD $SRV_CMD" in |
| 364 | *[-_\ =]psk*|*[-_\ =]PSK*) |
| 365 | return;; |
| 366 | *force_ciphersuite*) |
| 367 | # The test case forces a non-PSK cipher suite. In some cases, a |
| 368 | # PSK cipher suite could be substituted, but we're not ready for |
| 369 | # that yet. |
| 370 | SKIP_NEXT="YES" |
| 371 | return;; |
| 372 | *\ auth_mode=*|*[-_\ =]crt[_=]*) |
| 373 | # The test case involves certificates. PSK won't do. |
| 374 | SKIP_NEXT="YES" |
| 375 | return;; |
| 376 | esac |
| 377 | adapt_cmd_for_psk CLI_CMD "$CLI_CMD" |
| 378 | adapt_cmd_for_psk SRV_CMD "$SRV_CMD" |
| 379 | } |
| 380 | |
| 381 | case " $CONFIGS_ENABLED " in |
| 382 | *\ MBEDTLS_KEY_EXCHANGE_[^P]*) PSK_ONLY="NO";; |
| 383 | *\ MBEDTLS_KEY_EXCHANGE_P[^S]*) PSK_ONLY="NO";; |
| 384 | *\ MBEDTLS_KEY_EXCHANGE_PS[^K]*) PSK_ONLY="NO";; |
| 385 | *\ MBEDTLS_KEY_EXCHANGE_PSK[^_]*) PSK_ONLY="NO";; |
| 386 | *\ MBEDTLS_KEY_EXCHANGE_PSK_ENABLED\ *) PSK_ONLY="YES";; |
| 387 | *) PSK_ONLY="NO";; |
| 388 | esac |
| 389 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 390 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 391 | requires_openssl_with_fallback_scsv() { |
| 392 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 393 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 394 | then |
| 395 | OPENSSL_HAS_FBSCSV="YES" |
| 396 | else |
| 397 | OPENSSL_HAS_FBSCSV="NO" |
| 398 | fi |
| 399 | fi |
| 400 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 401 | SKIP_NEXT="YES" |
| 402 | fi |
| 403 | } |
| 404 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 405 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 406 | requires_max_content_len() { |
| 407 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 408 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 409 | } |
| 410 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 411 | # skip next test if GnuTLS isn't available |
| 412 | requires_gnutls() { |
| 413 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 414 | 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] | 415 | GNUTLS_AVAILABLE="YES" |
| 416 | else |
| 417 | GNUTLS_AVAILABLE="NO" |
| 418 | fi |
| 419 | fi |
| 420 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 421 | SKIP_NEXT="YES" |
| 422 | fi |
| 423 | } |
| 424 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 425 | # skip next test if GnuTLS-next isn't available |
| 426 | requires_gnutls_next() { |
| 427 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 428 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 429 | GNUTLS_NEXT_AVAILABLE="YES" |
| 430 | else |
| 431 | GNUTLS_NEXT_AVAILABLE="NO" |
| 432 | fi |
| 433 | fi |
| 434 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 435 | SKIP_NEXT="YES" |
| 436 | fi |
| 437 | } |
| 438 | |
| 439 | # skip next test if OpenSSL-legacy isn't available |
| 440 | requires_openssl_legacy() { |
| 441 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 442 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 443 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 444 | else |
| 445 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 446 | fi |
| 447 | fi |
| 448 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 449 | SKIP_NEXT="YES" |
| 450 | fi |
| 451 | } |
| 452 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 453 | requires_openssl_next() { |
| 454 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then |
| 455 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then |
| 456 | OPENSSL_NEXT_AVAILABLE="YES" |
| 457 | else |
| 458 | OPENSSL_NEXT_AVAILABLE="NO" |
| 459 | fi |
| 460 | fi |
| 461 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 462 | SKIP_NEXT="YES" |
| 463 | fi |
| 464 | } |
| 465 | |
| 466 | # skip next test if tls1_3 is not available |
| 467 | requires_openssl_tls1_3() { |
| 468 | requires_openssl_next |
| 469 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 470 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 471 | fi |
| 472 | if [ -z "${OPENSSL_TLS1_3_AVAILABLE:-}" ]; then |
| 473 | if $OPENSSL_NEXT s_client -help 2>&1 | grep tls1_3 >/dev/null |
| 474 | then |
| 475 | OPENSSL_TLS1_3_AVAILABLE="YES" |
| 476 | else |
| 477 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 478 | fi |
| 479 | fi |
| 480 | if [ "$OPENSSL_TLS1_3_AVAILABLE" = "NO" ]; then |
| 481 | SKIP_NEXT="YES" |
| 482 | fi |
| 483 | } |
| 484 | |
| 485 | # skip next test if tls1_3 is not available |
| 486 | requires_gnutls_tls1_3() { |
| 487 | requires_gnutls_next |
| 488 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 489 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 490 | fi |
| 491 | if [ -z "${GNUTLS_TLS1_3_AVAILABLE:-}" ]; then |
| 492 | if $GNUTLS_NEXT_CLI -l 2>&1 | grep VERS-TLS1.3 >/dev/null |
| 493 | then |
| 494 | GNUTLS_TLS1_3_AVAILABLE="YES" |
| 495 | else |
| 496 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 497 | fi |
| 498 | fi |
| 499 | if [ "$GNUTLS_TLS1_3_AVAILABLE" = "NO" ]; then |
| 500 | SKIP_NEXT="YES" |
| 501 | fi |
| 502 | } |
| 503 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 504 | # Check %NO_TICKETS option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 505 | requires_gnutls_next_no_ticket() { |
| 506 | requires_gnutls_next |
| 507 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 508 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 509 | fi |
| 510 | if [ -z "${GNUTLS_NO_TICKETS_AVAILABLE:-}" ]; then |
| 511 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep NO_TICKETS >/dev/null |
| 512 | then |
| 513 | GNUTLS_NO_TICKETS_AVAILABLE="YES" |
| 514 | else |
| 515 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 516 | fi |
| 517 | fi |
| 518 | if [ "$GNUTLS_NO_TICKETS_AVAILABLE" = "NO" ]; then |
| 519 | SKIP_NEXT="YES" |
| 520 | fi |
| 521 | } |
| 522 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 523 | # Check %DISABLE_TLS13_COMPAT_MODE option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 524 | requires_gnutls_next_disable_tls13_compat() { |
| 525 | requires_gnutls_next |
| 526 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 527 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 528 | fi |
| 529 | if [ -z "${GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE:-}" ]; then |
| 530 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep DISABLE_TLS13_COMPAT_MODE >/dev/null |
| 531 | then |
| 532 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="YES" |
| 533 | else |
| 534 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 535 | fi |
| 536 | fi |
| 537 | if [ "$GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE" = "NO" ]; then |
| 538 | SKIP_NEXT="YES" |
| 539 | fi |
| 540 | } |
| 541 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 542 | # skip next test if IPv6 isn't available on this host |
| 543 | requires_ipv6() { |
| 544 | if [ -z "${HAS_IPV6:-}" ]; then |
| 545 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 546 | SRV_PID=$! |
| 547 | sleep 1 |
| 548 | kill $SRV_PID >/dev/null 2>&1 |
| 549 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 550 | HAS_IPV6="NO" |
| 551 | else |
| 552 | HAS_IPV6="YES" |
| 553 | fi |
| 554 | rm -r $SRV_OUT |
| 555 | fi |
| 556 | |
| 557 | if [ "$HAS_IPV6" = "NO" ]; then |
| 558 | SKIP_NEXT="YES" |
| 559 | fi |
| 560 | } |
| 561 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 562 | # skip next test if it's i686 or uname is not available |
| 563 | requires_not_i686() { |
| 564 | if [ -z "${IS_I686:-}" ]; then |
| 565 | IS_I686="YES" |
| 566 | if which "uname" >/dev/null 2>&1; then |
| 567 | if [ -z "$(uname -a | grep i686)" ]; then |
| 568 | IS_I686="NO" |
| 569 | fi |
| 570 | fi |
| 571 | fi |
| 572 | if [ "$IS_I686" = "YES" ]; then |
| 573 | SKIP_NEXT="YES" |
| 574 | fi |
| 575 | } |
| 576 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 577 | # Calculate the input & output maximum content lengths set in the config |
David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 578 | MAX_CONTENT_LEN=16384 |
Yuto Takano | 2be6f1a | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 579 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 580 | 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] | 581 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 582 | # Calculate the maximum content length that fits both |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 583 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 584 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 585 | fi |
| 586 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 587 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 588 | fi |
| 589 | |
| 590 | # skip the next test if the SSL output buffer is less than 16KB |
| 591 | requires_full_size_output_buffer() { |
| 592 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 593 | SKIP_NEXT="YES" |
| 594 | fi |
| 595 | } |
| 596 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 597 | # skip the next test if valgrind is in use |
| 598 | not_with_valgrind() { |
| 599 | if [ "$MEMCHECK" -gt 0 ]; then |
| 600 | SKIP_NEXT="YES" |
| 601 | fi |
| 602 | } |
| 603 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 604 | # skip the next test if valgrind is NOT in use |
| 605 | only_with_valgrind() { |
| 606 | if [ "$MEMCHECK" -eq 0 ]; then |
| 607 | SKIP_NEXT="YES" |
| 608 | fi |
| 609 | } |
| 610 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 611 | # 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] | 612 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 613 | CLI_DELAY_FACTOR=$1 |
| 614 | } |
| 615 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 616 | # wait for the given seconds after the client finished in the next test |
| 617 | server_needs_more_time() { |
| 618 | SRV_DELAY_SECONDS=$1 |
| 619 | } |
| 620 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 621 | # print_name <name> |
| 622 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 623 | TESTS=$(( $TESTS + 1 )) |
| 624 | LINE="" |
| 625 | |
| 626 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 627 | LINE="$TESTS " |
| 628 | fi |
| 629 | |
| 630 | LINE="$LINE$1" |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 631 | printf "%s " "$LINE" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 632 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 633 | for i in `seq 1 $LEN`; do printf '.'; done |
| 634 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 635 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 636 | } |
| 637 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 638 | # record_outcome <outcome> [<failure-reason>] |
| 639 | # The test name must be in $NAME. |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 640 | # Use $TEST_SUITE_NAME as the test suite name if set. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 641 | record_outcome() { |
| 642 | echo "$1" |
| 643 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 644 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 645 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 646 | "${TEST_SUITE_NAME:-ssl-opt}" "$NAME" \ |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 647 | "$1" "${2-}" \ |
| 648 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 649 | fi |
| 650 | } |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 651 | unset TEST_SUITE_NAME |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 652 | |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 653 | # True if the presence of the given pattern in a log definitely indicates |
| 654 | # that the test has failed. False if the presence is inconclusive. |
| 655 | # |
| 656 | # Inputs: |
| 657 | # * $1: pattern found in the logs |
| 658 | # * $TIMES_LEFT: >0 if retrying is an option |
| 659 | # |
| 660 | # Outputs: |
| 661 | # * $outcome: set to a retry reason if the pattern is inconclusive, |
| 662 | # unchanged otherwise. |
| 663 | # * Return value: 1 if the pattern is inconclusive, |
| 664 | # 0 if the failure is definitive. |
| 665 | log_pattern_presence_is_conclusive() { |
| 666 | # If we've run out of attempts, then don't retry no matter what. |
| 667 | if [ $TIMES_LEFT -eq 0 ]; then |
| 668 | return 0 |
| 669 | fi |
| 670 | case $1 in |
| 671 | "resend") |
| 672 | # An undesired resend may have been caused by the OS dropping or |
| 673 | # delaying a packet at an inopportune time. |
| 674 | outcome="RETRY(resend)" |
| 675 | return 1;; |
| 676 | esac |
| 677 | } |
| 678 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 679 | # fail <message> |
| 680 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 681 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 682 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 683 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 684 | mv $SRV_OUT o-srv-${TESTS}.log |
| 685 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 686 | if [ -n "$PXY_CMD" ]; then |
| 687 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 688 | fi |
| 689 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 690 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 691 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 692 | echo " ! server output:" |
| 693 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 694 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 695 | echo " ! client output:" |
| 696 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 697 | if [ -n "$PXY_CMD" ]; then |
| 698 | echo " ! ========================================================" |
| 699 | echo " ! proxy output:" |
| 700 | cat o-pxy-${TESTS}.log |
| 701 | fi |
| 702 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 703 | fi |
| 704 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 705 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 706 | } |
| 707 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 708 | # is_polar <cmd_line> |
| 709 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 710 | case "$1" in |
| 711 | *ssl_client2*) true;; |
| 712 | *ssl_server2*) true;; |
| 713 | *) false;; |
| 714 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 715 | } |
| 716 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 717 | # openssl s_server doesn't have -www with DTLS |
| 718 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 719 | case "$SRV_CMD" in |
| 720 | *s_server*-dtls*) |
| 721 | NEEDS_INPUT=1 |
| 722 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 723 | *) NEEDS_INPUT=0;; |
| 724 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 725 | } |
| 726 | |
| 727 | # provide input to commands that need it |
| 728 | provide_input() { |
| 729 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 730 | return |
| 731 | fi |
| 732 | |
| 733 | while true; do |
| 734 | echo "HTTP/1.0 200 OK" |
| 735 | sleep 1 |
| 736 | done |
| 737 | } |
| 738 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 739 | # has_mem_err <log_file_name> |
| 740 | has_mem_err() { |
| 741 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 742 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 743 | then |
| 744 | return 1 # false: does not have errors |
| 745 | else |
| 746 | return 0 # true: has errors |
| 747 | fi |
| 748 | } |
| 749 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 750 | # 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] | 751 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 752 | wait_app_start() { |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 753 | newline=' |
| 754 | ' |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 755 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 756 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 757 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 758 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 759 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 760 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 761 | # Make a tight loop, server normally takes less than 1s to start. |
Paul Elliott | 58ed8a7 | 2021-10-19 17:56:39 +0100 | [diff] [blame] | 762 | while true; do |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 763 | SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -t) |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 764 | # When we use a proxy, it will be listening on the same port we |
| 765 | # 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] | 766 | case ${newline}${SERVER_PIDS}${newline} in |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 767 | *${newline}${2}${newline}*) break;; |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 768 | esac |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 769 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 770 | echo "$3 START TIMEOUT" |
| 771 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 772 | break |
| 773 | fi |
| 774 | # Linux and *BSD support decimal arguments to sleep. On other |
| 775 | # OSes this may be a tight loop. |
| 776 | sleep 0.1 2>/dev/null || true |
| 777 | done |
| 778 | } |
| 779 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 780 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 781 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 782 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 783 | } |
| 784 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 785 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 786 | # Wait for server process $2 to be listening on port $1. |
| 787 | wait_server_start() { |
| 788 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 789 | } |
| 790 | |
| 791 | # Wait for proxy process $2 to be listening on port $1. |
| 792 | wait_proxy_start() { |
| 793 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 794 | } |
| 795 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 796 | # 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] | 797 | # 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] | 798 | # acceptable bounds |
| 799 | check_server_hello_time() { |
| 800 | # 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] | 801 | 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] | 802 | # Get the Unix timestamp for now |
| 803 | CUR_TIME=$(date +'%s') |
| 804 | THRESHOLD_IN_SECS=300 |
| 805 | |
| 806 | # Check if the ServerHello time was printed |
| 807 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 808 | return 1 |
| 809 | fi |
| 810 | |
| 811 | # Check the time in ServerHello is within acceptable bounds |
| 812 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 813 | # The time in ServerHello is at least 5 minutes before now |
| 814 | return 1 |
| 815 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 816 | # 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] | 817 | return 1 |
| 818 | else |
| 819 | return 0 |
| 820 | fi |
| 821 | } |
| 822 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 823 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 824 | handshake_memory_get() { |
| 825 | OUTPUT_VARIABLE="$1" |
| 826 | OUTPUT_FILE="$2" |
| 827 | |
| 828 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 829 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 830 | |
| 831 | # Check if memory usage was read |
| 832 | if [ -z "$MEM_USAGE" ]; then |
| 833 | echo "Error: Can not read the value of handshake memory usage" |
| 834 | return 1 |
| 835 | else |
| 836 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 837 | return 0 |
| 838 | fi |
| 839 | } |
| 840 | |
| 841 | # Get handshake memory usage from server or client output and check if this value |
| 842 | # is not higher than the maximum given by the first argument |
| 843 | handshake_memory_check() { |
| 844 | MAX_MEMORY="$1" |
| 845 | OUTPUT_FILE="$2" |
| 846 | |
| 847 | # Get memory usage |
| 848 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 849 | return 1 |
| 850 | fi |
| 851 | |
| 852 | # Check if memory usage is below max value |
| 853 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 854 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 855 | "but should be below $MAX_MEMORY bytes" |
| 856 | return 1 |
| 857 | else |
| 858 | return 0 |
| 859 | fi |
| 860 | } |
| 861 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 862 | # wait for client to terminate and set CLI_EXIT |
| 863 | # must be called right after starting the client |
| 864 | wait_client_done() { |
| 865 | CLI_PID=$! |
| 866 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 867 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 868 | CLI_DELAY_FACTOR=1 |
| 869 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 870 | ( 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] | 871 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 872 | |
| 873 | wait $CLI_PID |
| 874 | CLI_EXIT=$? |
| 875 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 876 | kill $DOG_PID >/dev/null 2>&1 |
| 877 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 878 | |
| 879 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 880 | |
| 881 | sleep $SRV_DELAY_SECONDS |
| 882 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 883 | } |
| 884 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 885 | # check if the given command uses dtls and sets global variable DTLS |
| 886 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 887 | case "$1" in |
Paul Elliott | 1428f25 | 2021-10-12 16:02:55 +0100 | [diff] [blame] | 888 | *dtls=1*|*-dtls*|*-u*) DTLS=1;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 889 | *) DTLS=0;; |
| 890 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 891 | } |
| 892 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 893 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 894 | is_gnutls() { |
| 895 | case "$1" in |
| 896 | *gnutls-cli*) |
| 897 | CMD_IS_GNUTLS=1 |
| 898 | ;; |
| 899 | *gnutls-serv*) |
| 900 | CMD_IS_GNUTLS=1 |
| 901 | ;; |
| 902 | *) |
| 903 | CMD_IS_GNUTLS=0 |
| 904 | ;; |
| 905 | esac |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 906 | } |
| 907 | |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 908 | # Determine what calc_verify trace is to be expected, if any. |
| 909 | # |
| 910 | # calc_verify is only called for two things: to calculate the |
| 911 | # extended master secret, and to process client authentication. |
| 912 | # |
| 913 | # Warning: the current implementation assumes that extended_ms is not |
| 914 | # disabled on the client or on the server. |
| 915 | # |
| 916 | # Inputs: |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 917 | # * $1: the value of the server auth_mode parameter. |
| 918 | # 'required' if client authentication is expected, |
| 919 | # 'none' or absent if not. |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 920 | # * $CONFIGS_ENABLED |
| 921 | # |
| 922 | # Outputs: |
| 923 | # * $maybe_calc_verify: set to a trace expected in the debug logs |
| 924 | set_maybe_calc_verify() { |
| 925 | maybe_calc_verify= |
| 926 | case $CONFIGS_ENABLED in |
| 927 | *\ MBEDTLS_SSL_EXTENDED_MASTER_SECRET\ *) :;; |
| 928 | *) |
| 929 | case ${1-} in |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 930 | ''|none) return;; |
| 931 | required) :;; |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 932 | *) echo "Bad parameter 1 to set_maybe_calc_verify: $1"; exit 1;; |
| 933 | esac |
| 934 | esac |
| 935 | case $CONFIGS_ENABLED in |
| 936 | *\ MBEDTLS_USE_PSA_CRYPTO\ *) maybe_calc_verify="PSA calc verify";; |
| 937 | *) maybe_calc_verify="<= calc verify";; |
| 938 | esac |
| 939 | } |
| 940 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 941 | # Compare file content |
| 942 | # Usage: find_in_both pattern file1 file2 |
| 943 | # extract from file1 the first line matching the pattern |
| 944 | # check in file2 that the same line can be found |
| 945 | find_in_both() { |
| 946 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 947 | if [ -z "$srv_pattern" ]; then |
| 948 | return 1; |
| 949 | fi |
| 950 | |
| 951 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 952 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 953 | else |
| 954 | return 1; |
| 955 | fi |
| 956 | } |
| 957 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 958 | SKIP_HANDSHAKE_CHECK="NO" |
| 959 | skip_handshake_stage_check() { |
| 960 | SKIP_HANDSHAKE_CHECK="YES" |
| 961 | } |
| 962 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 963 | # Analyze the commands that will be used in a test. |
| 964 | # |
| 965 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass |
| 966 | # extra arguments or go through wrappers. |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 967 | # |
| 968 | # Inputs: |
| 969 | # * $@: supplemental options to run_test() (after the mandatory arguments). |
| 970 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: the client, proxy and server commands. |
| 971 | # * $DTLS: 1 if DTLS, otherwise 0. |
| 972 | # |
| 973 | # Outputs: |
| 974 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: may be tweaked. |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 975 | analyze_test_commands() { |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 976 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 977 | # 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] | 978 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 979 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 980 | case " $SRV_CMD " in |
| 981 | *' server_addr=::1 '*) |
| 982 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 983 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 984 | fi |
| 985 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 986 | # update CMD_IS_GNUTLS variable |
| 987 | is_gnutls "$SRV_CMD" |
| 988 | |
| 989 | # if the server uses gnutls but doesn't set priority, explicitly |
| 990 | # set the default priority |
| 991 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 992 | case "$SRV_CMD" in |
| 993 | *--priority*) :;; |
| 994 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 995 | esac |
| 996 | fi |
| 997 | |
| 998 | # update CMD_IS_GNUTLS variable |
| 999 | is_gnutls "$CLI_CMD" |
| 1000 | |
| 1001 | # if the client uses gnutls but doesn't set priority, explicitly |
| 1002 | # set the default priority |
| 1003 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1004 | case "$CLI_CMD" in |
| 1005 | *--priority*) :;; |
| 1006 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 1007 | esac |
| 1008 | fi |
| 1009 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1010 | # fix client port |
| 1011 | if [ -n "$PXY_CMD" ]; then |
| 1012 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 1013 | else |
| 1014 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 1015 | fi |
| 1016 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1017 | # prepend valgrind to our commands if active |
| 1018 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1019 | if is_polar "$SRV_CMD"; then |
| 1020 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 1021 | fi |
| 1022 | if is_polar "$CLI_CMD"; then |
| 1023 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 1024 | fi |
| 1025 | fi |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1026 | } |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1027 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1028 | # Check for failure conditions after a test case. |
| 1029 | # |
| 1030 | # Inputs from run_test: |
| 1031 | # * positional parameters: test options (see run_test documentation) |
| 1032 | # * $CLI_EXIT: client return code |
| 1033 | # * $CLI_EXPECT: expected client return code |
| 1034 | # * $SRV_RET: server return code |
| 1035 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1036 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1037 | # |
| 1038 | # Outputs: |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1039 | # * $outcome: one of PASS/RETRY*/FAIL |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1040 | check_test_failure() { |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1041 | outcome=FAIL |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1042 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1043 | if [ $TIMES_LEFT -gt 0 ] && |
| 1044 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null |
| 1045 | then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1046 | outcome="RETRY(client-timeout)" |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1047 | return |
| 1048 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1049 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1050 | # 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] | 1051 | # (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] | 1052 | # expected client exit to incorrectly succeed in case of catastrophic |
| 1053 | # failure) |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1054 | if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ] |
| 1055 | then |
| 1056 | if is_polar "$SRV_CMD"; then |
| 1057 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
| 1058 | else |
| 1059 | fail "server or client failed to reach handshake stage" |
| 1060 | return |
| 1061 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1062 | fi |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1063 | if is_polar "$CLI_CMD"; then |
| 1064 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
| 1065 | else |
| 1066 | fail "server or client failed to reach handshake stage" |
| 1067 | return |
| 1068 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1069 | fi |
| 1070 | fi |
| 1071 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1072 | SKIP_HANDSHAKE_CHECK="NO" |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 1073 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 1074 | # exit with status 0 when interrupted by a signal, and we don't really |
| 1075 | # care anyway), in case e.g. the server reports a memory leak. |
| 1076 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 1077 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1078 | return |
| 1079 | fi |
| 1080 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1081 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1082 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 1083 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1084 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1085 | 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] | 1086 | return |
| 1087 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1088 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1089 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1090 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1091 | # 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] | 1092 | while [ $# -gt 0 ] |
| 1093 | do |
| 1094 | case $1 in |
| 1095 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1096 | 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] | 1097 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1098 | return |
| 1099 | fi |
| 1100 | ;; |
| 1101 | |
| 1102 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1103 | 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] | 1104 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1105 | return |
| 1106 | fi |
| 1107 | ;; |
| 1108 | |
| 1109 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1110 | 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] | 1111 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1112 | fail "pattern '$2' MUST NOT be present in the Server output" |
| 1113 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1114 | return |
| 1115 | fi |
| 1116 | ;; |
| 1117 | |
| 1118 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1119 | 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] | 1120 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1121 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 1122 | fi |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1123 | return |
| 1124 | fi |
| 1125 | ;; |
| 1126 | |
| 1127 | # The filtering in the following two options (-u and -U) do the following |
| 1128 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 1129 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1130 | # - keep one of each non-unique line |
| 1131 | # - count how many lines remain |
| 1132 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 1133 | # if there were no duplicates. |
| 1134 | "-U") |
| 1135 | 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 |
| 1136 | fail "lines following pattern '$2' must be unique in Server output" |
| 1137 | return |
| 1138 | fi |
| 1139 | ;; |
| 1140 | |
| 1141 | "-u") |
| 1142 | 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 |
| 1143 | 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] | 1144 | return |
| 1145 | fi |
| 1146 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 1147 | "-F") |
| 1148 | if ! $2 "$SRV_OUT"; then |
| 1149 | fail "function call to '$2' failed on Server output" |
| 1150 | return |
| 1151 | fi |
| 1152 | ;; |
| 1153 | "-f") |
| 1154 | if ! $2 "$CLI_OUT"; then |
| 1155 | fail "function call to '$2' failed on Client output" |
| 1156 | return |
| 1157 | fi |
| 1158 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1159 | "-g") |
| 1160 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 1161 | fail "function call to '$2' failed on Server and Client output" |
| 1162 | return |
| 1163 | fi |
| 1164 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1165 | |
| 1166 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1167 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1168 | exit 1 |
| 1169 | esac |
| 1170 | shift 2 |
| 1171 | done |
| 1172 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1173 | # check valgrind's results |
| 1174 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1175 | 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] | 1176 | fail "Server has memory errors" |
| 1177 | return |
| 1178 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1179 | 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] | 1180 | fail "Client has memory errors" |
| 1181 | return |
| 1182 | fi |
| 1183 | fi |
| 1184 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1185 | # if we're here, everything is ok |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1186 | outcome=PASS |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1187 | } |
| 1188 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1189 | # Run the current test case: start the server and if applicable the proxy, run |
| 1190 | # the client, wait for all processes to finish or time out. |
| 1191 | # |
| 1192 | # Inputs: |
| 1193 | # * $NAME: test case name |
| 1194 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run |
| 1195 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs |
| 1196 | # |
| 1197 | # Outputs: |
| 1198 | # * $CLI_EXIT: client return code |
| 1199 | # * $SRV_RET: server return code |
| 1200 | do_run_test_once() { |
| 1201 | # run the commands |
| 1202 | if [ -n "$PXY_CMD" ]; then |
| 1203 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
| 1204 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 1205 | PXY_PID=$! |
| 1206 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
| 1207 | fi |
| 1208 | |
| 1209 | check_osrv_dtls |
| 1210 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
| 1211 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 1212 | SRV_PID=$! |
| 1213 | wait_server_start "$SRV_PORT" "$SRV_PID" |
| 1214 | |
| 1215 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
| 1216 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 1217 | wait_client_done |
| 1218 | |
| 1219 | sleep 0.05 |
| 1220 | |
| 1221 | # terminate the server (and the proxy) |
| 1222 | kill $SRV_PID |
| 1223 | wait $SRV_PID |
| 1224 | SRV_RET=$? |
| 1225 | |
| 1226 | if [ -n "$PXY_CMD" ]; then |
| 1227 | kill $PXY_PID >/dev/null 2>&1 |
| 1228 | wait $PXY_PID |
| 1229 | fi |
| 1230 | } |
| 1231 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1232 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
| 1233 | # Options: -s pattern pattern that must be present in server output |
| 1234 | # -c pattern pattern that must be present in client output |
| 1235 | # -u pattern lines after pattern must be unique in client output |
| 1236 | # -f call shell function on client output |
| 1237 | # -S pattern pattern that must be absent in server output |
| 1238 | # -C pattern pattern that must be absent in client output |
| 1239 | # -U pattern lines after pattern must be unique in server output |
| 1240 | # -F call shell function on server output |
| 1241 | # -g call shell function on server and client output |
| 1242 | run_test() { |
| 1243 | NAME="$1" |
| 1244 | shift 1 |
| 1245 | |
| 1246 | if is_excluded "$NAME"; then |
| 1247 | SKIP_NEXT="NO" |
| 1248 | # There was no request to run the test, so don't record its outcome. |
| 1249 | return |
| 1250 | fi |
| 1251 | |
| 1252 | print_name "$NAME" |
| 1253 | |
| 1254 | # Do we only run numbered tests? |
| 1255 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 1256 | case ",$RUN_TEST_NUMBER," in |
| 1257 | *",$TESTS,"*) :;; |
| 1258 | *) SKIP_NEXT="YES";; |
| 1259 | esac |
| 1260 | fi |
| 1261 | |
| 1262 | # does this test use a proxy? |
| 1263 | if [ "X$1" = "X-p" ]; then |
| 1264 | PXY_CMD="$2" |
| 1265 | shift 2 |
| 1266 | else |
| 1267 | PXY_CMD="" |
| 1268 | fi |
| 1269 | |
| 1270 | # get commands and client output |
| 1271 | SRV_CMD="$1" |
| 1272 | CLI_CMD="$2" |
| 1273 | CLI_EXPECT="$3" |
| 1274 | shift 3 |
| 1275 | |
| 1276 | # Check if test uses files |
| 1277 | case "$SRV_CMD $CLI_CMD" in |
| 1278 | *data_files/*) |
| 1279 | requires_config_enabled MBEDTLS_FS_IO;; |
| 1280 | esac |
| 1281 | |
Gilles Peskine | 82a4ab2 | 2022-02-25 19:46:30 +0100 | [diff] [blame] | 1282 | # Check if the test uses DTLS. |
| 1283 | detect_dtls "$SRV_CMD" |
| 1284 | if [ "$DTLS" -eq 1 ]; then |
| 1285 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 1286 | fi |
| 1287 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 1288 | # If the client or server requires certain features that can be detected |
| 1289 | # from their command-line arguments, check that they're enabled. |
| 1290 | detect_required_features "$SRV_CMD" "$@" |
| 1291 | detect_required_features "$CLI_CMD" "$@" |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1292 | |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 1293 | # If we're in a PSK-only build and the test can be adapted to PSK, do that. |
| 1294 | maybe_adapt_for_psk "$@" |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1295 | |
| 1296 | # should we skip? |
| 1297 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 1298 | SKIP_NEXT="NO" |
| 1299 | record_outcome "SKIP" |
| 1300 | SKIPS=$(( $SKIPS + 1 )) |
| 1301 | return |
| 1302 | fi |
| 1303 | |
| 1304 | analyze_test_commands "$@" |
| 1305 | |
Andrzej Kurek | 8db7c0e | 2022-04-01 08:52:06 -0400 | [diff] [blame] | 1306 | # One regular run and two retries |
| 1307 | TIMES_LEFT=3 |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1308 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1309 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1310 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1311 | do_run_test_once |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1312 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1313 | check_test_failure "$@" |
| 1314 | case $outcome in |
| 1315 | PASS) break;; |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1316 | RETRY*) printf "$outcome ";; |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1317 | FAIL) return;; |
| 1318 | esac |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1319 | done |
| 1320 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1321 | # If we get this far, the test case passed. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1322 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1323 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1324 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1325 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1326 | if [ -n "$PXY_CMD" ]; then |
| 1327 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1328 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1329 | fi |
| 1330 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1331 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1332 | } |
| 1333 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1334 | run_test_psa() { |
| 1335 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1336 | set_maybe_calc_verify none |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1337 | run_test "PSA-supported ciphersuite: $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1338 | "$P_SRV debug_level=3 force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1339 | "$P_CLI debug_level=3 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1340 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1341 | -c "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1342 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1343 | -s "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1344 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1345 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1346 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1347 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1348 | -S "error" \ |
| 1349 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1350 | unset maybe_calc_verify |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1351 | } |
| 1352 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1353 | run_test_psa_force_curve() { |
| 1354 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1355 | set_maybe_calc_verify none |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1356 | run_test "PSA - ECDH with $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1357 | "$P_SRV debug_level=4 force_version=tls12 curves=$1" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1358 | "$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] | 1359 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1360 | -c "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1361 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1362 | -s "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1363 | -s "calc PSA finished" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1364 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1365 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1366 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1367 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1368 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1369 | unset maybe_calc_verify |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1370 | } |
| 1371 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1372 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1373 | # a maximum fragment length. |
| 1374 | # first argument ($1) is MFL for SSL client |
| 1375 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1376 | run_test_memory_after_hanshake_with_mfl() |
| 1377 | { |
| 1378 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1379 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1380 | |
| 1381 | # Leave some margin for robustness |
| 1382 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1383 | |
| 1384 | run_test "Handshake memory usage (MFL $1)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1385 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1386 | "$P_CLI debug_level=3 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1387 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1388 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1389 | 0 \ |
| 1390 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1391 | } |
| 1392 | |
| 1393 | |
| 1394 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1395 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1396 | run_tests_memory_after_hanshake() |
| 1397 | { |
| 1398 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1399 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1400 | |
| 1401 | # first test with default MFU is to get reference memory usage |
| 1402 | MEMORY_USAGE_MFL_16K=0 |
| 1403 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1404 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1405 | "$P_CLI debug_level=3 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1406 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1407 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1408 | 0 \ |
| 1409 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1410 | |
| 1411 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1412 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1413 | |
| 1414 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1415 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1416 | |
| 1417 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1418 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1419 | |
| 1420 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1421 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1422 | } |
| 1423 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1424 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1425 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1426 | rm -f context_srv.txt |
| 1427 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1428 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1429 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1430 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1431 | 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] | 1432 | exit 1 |
| 1433 | } |
| 1434 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1435 | # |
| 1436 | # MAIN |
| 1437 | # |
| 1438 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1439 | get_options "$@" |
| 1440 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1441 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1442 | # patterns rather than regular expressions, use a case statement instead |
| 1443 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1444 | # detects simple cases: plain substring, everything, nothing. |
| 1445 | # |
| 1446 | # As an exception, the character '.' is treated as an ordinary character |
| 1447 | # if it is the only special character in the string. This is because it's |
| 1448 | # rare to need "any one character", but needing a literal '.' is common |
| 1449 | # (e.g. '-f "DTLS 1.2"'). |
| 1450 | need_grep= |
| 1451 | case "$FILTER" in |
| 1452 | '^$') simple_filter=;; |
| 1453 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1454 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1455 | need_grep=1;; |
| 1456 | *) # No regexp or shell-pattern special character |
| 1457 | simple_filter="*$FILTER*";; |
| 1458 | esac |
| 1459 | case "$EXCLUDE" in |
| 1460 | '^$') simple_exclude=;; |
| 1461 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1462 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1463 | need_grep=1;; |
| 1464 | *) # No regexp or shell-pattern special character |
| 1465 | simple_exclude="*$EXCLUDE*";; |
| 1466 | esac |
| 1467 | if [ -n "$need_grep" ]; then |
| 1468 | is_excluded () { |
| 1469 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1470 | } |
| 1471 | else |
| 1472 | is_excluded () { |
| 1473 | case "$1" in |
| 1474 | $simple_exclude) true;; |
| 1475 | $simple_filter) false;; |
| 1476 | *) true;; |
| 1477 | esac |
| 1478 | } |
| 1479 | fi |
| 1480 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1481 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1482 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1483 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1484 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1485 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1486 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1487 | exit 1 |
| 1488 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1489 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1490 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1491 | exit 1 |
| 1492 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1493 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1494 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1495 | exit 1 |
| 1496 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1497 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1498 | if which valgrind >/dev/null 2>&1; then :; else |
| 1499 | echo "Memcheck not possible. Valgrind not found" |
| 1500 | exit 1 |
| 1501 | fi |
| 1502 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1503 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 1504 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1505 | exit 1 |
| 1506 | fi |
| 1507 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1508 | # used by watchdog |
| 1509 | MAIN_PID="$$" |
| 1510 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1511 | # We use somewhat arbitrary delays for tests: |
| 1512 | # - how long do we wait for the server to start (when lsof not available)? |
| 1513 | # - how long do we allow for the client to finish? |
| 1514 | # (not to check performance, just to avoid waiting indefinitely) |
| 1515 | # Things are slower with valgrind, so give extra time here. |
| 1516 | # |
| 1517 | # Note: without lsof, there is a trade-off between the running time of this |
| 1518 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1519 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1520 | # 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] | 1521 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1522 | START_DELAY=6 |
| 1523 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1524 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1525 | START_DELAY=2 |
| 1526 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1527 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1528 | |
| 1529 | # some particular tests need more time: |
| 1530 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1531 | # - for the server, we sleep for a number of seconds after the client exits |
| 1532 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1533 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1534 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1535 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1536 | # 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] | 1537 | # +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] | 1538 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 1539 | # 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] | 1540 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1541 | 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] | 1542 | 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] | 1543 | O_SRV="$O_SRV -accept $SRV_PORT" |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1544 | 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] | 1545 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1546 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1547 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1548 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1549 | 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] | 1550 | 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] | 1551 | fi |
| 1552 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 1553 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 1554 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1555 | 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] | 1556 | O_NEXT_CLI="$O_NEXT_CLI -connect 127.0.0.1:+SRV_PORT" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 1557 | fi |
| 1558 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1559 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1560 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1561 | 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] | 1562 | fi |
| 1563 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1564 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1565 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1566 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1567 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1568 | # Allow SHA-1, because many of our test certificates use it |
| 1569 | P_SRV="$P_SRV allow_sha1=1" |
| 1570 | P_CLI="$P_CLI allow_sha1=1" |
| 1571 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1572 | # Also pick a unique name for intermediate files |
| 1573 | SRV_OUT="srv_out.$$" |
| 1574 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1575 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1576 | SESSION="session.$$" |
| 1577 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1578 | SKIP_NEXT="NO" |
| 1579 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1580 | trap cleanup INT TERM HUP |
| 1581 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1582 | # Basic test |
| 1583 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1584 | # Checks that: |
| 1585 | # - 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] | 1586 | # - the expected parameters are selected |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1587 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 1588 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Gilles Peskine | 1438e16 | 2022-04-05 22:00:32 +0200 | [diff] [blame] | 1589 | requires_config_enabled MBEDTLS_SHA512_C # "signature_algorithm ext: 6" |
| 1590 | requires_config_enabled MBEDTLS_ECP_DP_CURVE25519_ENABLED |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1591 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1592 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1593 | "$P_CLI" \ |
| 1594 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1595 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1596 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1597 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 1598 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1599 | -S "error" \ |
| 1600 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1601 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1602 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 1603 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1604 | run_test "Default, DTLS" \ |
| 1605 | "$P_SRV dtls=1" \ |
| 1606 | "$P_CLI dtls=1" \ |
| 1607 | 0 \ |
| 1608 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1609 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1610 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1611 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1612 | run_test "TLS client auth: required" \ |
| 1613 | "$P_SRV auth_mode=required" \ |
| 1614 | "$P_CLI" \ |
| 1615 | 0 \ |
| 1616 | -s "Verifying peer X.509 certificate... ok" |
| 1617 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1618 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 1619 | run_test "key size: TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1620 | "$P_SRV" \ |
| 1621 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1622 | 0 \ |
| 1623 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1624 | -c "Key size is 256" |
| 1625 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1626 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 1627 | run_test "key size: TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1628 | "$P_SRV" \ |
| 1629 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1630 | 0 \ |
| 1631 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1632 | -c "Key size is 128" |
| 1633 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1634 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1635 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1636 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1637 | requires_config_enabled MBEDTLS_SHA256_C |
| 1638 | run_test "TLS: password protected client key" \ |
| 1639 | "$P_SRV auth_mode=required" \ |
| 1640 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1641 | 0 |
| 1642 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1643 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1644 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1645 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1646 | requires_config_enabled MBEDTLS_SHA256_C |
| 1647 | run_test "TLS: password protected server key" \ |
| 1648 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1649 | "$P_CLI" \ |
| 1650 | 0 |
| 1651 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1652 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1653 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1654 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1655 | requires_config_enabled MBEDTLS_RSA_C |
| 1656 | requires_config_enabled MBEDTLS_SHA256_C |
| 1657 | run_test "TLS: password protected server key, two certificates" \ |
| 1658 | "$P_SRV \ |
| 1659 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1660 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1661 | "$P_CLI" \ |
| 1662 | 0 |
| 1663 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1664 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1665 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1666 | run_test "CA callback on client" \ |
| 1667 | "$P_SRV debug_level=3" \ |
| 1668 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1669 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1670 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1671 | -S "error" \ |
| 1672 | -C "error" |
| 1673 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1674 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1675 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1676 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1677 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1678 | requires_config_enabled MBEDTLS_SHA256_C |
| 1679 | run_test "CA callback on server" \ |
| 1680 | "$P_SRV auth_mode=required" \ |
| 1681 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1682 | key_file=data_files/server5.key" \ |
| 1683 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1684 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1685 | -s "Verifying peer X.509 certificate... ok" \ |
| 1686 | -S "error" \ |
| 1687 | -C "error" |
| 1688 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1689 | # Test using an EC opaque private key for client authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1690 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1691 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1692 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1693 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1694 | requires_config_enabled MBEDTLS_SHA256_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1695 | run_test "TLS-ECDHE-ECDSA Opaque key for client authentication" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1696 | "$P_SRV auth_mode=required crt_file=data_files/server5.crt \ |
| 1697 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1698 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1699 | key_file=data_files/server5.key" \ |
| 1700 | 0 \ |
| 1701 | -c "key type: Opaque" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1702 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1703 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1704 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1705 | -S "error" \ |
| 1706 | -C "error" |
| 1707 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1708 | # Test using a RSA opaque private key for client authentication |
| 1709 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1710 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1711 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1712 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1713 | requires_config_enabled MBEDTLS_RSA_C |
| 1714 | requires_config_enabled MBEDTLS_SHA256_C |
| 1715 | run_test "TLS-ECDHE-RSA Opaque key for client authentication" \ |
| 1716 | "$P_SRV auth_mode=required crt_file=data_files/server2-sha256.crt \ |
| 1717 | key_file=data_files/server2.key" \ |
| 1718 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 1719 | key_file=data_files/server2.key" \ |
| 1720 | 0 \ |
| 1721 | -c "key type: Opaque" \ |
| 1722 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 1723 | -s "Verifying peer X.509 certificate... ok" \ |
| 1724 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 1725 | -S "error" \ |
| 1726 | -C "error" |
| 1727 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 1728 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1729 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1730 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1731 | requires_config_enabled MBEDTLS_RSA_C |
| 1732 | requires_config_enabled MBEDTLS_SHA256_C |
| 1733 | run_test "TLS-DHE-RSA Opaque key for client authentication" \ |
| 1734 | "$P_SRV auth_mode=required crt_file=data_files/server2-sha256.crt \ |
| 1735 | key_file=data_files/server2.key" \ |
| 1736 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 1737 | key_file=data_files/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 1738 | 0 \ |
| 1739 | -c "key type: Opaque" \ |
| 1740 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 1741 | -s "Verifying peer X.509 certificate... ok" \ |
| 1742 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 1743 | -S "error" \ |
| 1744 | -C "error" |
| 1745 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1746 | # Test using an EC opaque private key for server authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1747 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1748 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1749 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1750 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1751 | requires_config_enabled MBEDTLS_SHA256_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1752 | run_test "TLS-ECDHE-ECDSA Opaque key for server authentication" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1753 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
| 1754 | key_file=data_files/server5.key" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1755 | "$P_CLI crt_file=data_files/server5.crt \ |
| 1756 | key_file=data_files/server5.key" \ |
| 1757 | 0 \ |
| 1758 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1759 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 1760 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1761 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1762 | -S "error" \ |
| 1763 | -C "error" |
| 1764 | |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 1765 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1766 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1767 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1768 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1769 | requires_config_enabled MBEDTLS_SHA256_C |
| 1770 | run_test "Opaque key for server authentication (ECDH-)" \ |
Neil Armstrong | b7b549a | 2022-03-25 15:13:02 +0100 | [diff] [blame] | 1771 | "$P_SRV force_version=tls12 auth_mode=required key_opaque=1\ |
| 1772 | crt_file=data_files/server5.ku-ka.crt\ |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 1773 | key_file=data_files/server5.key" \ |
| 1774 | "$P_CLI" \ |
| 1775 | 0 \ |
| 1776 | -c "Verifying peer X.509 certificate... ok" \ |
| 1777 | -c "Ciphersuite is TLS-ECDH-" \ |
| 1778 | -s "key types: Opaque, none" \ |
| 1779 | -s "Ciphersuite is TLS-ECDH-" \ |
| 1780 | -S "error" \ |
| 1781 | -C "error" |
| 1782 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1783 | # Test using a RSA opaque private key for server authentication |
| 1784 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1785 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1786 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1787 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1788 | requires_config_enabled MBEDTLS_RSA_C |
| 1789 | requires_config_enabled MBEDTLS_SHA256_C |
| 1790 | run_test "TLS-ECDHE-RSA Opaque key for server authentication" \ |
| 1791 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 1792 | key_file=data_files/server2.key" \ |
| 1793 | "$P_CLI crt_file=data_files/server2-sha256.crt \ |
| 1794 | key_file=data_files/server2.key" \ |
| 1795 | 0 \ |
| 1796 | -c "Verifying peer X.509 certificate... ok" \ |
| 1797 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 1798 | -s "key types: Opaque, none" \ |
| 1799 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 1800 | -S "error" \ |
| 1801 | -C "error" |
| 1802 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 1803 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1804 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1805 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1806 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1807 | requires_config_enabled MBEDTLS_RSA_C |
| 1808 | requires_config_enabled MBEDTLS_SHA256_C |
| 1809 | run_test "TLS-DHE-RSA Opaque key for server authentication" \ |
| 1810 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 1811 | key_file=data_files/server2.key" \ |
| 1812 | "$P_CLI crt_file=data_files/server2-sha256.crt \ |
| 1813 | key_file=data_files/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 1814 | 0 \ |
| 1815 | -c "Verifying peer X.509 certificate... ok" \ |
| 1816 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 1817 | -s "key types: Opaque, none" \ |
| 1818 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 1819 | -S "error" \ |
| 1820 | -C "error" |
| 1821 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1822 | # Test using an EC opaque private key for client/server authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1823 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1824 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1825 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1826 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1827 | requires_config_enabled MBEDTLS_SHA256_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1828 | run_test "TLS-ECDHE-ECDSA Opaque key for client/server authentication" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1829 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
| 1830 | key_file=data_files/server5.key" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1831 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1832 | key_file=data_files/server5.key" \ |
| 1833 | 0 \ |
| 1834 | -c "key type: Opaque" \ |
| 1835 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1836 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 1837 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1838 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1839 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1840 | -S "error" \ |
| 1841 | -C "error" |
| 1842 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1843 | # Test using a RSA opaque private key for client/server authentication |
| 1844 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1845 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1846 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1847 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1848 | requires_config_enabled MBEDTLS_RSA_C |
| 1849 | requires_config_enabled MBEDTLS_SHA256_C |
| 1850 | run_test "TLS-ECDHE-RSA Opaque key for client/server authentication" \ |
| 1851 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 1852 | key_file=data_files/server2.key" \ |
| 1853 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 1854 | key_file=data_files/server2.key" \ |
| 1855 | 0 \ |
| 1856 | -c "key type: Opaque" \ |
| 1857 | -c "Verifying peer X.509 certificate... ok" \ |
| 1858 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 1859 | -s "key types: Opaque, none" \ |
| 1860 | -s "Verifying peer X.509 certificate... ok" \ |
| 1861 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 1862 | -S "error" \ |
| 1863 | -C "error" |
| 1864 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 1865 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1866 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1867 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1868 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1869 | requires_config_enabled MBEDTLS_RSA_C |
| 1870 | requires_config_enabled MBEDTLS_SHA256_C |
| 1871 | run_test "TLS-DHE-RSA Opaque key for client/server authentication" \ |
| 1872 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 1873 | key_file=data_files/server2.key" \ |
| 1874 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 1875 | key_file=data_files/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 1876 | 0 \ |
| 1877 | -c "key type: Opaque" \ |
| 1878 | -c "Verifying peer X.509 certificate... ok" \ |
| 1879 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 1880 | -s "key types: Opaque, none" \ |
| 1881 | -s "Verifying peer X.509 certificate... ok" \ |
| 1882 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 1883 | -S "error" \ |
| 1884 | -C "error" |
| 1885 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1886 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 1887 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 1888 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 1889 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 1890 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 1891 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 1892 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 1893 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 1894 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 1895 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 1896 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 1897 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1898 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1899 | run_test_psa_force_curve "secp521r1" |
| 1900 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 1901 | run_test_psa_force_curve "brainpoolP512r1" |
| 1902 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 1903 | run_test_psa_force_curve "secp384r1" |
| 1904 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1905 | run_test_psa_force_curve "brainpoolP384r1" |
| 1906 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1907 | run_test_psa_force_curve "secp256r1" |
| 1908 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1909 | run_test_psa_force_curve "secp256k1" |
| 1910 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1911 | run_test_psa_force_curve "brainpoolP256r1" |
| 1912 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1913 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1914 | ## SECP224K1 is buggy via the PSA API |
Dave Rodgman | 017a199 | 2022-03-31 14:07:01 +0100 | [diff] [blame] | 1915 | ## (https://github.com/Mbed-TLS/mbedtls/issues/3541), |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1916 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 1917 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 1918 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 1919 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1920 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1921 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1922 | run_test_psa_force_curve "secp192r1" |
| 1923 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1924 | run_test_psa_force_curve "secp192k1" |
| 1925 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1926 | # Test current time in ServerHello |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1927 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1928 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 1929 | run_test "ServerHello contains gmt_unix_time" \ |
| 1930 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1931 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1932 | 0 \ |
| 1933 | -f "check_server_hello_time" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1934 | -F "check_server_hello_time" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1935 | |
| 1936 | # Test for uniqueness of IVs in AEAD ciphersuites |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1937 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1938 | run_test "Unique IV in GCM" \ |
| 1939 | "$P_SRV exchanges=20 debug_level=4" \ |
| 1940 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 1941 | 0 \ |
| 1942 | -u "IV used" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1943 | -U "IV used" |
| 1944 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1945 | # Tests for certificate verification callback |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1946 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1947 | run_test "Configuration-specific CRT verification callback" \ |
| 1948 | "$P_SRV debug_level=3" \ |
| 1949 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1950 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1951 | -S "error" \ |
| 1952 | -c "Verify requested for " \ |
| 1953 | -c "Use configuration-specific verification callback" \ |
| 1954 | -C "Use context-specific verification callback" \ |
| 1955 | -C "error" |
| 1956 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1957 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1958 | run_test "Context-specific CRT verification callback" \ |
| 1959 | "$P_SRV debug_level=3" \ |
| 1960 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 1961 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1962 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1963 | -c "Verify requested for " \ |
| 1964 | -c "Use context-specific verification callback" \ |
| 1965 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1966 | -C "error" |
| 1967 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1968 | # Tests for SHA-1 support |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1969 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1970 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1971 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1972 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1973 | 1 \ |
| 1974 | -c "The certificate is signed with an unacceptable hash" |
| 1975 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1976 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1977 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1978 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1979 | "$P_CLI allow_sha1=1" \ |
| 1980 | 0 |
| 1981 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1982 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1983 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1984 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1985 | "$P_CLI allow_sha1=0" \ |
| 1986 | 0 |
| 1987 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1988 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1989 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1990 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1991 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1992 | 1 \ |
| 1993 | -s "The certificate is signed with an unacceptable hash" |
| 1994 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1995 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1996 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1997 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1998 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1999 | 0 |
| 2000 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2001 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2002 | run_test "SHA-256 allowed by default in client certificate" \ |
| 2003 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 2004 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 2005 | 0 |
| 2006 | |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2007 | # Dummy TLS 1.3 test |
| 2008 | # Currently only checking that passing TLS 1.3 key exchange modes to |
| 2009 | # ssl_client2/ssl_server2 example programs works. |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2010 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2011 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2012 | run_test "TLS 1.3: key exchange mode parameter passing: PSK only" \ |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2013 | "$P_SRV tls13_kex_modes=psk debug_level=4" \ |
| 2014 | "$P_CLI tls13_kex_modes=psk debug_level=4" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2015 | 0 |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2016 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2017 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2018 | 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] | 2019 | "$P_SRV tls13_kex_modes=psk_ephemeral" \ |
| 2020 | "$P_CLI tls13_kex_modes=psk_ephemeral" \ |
| 2021 | 0 |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2022 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2023 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2024 | 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] | 2025 | "$P_SRV tls13_kex_modes=ephemeral" \ |
| 2026 | "$P_CLI tls13_kex_modes=ephemeral" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2027 | 0 |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2028 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2029 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2030 | run_test "TLS 1.3: key exchange mode parameter passing: All ephemeral" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2031 | "$P_SRV tls13_kex_modes=ephemeral_all" \ |
| 2032 | "$P_CLI tls13_kex_modes=ephemeral_all" \ |
| 2033 | 0 |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2034 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2035 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2036 | run_test "TLS 1.3: key exchange mode parameter passing: All PSK" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2037 | "$P_SRV tls13_kex_modes=psk_all" \ |
| 2038 | "$P_CLI tls13_kex_modes=psk_all" \ |
| 2039 | 0 |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2040 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2041 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2042 | run_test "TLS 1.3: key exchange mode parameter passing: All" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2043 | "$P_SRV tls13_kex_modes=all" \ |
| 2044 | "$P_CLI tls13_kex_modes=all" \ |
| 2045 | 0 |
| 2046 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2047 | # Tests for datagram packing |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2048 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2049 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 2050 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2051 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2052 | 0 \ |
| 2053 | -c "next record in same datagram" \ |
| 2054 | -s "next record in same datagram" |
| 2055 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2056 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2057 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 2058 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2059 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2060 | 0 \ |
| 2061 | -s "next record in same datagram" \ |
| 2062 | -C "next record in same datagram" |
| 2063 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2064 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2065 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 2066 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2067 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2068 | 0 \ |
| 2069 | -S "next record in same datagram" \ |
| 2070 | -c "next record in same datagram" |
| 2071 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2072 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2073 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 2074 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2075 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2076 | 0 \ |
| 2077 | -S "next record in same datagram" \ |
| 2078 | -C "next record in same datagram" |
| 2079 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2080 | # Tests for Context serialization |
| 2081 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2082 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2083 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2084 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2085 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2086 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2087 | 0 \ |
| 2088 | -c "Deserializing connection..." \ |
| 2089 | -S "Deserializing connection..." |
| 2090 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2091 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2092 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2093 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 2094 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2095 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2096 | 0 \ |
| 2097 | -c "Deserializing connection..." \ |
| 2098 | -S "Deserializing connection..." |
| 2099 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2100 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2101 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2102 | run_test "Context serialization, client serializes, GCM" \ |
| 2103 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2104 | "$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] | 2105 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2106 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2107 | -S "Deserializing connection..." |
| 2108 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2109 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2110 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2111 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2112 | run_test "Context serialization, client serializes, with CID" \ |
| 2113 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2114 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2115 | 0 \ |
| 2116 | -c "Deserializing connection..." \ |
| 2117 | -S "Deserializing connection..." |
| 2118 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2119 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2120 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2121 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2122 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2123 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2124 | 0 \ |
| 2125 | -C "Deserializing connection..." \ |
| 2126 | -s "Deserializing connection..." |
| 2127 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2128 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2129 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2130 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 2131 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2132 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2133 | 0 \ |
| 2134 | -C "Deserializing connection..." \ |
| 2135 | -s "Deserializing connection..." |
| 2136 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2137 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2138 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2139 | run_test "Context serialization, server serializes, GCM" \ |
| 2140 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2141 | "$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] | 2142 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2143 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2144 | -s "Deserializing connection..." |
| 2145 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2146 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2147 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2148 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2149 | run_test "Context serialization, server serializes, with CID" \ |
| 2150 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2151 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2152 | 0 \ |
| 2153 | -C "Deserializing connection..." \ |
| 2154 | -s "Deserializing connection..." |
| 2155 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2156 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2157 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2158 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2159 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2160 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2161 | 0 \ |
| 2162 | -c "Deserializing connection..." \ |
| 2163 | -s "Deserializing connection..." |
| 2164 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2165 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2166 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2167 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 2168 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2169 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2170 | 0 \ |
| 2171 | -c "Deserializing connection..." \ |
| 2172 | -s "Deserializing connection..." |
| 2173 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2174 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2175 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2176 | run_test "Context serialization, both serialize, GCM" \ |
| 2177 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2178 | "$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] | 2179 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2180 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2181 | -s "Deserializing connection..." |
| 2182 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2183 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2184 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2185 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2186 | run_test "Context serialization, both serialize, with CID" \ |
| 2187 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2188 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2189 | 0 \ |
| 2190 | -c "Deserializing connection..." \ |
| 2191 | -s "Deserializing connection..." |
| 2192 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2193 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2194 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2195 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2196 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2197 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2198 | 0 \ |
| 2199 | -c "Deserializing connection..." \ |
| 2200 | -S "Deserializing connection..." |
| 2201 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2202 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2203 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2204 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 2205 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2206 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2207 | 0 \ |
| 2208 | -c "Deserializing connection..." \ |
| 2209 | -S "Deserializing connection..." |
| 2210 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2211 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2212 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2213 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 2214 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2215 | "$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] | 2216 | 0 \ |
| 2217 | -c "Deserializing connection..." \ |
| 2218 | -S "Deserializing connection..." |
| 2219 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2220 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2221 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2222 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2223 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 2224 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2225 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2226 | 0 \ |
| 2227 | -c "Deserializing connection..." \ |
| 2228 | -S "Deserializing connection..." |
| 2229 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2230 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2231 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2232 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2233 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2234 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2235 | 0 \ |
| 2236 | -C "Deserializing connection..." \ |
| 2237 | -s "Deserializing connection..." |
| 2238 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2239 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2240 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2241 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 2242 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2243 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2244 | 0 \ |
| 2245 | -C "Deserializing connection..." \ |
| 2246 | -s "Deserializing connection..." |
| 2247 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2248 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2249 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2250 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 2251 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2252 | "$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] | 2253 | 0 \ |
| 2254 | -C "Deserializing connection..." \ |
| 2255 | -s "Deserializing connection..." |
| 2256 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2257 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2258 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2259 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2260 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 2261 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2262 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2263 | 0 \ |
| 2264 | -C "Deserializing connection..." \ |
| 2265 | -s "Deserializing connection..." |
| 2266 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2267 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2268 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2269 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2270 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2271 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2272 | 0 \ |
| 2273 | -c "Deserializing connection..." \ |
| 2274 | -s "Deserializing connection..." |
| 2275 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2276 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2277 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2278 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 2279 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2280 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2281 | 0 \ |
| 2282 | -c "Deserializing connection..." \ |
| 2283 | -s "Deserializing connection..." |
| 2284 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2285 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2286 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2287 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 2288 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2289 | "$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] | 2290 | 0 \ |
| 2291 | -c "Deserializing connection..." \ |
| 2292 | -s "Deserializing connection..." |
| 2293 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2294 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2295 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2296 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2297 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 2298 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2299 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2300 | 0 \ |
| 2301 | -c "Deserializing connection..." \ |
| 2302 | -s "Deserializing connection..." |
| 2303 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2304 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 2305 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2306 | run_test "Saving the serialized context to a file" \ |
| 2307 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 2308 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 2309 | 0 \ |
| 2310 | -s "Save serialized context to a file... ok" \ |
| 2311 | -c "Save serialized context to a file... ok" |
| 2312 | rm -f context_srv.txt |
| 2313 | rm -f context_cli.txt |
| 2314 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2315 | # Tests for DTLS Connection ID extension |
| 2316 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2317 | # So far, the CID API isn't implemented, so we can't |
| 2318 | # grep for output witnessing its use. This needs to be |
| 2319 | # changed once the CID extension is implemented. |
| 2320 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2321 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2322 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2323 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2324 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 2325 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2326 | 0 \ |
| 2327 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2328 | -s "found CID extension" \ |
| 2329 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2330 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2331 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2332 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2333 | -C "found CID extension" \ |
| 2334 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2335 | -C "Copy CIDs into SSL transform" \ |
| 2336 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2337 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2338 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2339 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2340 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2341 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2342 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 2343 | 0 \ |
| 2344 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2345 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2346 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2347 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2348 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2349 | -C "found CID extension" \ |
| 2350 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2351 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 2352 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2353 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2354 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2355 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2356 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2357 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2358 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 2359 | 0 \ |
| 2360 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2361 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2362 | -c "client hello, adding CID extension" \ |
| 2363 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2364 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2365 | -s "server hello, adding CID extension" \ |
| 2366 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2367 | -c "Use of CID extension negotiated" \ |
| 2368 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2369 | -c "Copy CIDs into SSL transform" \ |
| 2370 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2371 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2372 | -s "Use of Connection ID has been negotiated" \ |
| 2373 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2374 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2375 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2376 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2377 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2378 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2379 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 2380 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 2381 | 0 \ |
| 2382 | -c "Enable use of CID extension." \ |
| 2383 | -s "Enable use of CID extension." \ |
| 2384 | -c "client hello, adding CID extension" \ |
| 2385 | -s "found CID extension" \ |
| 2386 | -s "Use of CID extension negotiated" \ |
| 2387 | -s "server hello, adding CID extension" \ |
| 2388 | -c "found CID extension" \ |
| 2389 | -c "Use of CID extension negotiated" \ |
| 2390 | -s "Copy CIDs into SSL transform" \ |
| 2391 | -c "Copy CIDs into SSL transform" \ |
| 2392 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2393 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2394 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2395 | -c "Use of Connection ID has been negotiated" \ |
| 2396 | -c "ignoring unexpected CID" \ |
| 2397 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2398 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2399 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2400 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2401 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 2402 | -p "$P_PXY mtu=800" \ |
| 2403 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2404 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2405 | 0 \ |
| 2406 | -c "Enable use of CID extension." \ |
| 2407 | -s "Enable use of CID extension." \ |
| 2408 | -c "client hello, adding CID extension" \ |
| 2409 | -s "found CID extension" \ |
| 2410 | -s "Use of CID extension negotiated" \ |
| 2411 | -s "server hello, adding CID extension" \ |
| 2412 | -c "found CID extension" \ |
| 2413 | -c "Use of CID extension negotiated" \ |
| 2414 | -s "Copy CIDs into SSL transform" \ |
| 2415 | -c "Copy CIDs into SSL transform" \ |
| 2416 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2417 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2418 | -s "Use of Connection ID has been negotiated" \ |
| 2419 | -c "Use of Connection ID has been negotiated" |
| 2420 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2421 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2422 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2423 | 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] | 2424 | -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] | 2425 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2426 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2427 | 0 \ |
| 2428 | -c "Enable use of CID extension." \ |
| 2429 | -s "Enable use of CID extension." \ |
| 2430 | -c "client hello, adding CID extension" \ |
| 2431 | -s "found CID extension" \ |
| 2432 | -s "Use of CID extension negotiated" \ |
| 2433 | -s "server hello, adding CID extension" \ |
| 2434 | -c "found CID extension" \ |
| 2435 | -c "Use of CID extension negotiated" \ |
| 2436 | -s "Copy CIDs into SSL transform" \ |
| 2437 | -c "Copy CIDs into SSL transform" \ |
| 2438 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2439 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2440 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2441 | -c "Use of Connection ID has been negotiated" \ |
| 2442 | -c "ignoring unexpected CID" \ |
| 2443 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2444 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2445 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2446 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2447 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2448 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2449 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2450 | 0 \ |
| 2451 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2452 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2453 | -c "client hello, adding CID extension" \ |
| 2454 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2455 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2456 | -s "server hello, adding CID extension" \ |
| 2457 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2458 | -c "Use of CID extension negotiated" \ |
| 2459 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2460 | -c "Copy CIDs into SSL transform" \ |
| 2461 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2462 | -s "Peer CID (length 0 Bytes):" \ |
| 2463 | -s "Use of Connection ID has been negotiated" \ |
| 2464 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2465 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2466 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2467 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2468 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2469 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2470 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2471 | 0 \ |
| 2472 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2473 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2474 | -c "client hello, adding CID extension" \ |
| 2475 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2476 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2477 | -s "server hello, adding CID extension" \ |
| 2478 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2479 | -c "Use of CID extension negotiated" \ |
| 2480 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2481 | -c "Copy CIDs into SSL transform" \ |
| 2482 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2483 | -c "Peer CID (length 0 Bytes):" \ |
| 2484 | -s "Use of Connection ID has been negotiated" \ |
| 2485 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2486 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2487 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2488 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2489 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2490 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2491 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2492 | 0 \ |
| 2493 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2494 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2495 | -c "client hello, adding CID extension" \ |
| 2496 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2497 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2498 | -s "server hello, adding CID extension" \ |
| 2499 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2500 | -c "Use of CID extension negotiated" \ |
| 2501 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2502 | -c "Copy CIDs into SSL transform" \ |
| 2503 | -S "Use of Connection ID has been negotiated" \ |
| 2504 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2505 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2506 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2507 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2508 | 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] | 2509 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2510 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2511 | 0 \ |
| 2512 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2513 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2514 | -c "client hello, adding CID extension" \ |
| 2515 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2516 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2517 | -s "server hello, adding CID extension" \ |
| 2518 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2519 | -c "Use of CID extension negotiated" \ |
| 2520 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2521 | -c "Copy CIDs into SSL transform" \ |
| 2522 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2523 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2524 | -s "Use of Connection ID has been negotiated" \ |
| 2525 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2526 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2527 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2528 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2529 | 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] | 2530 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2531 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2532 | 0 \ |
| 2533 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2534 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2535 | -c "client hello, adding CID extension" \ |
| 2536 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2537 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2538 | -s "server hello, adding CID extension" \ |
| 2539 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2540 | -c "Use of CID extension negotiated" \ |
| 2541 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2542 | -c "Copy CIDs into SSL transform" \ |
| 2543 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2544 | -s "Peer CID (length 0 Bytes):" \ |
| 2545 | -s "Use of Connection ID has been negotiated" \ |
| 2546 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2547 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2548 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2549 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2550 | 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] | 2551 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2552 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2553 | 0 \ |
| 2554 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2555 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2556 | -c "client hello, adding CID extension" \ |
| 2557 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2558 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2559 | -s "server hello, adding CID extension" \ |
| 2560 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2561 | -c "Use of CID extension negotiated" \ |
| 2562 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2563 | -c "Copy CIDs into SSL transform" \ |
| 2564 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2565 | -c "Peer CID (length 0 Bytes):" \ |
| 2566 | -s "Use of Connection ID has been negotiated" \ |
| 2567 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2568 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2569 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2570 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2571 | 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] | 2572 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2573 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2574 | 0 \ |
| 2575 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2576 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2577 | -c "client hello, adding CID extension" \ |
| 2578 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2579 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2580 | -s "server hello, adding CID extension" \ |
| 2581 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2582 | -c "Use of CID extension negotiated" \ |
| 2583 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2584 | -c "Copy CIDs into SSL transform" \ |
| 2585 | -S "Use of Connection ID has been negotiated" \ |
| 2586 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2587 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2588 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2589 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2590 | 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] | 2591 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2592 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2593 | 0 \ |
| 2594 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2595 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2596 | -c "client hello, adding CID extension" \ |
| 2597 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2598 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2599 | -s "server hello, adding CID extension" \ |
| 2600 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2601 | -c "Use of CID extension negotiated" \ |
| 2602 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2603 | -c "Copy CIDs into SSL transform" \ |
| 2604 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2605 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2606 | -s "Use of Connection ID has been negotiated" \ |
| 2607 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2608 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2609 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2610 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2611 | 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] | 2612 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2613 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2614 | 0 \ |
| 2615 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2616 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2617 | -c "client hello, adding CID extension" \ |
| 2618 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2619 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2620 | -s "server hello, adding CID extension" \ |
| 2621 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2622 | -c "Use of CID extension negotiated" \ |
| 2623 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2624 | -c "Copy CIDs into SSL transform" \ |
| 2625 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2626 | -s "Peer CID (length 0 Bytes):" \ |
| 2627 | -s "Use of Connection ID has been negotiated" \ |
| 2628 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2629 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2630 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2631 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2632 | 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] | 2633 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2634 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2635 | 0 \ |
| 2636 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2637 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2638 | -c "client hello, adding CID extension" \ |
| 2639 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2640 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2641 | -s "server hello, adding CID extension" \ |
| 2642 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2643 | -c "Use of CID extension negotiated" \ |
| 2644 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2645 | -c "Copy CIDs into SSL transform" \ |
| 2646 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2647 | -c "Peer CID (length 0 Bytes):" \ |
| 2648 | -s "Use of Connection ID has been negotiated" \ |
| 2649 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2650 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2651 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2652 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2653 | 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] | 2654 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2655 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2656 | 0 \ |
| 2657 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2658 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2659 | -c "client hello, adding CID extension" \ |
| 2660 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2661 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2662 | -s "server hello, adding CID extension" \ |
| 2663 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2664 | -c "Use of CID extension negotiated" \ |
| 2665 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2666 | -c "Copy CIDs into SSL transform" \ |
| 2667 | -S "Use of Connection ID has been negotiated" \ |
| 2668 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2669 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2670 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2671 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 2672 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2673 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2674 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2675 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2676 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2677 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2678 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2679 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2680 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2681 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2682 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2683 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2684 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2685 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2686 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2687 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2688 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2689 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2690 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2691 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2692 | 0 \ |
| 2693 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2694 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2695 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2696 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2697 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2698 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2699 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2700 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2701 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2702 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2703 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2704 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2705 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 2706 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2707 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2708 | 0 \ |
| 2709 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2710 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2711 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2712 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2713 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2714 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2715 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2716 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2717 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2718 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2719 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2720 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2721 | 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] | 2722 | -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] | 2723 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2724 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2725 | 0 \ |
| 2726 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2727 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2728 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2729 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2730 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2731 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2732 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2733 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2734 | -c "ignoring unexpected CID" \ |
| 2735 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2736 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2737 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2738 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2739 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2740 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2741 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2742 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2743 | 0 \ |
| 2744 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2745 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2746 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2747 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2748 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2749 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2750 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2751 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2752 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2753 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2754 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2755 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2756 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 2757 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2758 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2759 | 0 \ |
| 2760 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2761 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2762 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2763 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2764 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2765 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2766 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2767 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2768 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2769 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2770 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2771 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2772 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2773 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2774 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2775 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2776 | 0 \ |
| 2777 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2778 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2779 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2780 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2781 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2782 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2783 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2784 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2785 | -c "ignoring unexpected CID" \ |
| 2786 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2787 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2788 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2789 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2790 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2791 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2792 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2793 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2794 | 0 \ |
| 2795 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2796 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2797 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2798 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2799 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2800 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2801 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2802 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2803 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2804 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2805 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 2806 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2807 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2808 | 0 \ |
| 2809 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2810 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2811 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2812 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2813 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2814 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2815 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2816 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2817 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2818 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2819 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2820 | -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] | 2821 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2822 | "$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" \ |
| 2823 | 0 \ |
| 2824 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2825 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2826 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2827 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2828 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2829 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2830 | -c "ignoring unexpected CID" \ |
| 2831 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2832 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2833 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2834 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2835 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2836 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2837 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2838 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2839 | 0 \ |
| 2840 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2841 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2842 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2843 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2844 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2845 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2846 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2847 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2848 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 2849 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2850 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2851 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2852 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2853 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2854 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2855 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2856 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2857 | 0 \ |
| 2858 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2859 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2860 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2861 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2862 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2863 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2864 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2865 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2866 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2867 | -c "ignoring unexpected CID" \ |
| 2868 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2869 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2870 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2871 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2872 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2873 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 2874 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2875 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2876 | 0 \ |
| 2877 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2878 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2879 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2880 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2881 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2882 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2883 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2884 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2885 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2886 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2887 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2888 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2889 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2890 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2891 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2892 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2893 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2894 | 0 \ |
| 2895 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2896 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2897 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2898 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2899 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2900 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2901 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2902 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2903 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2904 | -c "ignoring unexpected CID" \ |
| 2905 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2906 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 2907 | # 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] | 2908 | # tests check that the buffer contents are reallocated when the message is |
| 2909 | # larger than the buffer. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2910 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2911 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2912 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2913 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2914 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 2915 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2916 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 2917 | 0 \ |
| 2918 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2919 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2920 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2921 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2922 | -s "Reallocating in_buf" \ |
| 2923 | -s "Reallocating out_buf" |
| 2924 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2925 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2926 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2927 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2928 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2929 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 2930 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2931 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 2932 | 0 \ |
| 2933 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2934 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2935 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2936 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2937 | -s "Reallocating in_buf" \ |
| 2938 | -s "Reallocating out_buf" |
| 2939 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2940 | # Tests for Encrypt-then-MAC extension |
| 2941 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2942 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2943 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2944 | "$P_SRV debug_level=3 \ |
| 2945 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2946 | "$P_CLI debug_level=3" \ |
| 2947 | 0 \ |
| 2948 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2949 | -s "found encrypt then mac extension" \ |
| 2950 | -s "server hello, adding encrypt then mac extension" \ |
| 2951 | -c "found encrypt_then_mac extension" \ |
| 2952 | -c "using encrypt then mac" \ |
| 2953 | -s "using encrypt then mac" |
| 2954 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2955 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2956 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2957 | "$P_SRV debug_level=3 etm=0 \ |
| 2958 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2959 | "$P_CLI debug_level=3 etm=1" \ |
| 2960 | 0 \ |
| 2961 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2962 | -s "found encrypt then mac extension" \ |
| 2963 | -S "server hello, adding encrypt then mac extension" \ |
| 2964 | -C "found encrypt_then_mac extension" \ |
| 2965 | -C "using encrypt then mac" \ |
| 2966 | -S "using encrypt then mac" |
| 2967 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2968 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2969 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 2970 | "$P_SRV debug_level=3 etm=1 \ |
| 2971 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 2972 | "$P_CLI debug_level=3 etm=1" \ |
| 2973 | 0 \ |
| 2974 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2975 | -s "found encrypt then mac extension" \ |
| 2976 | -S "server hello, adding encrypt then mac extension" \ |
| 2977 | -C "found encrypt_then_mac extension" \ |
| 2978 | -C "using encrypt then mac" \ |
| 2979 | -S "using encrypt then mac" |
| 2980 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2981 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2982 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2983 | "$P_SRV debug_level=3 etm=1 \ |
| 2984 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2985 | "$P_CLI debug_level=3 etm=0" \ |
| 2986 | 0 \ |
| 2987 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2988 | -S "found encrypt then mac extension" \ |
| 2989 | -S "server hello, adding encrypt then mac extension" \ |
| 2990 | -C "found encrypt_then_mac extension" \ |
| 2991 | -C "using encrypt then mac" \ |
| 2992 | -S "using encrypt then mac" |
| 2993 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2994 | # Tests for Extended Master Secret extension |
| 2995 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2996 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 2997 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2998 | run_test "Extended Master Secret: default" \ |
| 2999 | "$P_SRV debug_level=3" \ |
| 3000 | "$P_CLI debug_level=3" \ |
| 3001 | 0 \ |
| 3002 | -c "client hello, adding extended_master_secret extension" \ |
| 3003 | -s "found extended master secret extension" \ |
| 3004 | -s "server hello, adding extended master secret extension" \ |
| 3005 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3006 | -c "session hash for extended master secret" \ |
| 3007 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3008 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3009 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3010 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3011 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 3012 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 3013 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 3014 | 0 \ |
| 3015 | -c "client hello, adding extended_master_secret extension" \ |
| 3016 | -s "found extended master secret extension" \ |
| 3017 | -S "server hello, adding extended master secret extension" \ |
| 3018 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3019 | -C "session hash for extended master secret" \ |
| 3020 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3021 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3022 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3023 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3024 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 3025 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 3026 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 3027 | 0 \ |
| 3028 | -C "client hello, adding extended_master_secret extension" \ |
| 3029 | -S "found extended master secret extension" \ |
| 3030 | -S "server hello, adding extended master secret extension" \ |
| 3031 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3032 | -C "session hash for extended master secret" \ |
| 3033 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3034 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3035 | # Test sending and receiving empty application data records |
| 3036 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3037 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3038 | run_test "Encrypt then MAC: empty application data record" \ |
| 3039 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 3040 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 3041 | 0 \ |
| 3042 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3043 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3044 | -c "0 bytes written in 1 fragments" |
| 3045 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3046 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3047 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3048 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 3049 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 3050 | 0 \ |
| 3051 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3052 | -c "0 bytes written in 1 fragments" |
| 3053 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3054 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3055 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 3056 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 3057 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 3058 | 0 \ |
| 3059 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3060 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3061 | -c "0 bytes written in 1 fragments" |
| 3062 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3063 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3064 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3065 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 3066 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 3067 | 0 \ |
| 3068 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3069 | -c "0 bytes written in 1 fragments" |
| 3070 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3071 | # Tests for CBC 1/n-1 record splitting |
| 3072 | |
| 3073 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3074 | "$P_SRV force_version=tls12" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3075 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3076 | request_size=123" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3077 | 0 \ |
| 3078 | -s "Read from client: 123 bytes read" \ |
| 3079 | -S "Read from client: 1 bytes read" \ |
| 3080 | -S "122 bytes read" |
| 3081 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3082 | # Tests for Session Tickets |
| 3083 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3084 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3085 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3086 | "$P_SRV debug_level=3 tickets=1" \ |
| 3087 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3088 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3089 | -c "client hello, adding session ticket extension" \ |
| 3090 | -s "found session ticket extension" \ |
| 3091 | -s "server hello, adding session ticket extension" \ |
| 3092 | -c "found session_ticket extension" \ |
| 3093 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3094 | -S "session successfully restored from cache" \ |
| 3095 | -s "session successfully restored from ticket" \ |
| 3096 | -s "a session has been resumed" \ |
| 3097 | -c "a session has been resumed" |
| 3098 | |
Jerry Yu | baa4934 | 2022-02-15 10:26:40 +0800 | [diff] [blame] | 3099 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 3100 | run_test "Session resume using tickets: manual rotation" \ |
| 3101 | "$P_SRV debug_level=3 tickets=1 ticket_rotate=1" \ |
| 3102 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3103 | 0 \ |
| 3104 | -c "client hello, adding session ticket extension" \ |
| 3105 | -s "found session ticket extension" \ |
| 3106 | -s "server hello, adding session ticket extension" \ |
| 3107 | -c "found session_ticket extension" \ |
| 3108 | -c "parse new session ticket" \ |
| 3109 | -S "session successfully restored from cache" \ |
| 3110 | -s "session successfully restored from ticket" \ |
| 3111 | -s "a session has been resumed" \ |
| 3112 | -c "a session has been resumed" |
| 3113 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3114 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3115 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3116 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 3117 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 3118 | 0 \ |
| 3119 | -c "client hello, adding session ticket extension" \ |
| 3120 | -s "found session ticket extension" \ |
| 3121 | -s "server hello, adding session ticket extension" \ |
| 3122 | -c "found session_ticket extension" \ |
| 3123 | -c "parse new session ticket" \ |
| 3124 | -S "session successfully restored from cache" \ |
| 3125 | -s "session successfully restored from ticket" \ |
| 3126 | -s "a session has been resumed" \ |
| 3127 | -c "a session has been resumed" |
| 3128 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3129 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3130 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3131 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 3132 | "$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] | 3133 | 0 \ |
| 3134 | -c "client hello, adding session ticket extension" \ |
| 3135 | -s "found session ticket extension" \ |
| 3136 | -s "server hello, adding session ticket extension" \ |
| 3137 | -c "found session_ticket extension" \ |
| 3138 | -c "parse new session ticket" \ |
| 3139 | -S "session successfully restored from cache" \ |
| 3140 | -S "session successfully restored from ticket" \ |
| 3141 | -S "a session has been resumed" \ |
| 3142 | -C "a session has been resumed" |
| 3143 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3144 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3145 | run_test "Session resume using tickets: session copy" \ |
| 3146 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 3147 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 3148 | 0 \ |
| 3149 | -c "client hello, adding session ticket extension" \ |
| 3150 | -s "found session ticket extension" \ |
| 3151 | -s "server hello, adding session ticket extension" \ |
| 3152 | -c "found session_ticket extension" \ |
| 3153 | -c "parse new session ticket" \ |
| 3154 | -S "session successfully restored from cache" \ |
| 3155 | -s "session successfully restored from ticket" \ |
| 3156 | -s "a session has been resumed" \ |
| 3157 | -c "a session has been resumed" |
| 3158 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3159 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3160 | run_test "Session resume using tickets: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 3161 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3162 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3163 | 0 \ |
| 3164 | -c "client hello, adding session ticket extension" \ |
| 3165 | -c "found session_ticket extension" \ |
| 3166 | -c "parse new session ticket" \ |
| 3167 | -c "a session has been resumed" |
| 3168 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3169 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3170 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3171 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3172 | "( $O_CLI -sess_out $SESSION; \ |
| 3173 | $O_CLI -sess_in $SESSION; \ |
| 3174 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3175 | 0 \ |
| 3176 | -s "found session ticket extension" \ |
| 3177 | -s "server hello, adding session ticket extension" \ |
| 3178 | -S "session successfully restored from cache" \ |
| 3179 | -s "session successfully restored from ticket" \ |
| 3180 | -s "a session has been resumed" |
| 3181 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3182 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3183 | run_test "Session resume using tickets: AES-128-GCM" \ |
| 3184 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-GCM" \ |
| 3185 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3186 | 0 \ |
| 3187 | -c "client hello, adding session ticket extension" \ |
| 3188 | -s "found session ticket extension" \ |
| 3189 | -s "server hello, adding session ticket extension" \ |
| 3190 | -c "found session_ticket extension" \ |
| 3191 | -c "parse new session ticket" \ |
| 3192 | -S "session successfully restored from cache" \ |
| 3193 | -s "session successfully restored from ticket" \ |
| 3194 | -s "a session has been resumed" \ |
| 3195 | -c "a session has been resumed" |
| 3196 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3197 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3198 | run_test "Session resume using tickets: AES-192-GCM" \ |
| 3199 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-GCM" \ |
| 3200 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3201 | 0 \ |
| 3202 | -c "client hello, adding session ticket extension" \ |
| 3203 | -s "found session ticket extension" \ |
| 3204 | -s "server hello, adding session ticket extension" \ |
| 3205 | -c "found session_ticket extension" \ |
| 3206 | -c "parse new session ticket" \ |
| 3207 | -S "session successfully restored from cache" \ |
| 3208 | -s "session successfully restored from ticket" \ |
| 3209 | -s "a session has been resumed" \ |
| 3210 | -c "a session has been resumed" |
| 3211 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3212 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3213 | run_test "Session resume using tickets: AES-128-CCM" \ |
| 3214 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-CCM" \ |
| 3215 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3216 | 0 \ |
| 3217 | -c "client hello, adding session ticket extension" \ |
| 3218 | -s "found session ticket extension" \ |
| 3219 | -s "server hello, adding session ticket extension" \ |
| 3220 | -c "found session_ticket extension" \ |
| 3221 | -c "parse new session ticket" \ |
| 3222 | -S "session successfully restored from cache" \ |
| 3223 | -s "session successfully restored from ticket" \ |
| 3224 | -s "a session has been resumed" \ |
| 3225 | -c "a session has been resumed" |
| 3226 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3227 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3228 | run_test "Session resume using tickets: AES-192-CCM" \ |
| 3229 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-CCM" \ |
| 3230 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3231 | 0 \ |
| 3232 | -c "client hello, adding session ticket extension" \ |
| 3233 | -s "found session ticket extension" \ |
| 3234 | -s "server hello, adding session ticket extension" \ |
| 3235 | -c "found session_ticket extension" \ |
| 3236 | -c "parse new session ticket" \ |
| 3237 | -S "session successfully restored from cache" \ |
| 3238 | -s "session successfully restored from ticket" \ |
| 3239 | -s "a session has been resumed" \ |
| 3240 | -c "a session has been resumed" |
| 3241 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3242 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3243 | run_test "Session resume using tickets: AES-256-CCM" \ |
| 3244 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-256-CCM" \ |
| 3245 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3246 | 0 \ |
| 3247 | -c "client hello, adding session ticket extension" \ |
| 3248 | -s "found session ticket extension" \ |
| 3249 | -s "server hello, adding session ticket extension" \ |
| 3250 | -c "found session_ticket extension" \ |
| 3251 | -c "parse new session ticket" \ |
| 3252 | -S "session successfully restored from cache" \ |
| 3253 | -s "session successfully restored from ticket" \ |
| 3254 | -s "a session has been resumed" \ |
| 3255 | -c "a session has been resumed" |
| 3256 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3257 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3258 | run_test "Session resume using tickets: CAMELLIA-128-CCM" \ |
| 3259 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-128-CCM" \ |
| 3260 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3261 | 0 \ |
| 3262 | -c "client hello, adding session ticket extension" \ |
| 3263 | -s "found session ticket extension" \ |
| 3264 | -s "server hello, adding session ticket extension" \ |
| 3265 | -c "found session_ticket extension" \ |
| 3266 | -c "parse new session ticket" \ |
| 3267 | -S "session successfully restored from cache" \ |
| 3268 | -s "session successfully restored from ticket" \ |
| 3269 | -s "a session has been resumed" \ |
| 3270 | -c "a session has been resumed" |
| 3271 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3272 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3273 | run_test "Session resume using tickets: CAMELLIA-192-CCM" \ |
| 3274 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-192-CCM" \ |
| 3275 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3276 | 0 \ |
| 3277 | -c "client hello, adding session ticket extension" \ |
| 3278 | -s "found session ticket extension" \ |
| 3279 | -s "server hello, adding session ticket extension" \ |
| 3280 | -c "found session_ticket extension" \ |
| 3281 | -c "parse new session ticket" \ |
| 3282 | -S "session successfully restored from cache" \ |
| 3283 | -s "session successfully restored from ticket" \ |
| 3284 | -s "a session has been resumed" \ |
| 3285 | -c "a session has been resumed" |
| 3286 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3287 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3288 | run_test "Session resume using tickets: CAMELLIA-256-CCM" \ |
| 3289 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-256-CCM" \ |
| 3290 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3291 | 0 \ |
| 3292 | -c "client hello, adding session ticket extension" \ |
| 3293 | -s "found session ticket extension" \ |
| 3294 | -s "server hello, adding session ticket extension" \ |
| 3295 | -c "found session_ticket extension" \ |
| 3296 | -c "parse new session ticket" \ |
| 3297 | -S "session successfully restored from cache" \ |
| 3298 | -s "session successfully restored from ticket" \ |
| 3299 | -s "a session has been resumed" \ |
| 3300 | -c "a session has been resumed" |
| 3301 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3302 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3303 | run_test "Session resume using tickets: ARIA-128-GCM" \ |
| 3304 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-GCM" \ |
| 3305 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3306 | 0 \ |
| 3307 | -c "client hello, adding session ticket extension" \ |
| 3308 | -s "found session ticket extension" \ |
| 3309 | -s "server hello, adding session ticket extension" \ |
| 3310 | -c "found session_ticket extension" \ |
| 3311 | -c "parse new session ticket" \ |
| 3312 | -S "session successfully restored from cache" \ |
| 3313 | -s "session successfully restored from ticket" \ |
| 3314 | -s "a session has been resumed" \ |
| 3315 | -c "a session has been resumed" |
| 3316 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3317 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3318 | run_test "Session resume using tickets: ARIA-192-GCM" \ |
| 3319 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-GCM" \ |
| 3320 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3321 | 0 \ |
| 3322 | -c "client hello, adding session ticket extension" \ |
| 3323 | -s "found session ticket extension" \ |
| 3324 | -s "server hello, adding session ticket extension" \ |
| 3325 | -c "found session_ticket extension" \ |
| 3326 | -c "parse new session ticket" \ |
| 3327 | -S "session successfully restored from cache" \ |
| 3328 | -s "session successfully restored from ticket" \ |
| 3329 | -s "a session has been resumed" \ |
| 3330 | -c "a session has been resumed" |
| 3331 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3332 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3333 | run_test "Session resume using tickets: ARIA-256-GCM" \ |
| 3334 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-GCM" \ |
| 3335 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3336 | 0 \ |
| 3337 | -c "client hello, adding session ticket extension" \ |
| 3338 | -s "found session ticket extension" \ |
| 3339 | -s "server hello, adding session ticket extension" \ |
| 3340 | -c "found session_ticket extension" \ |
| 3341 | -c "parse new session ticket" \ |
| 3342 | -S "session successfully restored from cache" \ |
| 3343 | -s "session successfully restored from ticket" \ |
| 3344 | -s "a session has been resumed" \ |
| 3345 | -c "a session has been resumed" |
| 3346 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3347 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3348 | run_test "Session resume using tickets: ARIA-128-CCM" \ |
| 3349 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-CCM" \ |
| 3350 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3351 | 0 \ |
| 3352 | -c "client hello, adding session ticket extension" \ |
| 3353 | -s "found session ticket extension" \ |
| 3354 | -s "server hello, adding session ticket extension" \ |
| 3355 | -c "found session_ticket extension" \ |
| 3356 | -c "parse new session ticket" \ |
| 3357 | -S "session successfully restored from cache" \ |
| 3358 | -s "session successfully restored from ticket" \ |
| 3359 | -s "a session has been resumed" \ |
| 3360 | -c "a session has been resumed" |
| 3361 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3362 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3363 | run_test "Session resume using tickets: ARIA-192-CCM" \ |
| 3364 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-CCM" \ |
| 3365 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3366 | 0 \ |
| 3367 | -c "client hello, adding session ticket extension" \ |
| 3368 | -s "found session ticket extension" \ |
| 3369 | -s "server hello, adding session ticket extension" \ |
| 3370 | -c "found session_ticket extension" \ |
| 3371 | -c "parse new session ticket" \ |
| 3372 | -S "session successfully restored from cache" \ |
| 3373 | -s "session successfully restored from ticket" \ |
| 3374 | -s "a session has been resumed" \ |
| 3375 | -c "a session has been resumed" |
| 3376 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3377 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3378 | run_test "Session resume using tickets: ARIA-256-CCM" \ |
| 3379 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-CCM" \ |
| 3380 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3381 | 0 \ |
| 3382 | -c "client hello, adding session ticket extension" \ |
| 3383 | -s "found session ticket extension" \ |
| 3384 | -s "server hello, adding session ticket extension" \ |
| 3385 | -c "found session_ticket extension" \ |
| 3386 | -c "parse new session ticket" \ |
| 3387 | -S "session successfully restored from cache" \ |
| 3388 | -s "session successfully restored from ticket" \ |
| 3389 | -s "a session has been resumed" \ |
| 3390 | -c "a session has been resumed" |
| 3391 | |
Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 3392 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 3393 | run_test "Session resume using tickets: CHACHA20-POLY1305" \ |
| 3394 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CHACHA20-POLY1305" \ |
| 3395 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3396 | 0 \ |
| 3397 | -c "client hello, adding session ticket extension" \ |
| 3398 | -s "found session ticket extension" \ |
| 3399 | -s "server hello, adding session ticket extension" \ |
| 3400 | -c "found session_ticket extension" \ |
| 3401 | -c "parse new session ticket" \ |
| 3402 | -S "session successfully restored from cache" \ |
| 3403 | -s "session successfully restored from ticket" \ |
| 3404 | -s "a session has been resumed" \ |
| 3405 | -c "a session has been resumed" |
| 3406 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3407 | # Tests for Session Tickets with DTLS |
| 3408 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3409 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3410 | run_test "Session resume using tickets, DTLS: basic" \ |
| 3411 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3412 | "$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] | 3413 | 0 \ |
| 3414 | -c "client hello, adding session ticket extension" \ |
| 3415 | -s "found session ticket extension" \ |
| 3416 | -s "server hello, adding session ticket extension" \ |
| 3417 | -c "found session_ticket extension" \ |
| 3418 | -c "parse new session ticket" \ |
| 3419 | -S "session successfully restored from cache" \ |
| 3420 | -s "session successfully restored from ticket" \ |
| 3421 | -s "a session has been resumed" \ |
| 3422 | -c "a session has been resumed" |
| 3423 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3424 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3425 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 3426 | "$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] | 3427 | "$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] | 3428 | 0 \ |
| 3429 | -c "client hello, adding session ticket extension" \ |
| 3430 | -s "found session ticket extension" \ |
| 3431 | -s "server hello, adding session ticket extension" \ |
| 3432 | -c "found session_ticket extension" \ |
| 3433 | -c "parse new session ticket" \ |
| 3434 | -S "session successfully restored from cache" \ |
| 3435 | -s "session successfully restored from ticket" \ |
| 3436 | -s "a session has been resumed" \ |
| 3437 | -c "a session has been resumed" |
| 3438 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3439 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3440 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 3441 | "$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] | 3442 | "$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] | 3443 | 0 \ |
| 3444 | -c "client hello, adding session ticket extension" \ |
| 3445 | -s "found session ticket extension" \ |
| 3446 | -s "server hello, adding session ticket extension" \ |
| 3447 | -c "found session_ticket extension" \ |
| 3448 | -c "parse new session ticket" \ |
| 3449 | -S "session successfully restored from cache" \ |
| 3450 | -S "session successfully restored from ticket" \ |
| 3451 | -S "a session has been resumed" \ |
| 3452 | -C "a session has been resumed" |
| 3453 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3454 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3455 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 3456 | "$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] | 3457 | "$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] | 3458 | 0 \ |
| 3459 | -c "client hello, adding session ticket extension" \ |
| 3460 | -s "found session ticket extension" \ |
| 3461 | -s "server hello, adding session ticket extension" \ |
| 3462 | -c "found session_ticket extension" \ |
| 3463 | -c "parse new session ticket" \ |
| 3464 | -S "session successfully restored from cache" \ |
| 3465 | -s "session successfully restored from ticket" \ |
| 3466 | -s "a session has been resumed" \ |
| 3467 | -c "a session has been resumed" |
| 3468 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3469 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3470 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 3471 | "$O_SRV -dtls" \ |
| 3472 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 3473 | 0 \ |
| 3474 | -c "client hello, adding session ticket extension" \ |
| 3475 | -c "found session_ticket extension" \ |
| 3476 | -c "parse new session ticket" \ |
| 3477 | -c "a session has been resumed" |
| 3478 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3479 | # 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] | 3480 | # 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] | 3481 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3482 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3483 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 3484 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3485 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 3486 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3487 | rm -f $SESSION )" \ |
| 3488 | 0 \ |
| 3489 | -s "found session ticket extension" \ |
| 3490 | -s "server hello, adding session ticket extension" \ |
| 3491 | -S "session successfully restored from cache" \ |
| 3492 | -s "session successfully restored from ticket" \ |
| 3493 | -s "a session has been resumed" |
| 3494 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3495 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3496 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3497 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3498 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3499 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3500 | "$P_SRV debug_level=3 tickets=0" \ |
| 3501 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3502 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3503 | -c "client hello, adding session ticket extension" \ |
| 3504 | -s "found session ticket extension" \ |
| 3505 | -S "server hello, adding session ticket extension" \ |
| 3506 | -C "found session_ticket extension" \ |
| 3507 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3508 | -s "session successfully restored from cache" \ |
| 3509 | -S "session successfully restored from ticket" \ |
| 3510 | -s "a session has been resumed" \ |
| 3511 | -c "a session has been resumed" |
| 3512 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3513 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3514 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3515 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3516 | "$P_SRV debug_level=3 tickets=1" \ |
| 3517 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3518 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3519 | -C "client hello, adding session ticket extension" \ |
| 3520 | -S "found session ticket extension" \ |
| 3521 | -S "server hello, adding session ticket extension" \ |
| 3522 | -C "found session_ticket extension" \ |
| 3523 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3524 | -s "session successfully restored from cache" \ |
| 3525 | -S "session successfully restored from ticket" \ |
| 3526 | -s "a session has been resumed" \ |
| 3527 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3528 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3529 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3530 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3531 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3532 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 3533 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3534 | 0 \ |
| 3535 | -S "session successfully restored from cache" \ |
| 3536 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3537 | -S "a session has been resumed" \ |
| 3538 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3539 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3540 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3541 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3542 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3543 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 3544 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3545 | 0 \ |
| 3546 | -s "session successfully restored from cache" \ |
| 3547 | -S "session successfully restored from ticket" \ |
| 3548 | -s "a session has been resumed" \ |
| 3549 | -c "a session has been resumed" |
| 3550 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3551 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3552 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 3553 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3554 | "$P_SRV debug_level=3 tickets=0" \ |
| 3555 | "$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] | 3556 | 0 \ |
| 3557 | -s "session successfully restored from cache" \ |
| 3558 | -S "session successfully restored from ticket" \ |
| 3559 | -s "a session has been resumed" \ |
| 3560 | -c "a session has been resumed" |
| 3561 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3562 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3563 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3564 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3565 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 3566 | "$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] | 3567 | 0 \ |
| 3568 | -S "session successfully restored from cache" \ |
| 3569 | -S "session successfully restored from ticket" \ |
| 3570 | -S "a session has been resumed" \ |
| 3571 | -C "a session has been resumed" |
| 3572 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3573 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3574 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3575 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3576 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 3577 | "$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] | 3578 | 0 \ |
| 3579 | -s "session successfully restored from cache" \ |
| 3580 | -S "session successfully restored from ticket" \ |
| 3581 | -s "a session has been resumed" \ |
| 3582 | -c "a session has been resumed" |
| 3583 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3584 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3585 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3586 | run_test "Session resume using cache: session copy" \ |
| 3587 | "$P_SRV debug_level=3 tickets=0" \ |
| 3588 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 3589 | 0 \ |
| 3590 | -s "session successfully restored from cache" \ |
| 3591 | -S "session successfully restored from ticket" \ |
| 3592 | -s "a session has been resumed" \ |
| 3593 | -c "a session has been resumed" |
| 3594 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3595 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3596 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3597 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3598 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3599 | "( $O_CLI -sess_out $SESSION; \ |
| 3600 | $O_CLI -sess_in $SESSION; \ |
| 3601 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 3602 | 0 \ |
| 3603 | -s "found session ticket extension" \ |
| 3604 | -S "server hello, adding session ticket extension" \ |
| 3605 | -s "session successfully restored from cache" \ |
| 3606 | -S "session successfully restored from ticket" \ |
| 3607 | -s "a session has been resumed" |
| 3608 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3609 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3610 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3611 | run_test "Session resume using cache: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 3612 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3613 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 3614 | 0 \ |
| 3615 | -C "found session_ticket extension" \ |
| 3616 | -C "parse new session ticket" \ |
| 3617 | -c "a session has been resumed" |
| 3618 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3619 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 3620 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3621 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3622 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3623 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 3624 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3625 | "$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] | 3626 | 0 \ |
| 3627 | -c "client hello, adding session ticket extension" \ |
| 3628 | -s "found session ticket extension" \ |
| 3629 | -S "server hello, adding session ticket extension" \ |
| 3630 | -C "found session_ticket extension" \ |
| 3631 | -C "parse new session ticket" \ |
| 3632 | -s "session successfully restored from cache" \ |
| 3633 | -S "session successfully restored from ticket" \ |
| 3634 | -s "a session has been resumed" \ |
| 3635 | -c "a session has been resumed" |
| 3636 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3637 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3638 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3639 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 3640 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3641 | "$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] | 3642 | 0 \ |
| 3643 | -C "client hello, adding session ticket extension" \ |
| 3644 | -S "found session ticket extension" \ |
| 3645 | -S "server hello, adding session ticket extension" \ |
| 3646 | -C "found session_ticket extension" \ |
| 3647 | -C "parse new session ticket" \ |
| 3648 | -s "session successfully restored from cache" \ |
| 3649 | -S "session successfully restored from ticket" \ |
| 3650 | -s "a session has been resumed" \ |
| 3651 | -c "a session has been resumed" |
| 3652 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3653 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3654 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3655 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 3656 | "$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] | 3657 | "$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] | 3658 | 0 \ |
| 3659 | -S "session successfully restored from cache" \ |
| 3660 | -S "session successfully restored from ticket" \ |
| 3661 | -S "a session has been resumed" \ |
| 3662 | -C "a session has been resumed" |
| 3663 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3664 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3665 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3666 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 3667 | "$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] | 3668 | "$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] | 3669 | 0 \ |
| 3670 | -s "session successfully restored from cache" \ |
| 3671 | -S "session successfully restored from ticket" \ |
| 3672 | -s "a session has been resumed" \ |
| 3673 | -c "a session has been resumed" |
| 3674 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3675 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3676 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3677 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 3678 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3679 | "$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] | 3680 | 0 \ |
| 3681 | -s "session successfully restored from cache" \ |
| 3682 | -S "session successfully restored from ticket" \ |
| 3683 | -s "a session has been resumed" \ |
| 3684 | -c "a session has been resumed" |
| 3685 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3686 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3687 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3688 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 3689 | "$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] | 3690 | "$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] | 3691 | 0 \ |
| 3692 | -S "session successfully restored from cache" \ |
| 3693 | -S "session successfully restored from ticket" \ |
| 3694 | -S "a session has been resumed" \ |
| 3695 | -C "a session has been resumed" |
| 3696 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3697 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3698 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3699 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 3700 | "$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] | 3701 | "$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] | 3702 | 0 \ |
| 3703 | -s "session successfully restored from cache" \ |
| 3704 | -S "session successfully restored from ticket" \ |
| 3705 | -s "a session has been resumed" \ |
| 3706 | -c "a session has been resumed" |
| 3707 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3708 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3709 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3710 | run_test "Session resume using cache, DTLS: session copy" \ |
| 3711 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3712 | "$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] | 3713 | 0 \ |
| 3714 | -s "session successfully restored from cache" \ |
| 3715 | -S "session successfully restored from ticket" \ |
| 3716 | -s "a session has been resumed" \ |
| 3717 | -c "a session has been resumed" |
| 3718 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3719 | # 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] | 3720 | # 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] | 3721 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3722 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3723 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3724 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 3725 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3726 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 3727 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3728 | rm -f $SESSION )" \ |
| 3729 | 0 \ |
| 3730 | -s "found session ticket extension" \ |
| 3731 | -S "server hello, adding session ticket extension" \ |
| 3732 | -s "session successfully restored from cache" \ |
| 3733 | -S "session successfully restored from ticket" \ |
| 3734 | -s "a session has been resumed" |
| 3735 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3736 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3737 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3738 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 3739 | "$O_SRV -dtls" \ |
| 3740 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 3741 | 0 \ |
| 3742 | -C "found session_ticket extension" \ |
| 3743 | -C "parse new session ticket" \ |
| 3744 | -c "a session has been resumed" |
| 3745 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3746 | # Tests for Max Fragment Length extension |
| 3747 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3748 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3749 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3750 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3751 | "$P_SRV debug_level=3" \ |
| 3752 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3753 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3754 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3755 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3756 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3757 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3758 | -C "client hello, adding max_fragment_length extension" \ |
| 3759 | -S "found max fragment length extension" \ |
| 3760 | -S "server hello, max_fragment_length extension" \ |
| 3761 | -C "found max_fragment_length extension" |
| 3762 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3763 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3764 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3765 | run_test "Max fragment length: enabled, default, larger message" \ |
| 3766 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3767 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3768 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3769 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3770 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3771 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3772 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3773 | -C "client hello, adding max_fragment_length extension" \ |
| 3774 | -S "found max fragment length extension" \ |
| 3775 | -S "server hello, max_fragment_length extension" \ |
| 3776 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3777 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3778 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3779 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3780 | |
| 3781 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3782 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3783 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 3784 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3785 | "$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] | 3786 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3787 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3788 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3789 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3790 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3791 | -C "client hello, adding max_fragment_length extension" \ |
| 3792 | -S "found max fragment length extension" \ |
| 3793 | -S "server hello, max_fragment_length extension" \ |
| 3794 | -C "found max_fragment_length extension" \ |
| 3795 | -c "fragment larger than.*maximum " |
| 3796 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3797 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 3798 | # (session fragment length will be 16384 regardless of mbedtls |
| 3799 | # content length configuration.) |
| 3800 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3801 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3802 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3803 | run_test "Max fragment length: disabled, larger message" \ |
| 3804 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3805 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3806 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3807 | -C "Maximum incoming record payload length is 16384" \ |
| 3808 | -C "Maximum outgoing record payload length is 16384" \ |
| 3809 | -S "Maximum incoming record payload length is 16384" \ |
| 3810 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3811 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3812 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3813 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3814 | |
| 3815 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3816 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 3817 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3818 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3819 | "$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] | 3820 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3821 | -C "Maximum incoming record payload length is 16384" \ |
| 3822 | -C "Maximum outgoing record payload length is 16384" \ |
| 3823 | -S "Maximum incoming record payload length is 16384" \ |
| 3824 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3825 | -c "fragment larger than.*maximum " |
| 3826 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3827 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3828 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
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 | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3830 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3831 | "$P_SRV debug_level=3" \ |
| 3832 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3833 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3834 | -c "Maximum incoming record payload length is 4096" \ |
| 3835 | -c "Maximum outgoing record payload length is 4096" \ |
| 3836 | -s "Maximum incoming record payload length is 4096" \ |
| 3837 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3838 | -c "client hello, adding max_fragment_length extension" \ |
| 3839 | -s "found max fragment length extension" \ |
| 3840 | -s "server hello, max_fragment_length extension" \ |
| 3841 | -c "found max_fragment_length extension" |
| 3842 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3843 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3844 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3845 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3846 | run_test "Max fragment length: client 512, server 1024" \ |
| 3847 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3848 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3849 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3850 | -c "Maximum incoming record payload length is 512" \ |
| 3851 | -c "Maximum outgoing record payload length is 512" \ |
| 3852 | -s "Maximum incoming record payload length is 512" \ |
| 3853 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3854 | -c "client hello, adding max_fragment_length extension" \ |
| 3855 | -s "found max fragment length extension" \ |
| 3856 | -s "server hello, max_fragment_length extension" \ |
| 3857 | -c "found max_fragment_length extension" |
| 3858 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3859 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3860 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3861 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3862 | run_test "Max fragment length: client 512, server 2048" \ |
| 3863 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3864 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3865 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3866 | -c "Maximum incoming record payload length is 512" \ |
| 3867 | -c "Maximum outgoing record payload length is 512" \ |
| 3868 | -s "Maximum incoming record payload length is 512" \ |
| 3869 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3870 | -c "client hello, adding max_fragment_length extension" \ |
| 3871 | -s "found max fragment length extension" \ |
| 3872 | -s "server hello, max_fragment_length extension" \ |
| 3873 | -c "found max_fragment_length extension" |
| 3874 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3875 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3876 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3877 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3878 | run_test "Max fragment length: client 512, server 4096" \ |
| 3879 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3880 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3881 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3882 | -c "Maximum incoming record payload length is 512" \ |
| 3883 | -c "Maximum outgoing record payload length is 512" \ |
| 3884 | -s "Maximum incoming record payload length is 512" \ |
| 3885 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3886 | -c "client hello, adding max_fragment_length extension" \ |
| 3887 | -s "found max fragment length extension" \ |
| 3888 | -s "server hello, max_fragment_length extension" \ |
| 3889 | -c "found max_fragment_length extension" |
| 3890 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3891 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3892 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3893 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3894 | run_test "Max fragment length: client 1024, server 512" \ |
| 3895 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3896 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3897 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3898 | -c "Maximum incoming record payload length is 1024" \ |
| 3899 | -c "Maximum outgoing record payload length is 1024" \ |
| 3900 | -s "Maximum incoming record payload length is 1024" \ |
| 3901 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3902 | -c "client hello, adding max_fragment_length extension" \ |
| 3903 | -s "found max fragment length extension" \ |
| 3904 | -s "server hello, max_fragment_length extension" \ |
| 3905 | -c "found max_fragment_length extension" |
| 3906 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3907 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3908 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3909 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3910 | run_test "Max fragment length: client 1024, server 2048" \ |
| 3911 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3912 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3913 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3914 | -c "Maximum incoming record payload length is 1024" \ |
| 3915 | -c "Maximum outgoing record payload length is 1024" \ |
| 3916 | -s "Maximum incoming record payload length is 1024" \ |
| 3917 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3918 | -c "client hello, adding max_fragment_length extension" \ |
| 3919 | -s "found max fragment length extension" \ |
| 3920 | -s "server hello, max_fragment_length extension" \ |
| 3921 | -c "found max_fragment_length extension" |
| 3922 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3923 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3924 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3925 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3926 | run_test "Max fragment length: client 1024, server 4096" \ |
| 3927 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3928 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3929 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3930 | -c "Maximum incoming record payload length is 1024" \ |
| 3931 | -c "Maximum outgoing record payload length is 1024" \ |
| 3932 | -s "Maximum incoming record payload length is 1024" \ |
| 3933 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3934 | -c "client hello, adding max_fragment_length extension" \ |
| 3935 | -s "found max fragment length extension" \ |
| 3936 | -s "server hello, max_fragment_length extension" \ |
| 3937 | -c "found max_fragment_length extension" |
| 3938 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3939 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3940 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3941 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3942 | run_test "Max fragment length: client 2048, server 512" \ |
| 3943 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3944 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3945 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3946 | -c "Maximum incoming record payload length is 2048" \ |
| 3947 | -c "Maximum outgoing record payload length is 2048" \ |
| 3948 | -s "Maximum incoming record payload length is 2048" \ |
| 3949 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3950 | -c "client hello, adding max_fragment_length extension" \ |
| 3951 | -s "found max fragment length extension" \ |
| 3952 | -s "server hello, max_fragment_length extension" \ |
| 3953 | -c "found max_fragment_length extension" |
| 3954 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3955 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3956 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3957 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3958 | run_test "Max fragment length: client 2048, server 1024" \ |
| 3959 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3960 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3961 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3962 | -c "Maximum incoming record payload length is 2048" \ |
| 3963 | -c "Maximum outgoing record payload length is 2048" \ |
| 3964 | -s "Maximum incoming record payload length is 2048" \ |
| 3965 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3966 | -c "client hello, adding max_fragment_length extension" \ |
| 3967 | -s "found max fragment length extension" \ |
| 3968 | -s "server hello, max_fragment_length extension" \ |
| 3969 | -c "found max_fragment_length extension" |
| 3970 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3971 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3972 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3973 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3974 | run_test "Max fragment length: client 2048, server 4096" \ |
| 3975 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3976 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3977 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3978 | -c "Maximum incoming record payload length is 2048" \ |
| 3979 | -c "Maximum outgoing record payload length is 2048" \ |
| 3980 | -s "Maximum incoming record payload length is 2048" \ |
| 3981 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3982 | -c "client hello, adding max_fragment_length extension" \ |
| 3983 | -s "found max fragment length extension" \ |
| 3984 | -s "server hello, max_fragment_length extension" \ |
| 3985 | -c "found max_fragment_length extension" |
| 3986 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3987 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3988 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3989 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3990 | run_test "Max fragment length: client 4096, server 512" \ |
| 3991 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3992 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3993 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3994 | -c "Maximum incoming record payload length is 4096" \ |
| 3995 | -c "Maximum outgoing record payload length is 4096" \ |
| 3996 | -s "Maximum incoming record payload length is 4096" \ |
| 3997 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3998 | -c "client hello, adding max_fragment_length extension" \ |
| 3999 | -s "found max fragment length extension" \ |
| 4000 | -s "server hello, max_fragment_length extension" \ |
| 4001 | -c "found max_fragment_length extension" |
| 4002 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4003 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4004 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4005 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4006 | run_test "Max fragment length: client 4096, server 1024" \ |
| 4007 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 4008 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4009 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4010 | -c "Maximum incoming record payload length is 4096" \ |
| 4011 | -c "Maximum outgoing record payload length is 4096" \ |
| 4012 | -s "Maximum incoming record payload length is 4096" \ |
| 4013 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4014 | -c "client hello, adding max_fragment_length extension" \ |
| 4015 | -s "found max fragment length extension" \ |
| 4016 | -s "server hello, max_fragment_length extension" \ |
| 4017 | -c "found max_fragment_length extension" |
| 4018 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4019 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4020 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4021 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4022 | run_test "Max fragment length: client 4096, server 2048" \ |
| 4023 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 4024 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4025 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4026 | -c "Maximum incoming record payload length is 4096" \ |
| 4027 | -c "Maximum outgoing record payload length is 4096" \ |
| 4028 | -s "Maximum incoming record payload length is 4096" \ |
| 4029 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4030 | -c "client hello, adding max_fragment_length extension" \ |
| 4031 | -s "found max fragment length extension" \ |
| 4032 | -s "server hello, max_fragment_length extension" \ |
| 4033 | -c "found max_fragment_length extension" |
| 4034 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4035 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4036 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4037 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4038 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4039 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 4040 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4041 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4042 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4043 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4044 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4045 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4046 | -C "client hello, adding max_fragment_length extension" \ |
| 4047 | -S "found max fragment length extension" \ |
| 4048 | -S "server hello, max_fragment_length extension" \ |
| 4049 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4050 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4051 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4052 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4053 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4054 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4055 | run_test "Max fragment length: gnutls server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4056 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4057 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4058 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4059 | -c "Maximum incoming record payload length is 4096" \ |
| 4060 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4061 | -c "client hello, adding max_fragment_length extension" \ |
| 4062 | -c "found max_fragment_length extension" |
| 4063 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4064 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4065 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4066 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4067 | run_test "Max fragment length: client, message just fits" \ |
| 4068 | "$P_SRV debug_level=3" \ |
| 4069 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 4070 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4071 | -c "Maximum incoming record payload length is 2048" \ |
| 4072 | -c "Maximum outgoing record payload length is 2048" \ |
| 4073 | -s "Maximum incoming record payload length is 2048" \ |
| 4074 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4075 | -c "client hello, adding max_fragment_length extension" \ |
| 4076 | -s "found max fragment length extension" \ |
| 4077 | -s "server hello, max_fragment_length extension" \ |
| 4078 | -c "found max_fragment_length extension" \ |
| 4079 | -c "2048 bytes written in 1 fragments" \ |
| 4080 | -s "2048 bytes read" |
| 4081 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4082 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4083 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4084 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4085 | run_test "Max fragment length: client, larger message" \ |
| 4086 | "$P_SRV debug_level=3" \ |
| 4087 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 4088 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4089 | -c "Maximum incoming record payload length is 2048" \ |
| 4090 | -c "Maximum outgoing record payload length is 2048" \ |
| 4091 | -s "Maximum incoming record payload length is 2048" \ |
| 4092 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4093 | -c "client hello, adding max_fragment_length extension" \ |
| 4094 | -s "found max fragment length extension" \ |
| 4095 | -s "server hello, max_fragment_length extension" \ |
| 4096 | -c "found max_fragment_length extension" \ |
| 4097 | -c "2345 bytes written in 2 fragments" \ |
| 4098 | -s "2048 bytes read" \ |
| 4099 | -s "297 bytes read" |
| 4100 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4101 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4102 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4103 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 4104 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4105 | "$P_SRV debug_level=3 dtls=1" \ |
| 4106 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 4107 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4108 | -c "Maximum incoming record payload length is 2048" \ |
| 4109 | -c "Maximum outgoing record payload length is 2048" \ |
| 4110 | -s "Maximum incoming record payload length is 2048" \ |
| 4111 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4112 | -c "client hello, adding max_fragment_length extension" \ |
| 4113 | -s "found max fragment length extension" \ |
| 4114 | -s "server hello, max_fragment_length extension" \ |
| 4115 | -c "found max_fragment_length extension" \ |
| 4116 | -c "fragment larger than.*maximum" |
| 4117 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4118 | # Tests for renegotiation |
| 4119 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4120 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4121 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4122 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4123 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4124 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4125 | 0 \ |
| 4126 | -C "client hello, adding renegotiation extension" \ |
| 4127 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4128 | -S "found renegotiation extension" \ |
| 4129 | -s "server hello, secure renegotiation extension" \ |
| 4130 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4131 | -C "=> renegotiate" \ |
| 4132 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4133 | -S "write hello request" |
| 4134 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4135 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4136 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4137 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4138 | "$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] | 4139 | "$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] | 4140 | 0 \ |
| 4141 | -c "client hello, adding renegotiation extension" \ |
| 4142 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4143 | -s "found renegotiation extension" \ |
| 4144 | -s "server hello, secure renegotiation extension" \ |
| 4145 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4146 | -c "=> renegotiate" \ |
| 4147 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4148 | -S "write hello request" |
| 4149 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4150 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4151 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4152 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4153 | "$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] | 4154 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4155 | 0 \ |
| 4156 | -c "client hello, adding renegotiation extension" \ |
| 4157 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4158 | -s "found renegotiation extension" \ |
| 4159 | -s "server hello, secure renegotiation extension" \ |
| 4160 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4161 | -c "=> renegotiate" \ |
| 4162 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4163 | -s "write hello request" |
| 4164 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4165 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 4166 | # 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] | 4167 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4168 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4169 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4170 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 4171 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 4172 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4173 | 0 \ |
| 4174 | -c "client hello, adding renegotiation extension" \ |
| 4175 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4176 | -s "found renegotiation extension" \ |
| 4177 | -s "server hello, secure renegotiation extension" \ |
| 4178 | -c "found renegotiation extension" \ |
| 4179 | -c "=> renegotiate" \ |
| 4180 | -s "=> renegotiate" \ |
| 4181 | -S "write hello request" \ |
| 4182 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 4183 | |
| 4184 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 4185 | # 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] | 4186 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4187 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4188 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4189 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 4190 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 4191 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 4192 | 0 \ |
| 4193 | -c "client hello, adding renegotiation extension" \ |
| 4194 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4195 | -s "found renegotiation extension" \ |
| 4196 | -s "server hello, secure renegotiation extension" \ |
| 4197 | -c "found renegotiation extension" \ |
| 4198 | -c "=> renegotiate" \ |
| 4199 | -s "=> renegotiate" \ |
| 4200 | -s "write hello request" \ |
| 4201 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 4202 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4203 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4204 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4205 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4206 | "$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] | 4207 | "$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] | 4208 | 0 \ |
| 4209 | -c "client hello, adding renegotiation extension" \ |
| 4210 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4211 | -s "found renegotiation extension" \ |
| 4212 | -s "server hello, secure renegotiation extension" \ |
| 4213 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4214 | -c "=> renegotiate" \ |
| 4215 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4216 | -s "write hello request" |
| 4217 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4218 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4219 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4220 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4221 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4222 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 4223 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 4224 | "$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" \ |
| 4225 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4226 | -c "Maximum incoming record payload length is 2048" \ |
| 4227 | -c "Maximum outgoing record payload length is 2048" \ |
| 4228 | -s "Maximum incoming record payload length is 2048" \ |
| 4229 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4230 | -c "client hello, adding max_fragment_length extension" \ |
| 4231 | -s "found max fragment length extension" \ |
| 4232 | -s "server hello, max_fragment_length extension" \ |
| 4233 | -c "found max_fragment_length extension" \ |
| 4234 | -c "client hello, adding renegotiation extension" \ |
| 4235 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4236 | -s "found renegotiation extension" \ |
| 4237 | -s "server hello, secure renegotiation extension" \ |
| 4238 | -c "found renegotiation extension" \ |
| 4239 | -c "=> renegotiate" \ |
| 4240 | -s "=> renegotiate" \ |
| 4241 | -s "write hello request" |
| 4242 | |
| 4243 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4244 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4245 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4246 | "$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] | 4247 | "$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] | 4248 | 1 \ |
| 4249 | -c "client hello, adding renegotiation extension" \ |
| 4250 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4251 | -S "found renegotiation extension" \ |
| 4252 | -s "server hello, secure renegotiation extension" \ |
| 4253 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4254 | -c "=> renegotiate" \ |
| 4255 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4256 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 4257 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4258 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4259 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4260 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4261 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4262 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4263 | "$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] | 4264 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4265 | 0 \ |
| 4266 | -C "client hello, adding renegotiation extension" \ |
| 4267 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4268 | -S "found renegotiation extension" \ |
| 4269 | -s "server hello, secure renegotiation extension" \ |
| 4270 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4271 | -C "=> renegotiate" \ |
| 4272 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4273 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 4274 | -S "SSL - An unexpected message was received from our peer" \ |
| 4275 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 4276 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4277 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4278 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4279 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4280 | "$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] | 4281 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4282 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4283 | 0 \ |
| 4284 | -C "client hello, adding renegotiation extension" \ |
| 4285 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4286 | -S "found renegotiation extension" \ |
| 4287 | -s "server hello, secure renegotiation extension" \ |
| 4288 | -c "found renegotiation extension" \ |
| 4289 | -C "=> renegotiate" \ |
| 4290 | -S "=> renegotiate" \ |
| 4291 | -s "write hello request" \ |
| 4292 | -S "SSL - An unexpected message was received from our peer" \ |
| 4293 | -S "failed" |
| 4294 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 4295 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4296 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4297 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4298 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4299 | "$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] | 4300 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4301 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4302 | 0 \ |
| 4303 | -C "client hello, adding renegotiation extension" \ |
| 4304 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4305 | -S "found renegotiation extension" \ |
| 4306 | -s "server hello, secure renegotiation extension" \ |
| 4307 | -c "found renegotiation extension" \ |
| 4308 | -C "=> renegotiate" \ |
| 4309 | -S "=> renegotiate" \ |
| 4310 | -s "write hello request" \ |
| 4311 | -S "SSL - An unexpected message was received from our peer" \ |
| 4312 | -S "failed" |
| 4313 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4314 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4315 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4316 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4317 | "$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] | 4318 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4319 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4320 | 0 \ |
| 4321 | -C "client hello, adding renegotiation extension" \ |
| 4322 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4323 | -S "found renegotiation extension" \ |
| 4324 | -s "server hello, secure renegotiation extension" \ |
| 4325 | -c "found renegotiation extension" \ |
| 4326 | -C "=> renegotiate" \ |
| 4327 | -S "=> renegotiate" \ |
| 4328 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 4329 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4330 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4331 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4332 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4333 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4334 | "$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] | 4335 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4336 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4337 | 0 \ |
| 4338 | -c "client hello, adding renegotiation extension" \ |
| 4339 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4340 | -s "found renegotiation extension" \ |
| 4341 | -s "server hello, secure renegotiation extension" \ |
| 4342 | -c "found renegotiation extension" \ |
| 4343 | -c "=> renegotiate" \ |
| 4344 | -s "=> renegotiate" \ |
| 4345 | -s "write hello request" \ |
| 4346 | -S "SSL - An unexpected message was received from our peer" \ |
| 4347 | -S "failed" |
| 4348 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4349 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4350 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4351 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4352 | "$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] | 4353 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 4354 | 0 \ |
| 4355 | -C "client hello, adding renegotiation extension" \ |
| 4356 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4357 | -S "found renegotiation extension" \ |
| 4358 | -s "server hello, secure renegotiation extension" \ |
| 4359 | -c "found renegotiation extension" \ |
| 4360 | -S "record counter limit reached: renegotiate" \ |
| 4361 | -C "=> renegotiate" \ |
| 4362 | -S "=> renegotiate" \ |
| 4363 | -S "write hello request" \ |
| 4364 | -S "SSL - An unexpected message was received from our peer" \ |
| 4365 | -S "failed" |
| 4366 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 4367 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4368 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4369 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4370 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4371 | "$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] | 4372 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4373 | 0 \ |
| 4374 | -c "client hello, adding renegotiation extension" \ |
| 4375 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4376 | -s "found renegotiation extension" \ |
| 4377 | -s "server hello, secure renegotiation extension" \ |
| 4378 | -c "found renegotiation extension" \ |
| 4379 | -s "record counter limit reached: renegotiate" \ |
| 4380 | -c "=> renegotiate" \ |
| 4381 | -s "=> renegotiate" \ |
| 4382 | -s "write hello request" \ |
| 4383 | -S "SSL - An unexpected message was received from our peer" \ |
| 4384 | -S "failed" |
| 4385 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4386 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4387 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4388 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4389 | "$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] | 4390 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4391 | 0 \ |
| 4392 | -c "client hello, adding renegotiation extension" \ |
| 4393 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4394 | -s "found renegotiation extension" \ |
| 4395 | -s "server hello, secure renegotiation extension" \ |
| 4396 | -c "found renegotiation extension" \ |
| 4397 | -s "record counter limit reached: renegotiate" \ |
| 4398 | -c "=> renegotiate" \ |
| 4399 | -s "=> renegotiate" \ |
| 4400 | -s "write hello request" \ |
| 4401 | -S "SSL - An unexpected message was received from our peer" \ |
| 4402 | -S "failed" |
| 4403 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4404 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4405 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4406 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4407 | "$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] | 4408 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 4409 | 0 \ |
| 4410 | -C "client hello, adding renegotiation extension" \ |
| 4411 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4412 | -S "found renegotiation extension" \ |
| 4413 | -s "server hello, secure renegotiation extension" \ |
| 4414 | -c "found renegotiation extension" \ |
| 4415 | -S "record counter limit reached: renegotiate" \ |
| 4416 | -C "=> renegotiate" \ |
| 4417 | -S "=> renegotiate" \ |
| 4418 | -S "write hello request" \ |
| 4419 | -S "SSL - An unexpected message was received from our peer" \ |
| 4420 | -S "failed" |
| 4421 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4422 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4423 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4424 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4425 | "$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] | 4426 | "$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] | 4427 | 0 \ |
| 4428 | -c "client hello, adding renegotiation extension" \ |
| 4429 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4430 | -s "found renegotiation extension" \ |
| 4431 | -s "server hello, secure renegotiation extension" \ |
| 4432 | -c "found renegotiation extension" \ |
| 4433 | -c "=> renegotiate" \ |
| 4434 | -s "=> renegotiate" \ |
| 4435 | -S "write hello request" |
| 4436 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4437 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4438 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4439 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4440 | "$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] | 4441 | "$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] | 4442 | 0 \ |
| 4443 | -c "client hello, adding renegotiation extension" \ |
| 4444 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4445 | -s "found renegotiation extension" \ |
| 4446 | -s "server hello, secure renegotiation extension" \ |
| 4447 | -c "found renegotiation extension" \ |
| 4448 | -c "=> renegotiate" \ |
| 4449 | -s "=> renegotiate" \ |
| 4450 | -s "write hello request" |
| 4451 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4452 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4453 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4454 | run_test "Renegotiation: openssl server, client-initiated" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4455 | "$O_SRV -www -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4456 | "$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] | 4457 | 0 \ |
| 4458 | -c "client hello, adding renegotiation extension" \ |
| 4459 | -c "found renegotiation extension" \ |
| 4460 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4461 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 4462 | -C "error" \ |
| 4463 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4464 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4465 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4466 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4467 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4468 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4469 | "$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] | 4470 | "$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] | 4471 | 0 \ |
| 4472 | -c "client hello, adding renegotiation extension" \ |
| 4473 | -c "found renegotiation extension" \ |
| 4474 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4475 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 4476 | -C "error" \ |
| 4477 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4478 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4479 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4480 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4481 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4482 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4483 | "$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] | 4484 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 4485 | 1 \ |
| 4486 | -c "client hello, adding renegotiation extension" \ |
| 4487 | -C "found renegotiation extension" \ |
| 4488 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4489 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4490 | -c "error" \ |
| 4491 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4492 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4493 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4494 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4495 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4496 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4497 | "$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] | 4498 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 4499 | allow_legacy=0" \ |
| 4500 | 1 \ |
| 4501 | -c "client hello, adding renegotiation extension" \ |
| 4502 | -C "found renegotiation extension" \ |
| 4503 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4504 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4505 | -c "error" \ |
| 4506 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4507 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4508 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4509 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4510 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4511 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4512 | "$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] | 4513 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 4514 | allow_legacy=1" \ |
| 4515 | 0 \ |
| 4516 | -c "client hello, adding renegotiation extension" \ |
| 4517 | -C "found renegotiation extension" \ |
| 4518 | -c "=> renegotiate" \ |
| 4519 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4520 | -C "error" \ |
| 4521 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4522 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4523 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4524 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 4525 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 4526 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 4527 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4528 | 0 \ |
| 4529 | -c "client hello, adding renegotiation extension" \ |
| 4530 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4531 | -s "found renegotiation extension" \ |
| 4532 | -s "server hello, secure renegotiation extension" \ |
| 4533 | -c "found renegotiation extension" \ |
| 4534 | -c "=> renegotiate" \ |
| 4535 | -s "=> renegotiate" \ |
| 4536 | -S "write hello request" |
| 4537 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4538 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4539 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 4540 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 4541 | "$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] | 4542 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 4543 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 4544 | 0 \ |
| 4545 | -c "client hello, adding renegotiation extension" \ |
| 4546 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4547 | -s "found renegotiation extension" \ |
| 4548 | -s "server hello, secure renegotiation extension" \ |
| 4549 | -c "found renegotiation extension" \ |
| 4550 | -c "=> renegotiate" \ |
| 4551 | -s "=> renegotiate" \ |
| 4552 | -s "write hello request" |
| 4553 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4554 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4555 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 4556 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 4557 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 4558 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 4559 | 0 \ |
| 4560 | -c "client hello, adding renegotiation extension" \ |
| 4561 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4562 | -s "found renegotiation extension" \ |
| 4563 | -s "server hello, secure renegotiation extension" \ |
| 4564 | -s "record counter limit reached: renegotiate" \ |
| 4565 | -c "=> renegotiate" \ |
| 4566 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4567 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 4568 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 4569 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4570 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4571 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 4572 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 4573 | "$G_SRV -u --mtu 4096" \ |
| 4574 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 4575 | 0 \ |
| 4576 | -c "client hello, adding renegotiation extension" \ |
| 4577 | -c "found renegotiation extension" \ |
| 4578 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4579 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 4580 | -C "error" \ |
| 4581 | -s "Extra-header:" |
| 4582 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4583 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 4584 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4585 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4586 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4587 | run_test "Renego ext: gnutls server strict, client default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4588 | "$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] | 4589 | "$P_CLI debug_level=3" \ |
| 4590 | 0 \ |
| 4591 | -c "found renegotiation extension" \ |
| 4592 | -C "error" \ |
| 4593 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4594 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4595 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4596 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4597 | run_test "Renego ext: gnutls server unsafe, client default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4598 | "$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] | 4599 | "$P_CLI debug_level=3" \ |
| 4600 | 0 \ |
| 4601 | -C "found renegotiation extension" \ |
| 4602 | -C "error" \ |
| 4603 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4604 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4605 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4606 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4607 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4608 | "$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] | 4609 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 4610 | 1 \ |
| 4611 | -C "found renegotiation extension" \ |
| 4612 | -c "error" \ |
| 4613 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4614 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4615 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4616 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4617 | run_test "Renego ext: gnutls client strict, server default" \ |
| 4618 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4619 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4620 | 0 \ |
| 4621 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4622 | -s "server hello, secure renegotiation extension" |
| 4623 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4624 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4625 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4626 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 4627 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4628 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4629 | 0 \ |
| 4630 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4631 | -S "server hello, secure renegotiation extension" |
| 4632 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4633 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4634 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4635 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 4636 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4637 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4638 | 1 \ |
| 4639 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4640 | -S "server hello, secure renegotiation extension" |
| 4641 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4642 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 4643 | |
| 4644 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4645 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4646 | run_test "DER format: no trailing bytes" \ |
| 4647 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 4648 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4649 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4650 | 0 \ |
| 4651 | -c "Handshake was completed" \ |
| 4652 | |
| 4653 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4654 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4655 | run_test "DER format: with a trailing zero byte" \ |
| 4656 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 4657 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4658 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4659 | 0 \ |
| 4660 | -c "Handshake was completed" \ |
| 4661 | |
| 4662 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4663 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4664 | run_test "DER format: with a trailing random byte" \ |
| 4665 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 4666 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4667 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4668 | 0 \ |
| 4669 | -c "Handshake was completed" \ |
| 4670 | |
| 4671 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4672 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4673 | run_test "DER format: with 2 trailing random bytes" \ |
| 4674 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 4675 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4676 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4677 | 0 \ |
| 4678 | -c "Handshake was completed" \ |
| 4679 | |
| 4680 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4681 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4682 | run_test "DER format: with 4 trailing random bytes" \ |
| 4683 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 4684 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4685 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4686 | 0 \ |
| 4687 | -c "Handshake was completed" \ |
| 4688 | |
| 4689 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4690 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4691 | run_test "DER format: with 8 trailing random bytes" \ |
| 4692 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 4693 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4694 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4695 | 0 \ |
| 4696 | -c "Handshake was completed" \ |
| 4697 | |
| 4698 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4699 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4700 | run_test "DER format: with 9 trailing random bytes" \ |
| 4701 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 4702 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4703 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4704 | 0 \ |
| 4705 | -c "Handshake was completed" \ |
| 4706 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4707 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 4708 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4709 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4710 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4711 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4712 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4713 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4714 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4715 | 1 \ |
| 4716 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4717 | -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] | 4718 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4719 | -c "X509 - Certificate verification failed" |
| 4720 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4721 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4722 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4723 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4724 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4725 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4726 | 0 \ |
| 4727 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4728 | -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] | 4729 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4730 | -C "X509 - Certificate verification failed" |
| 4731 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4732 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 4733 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 4734 | "$P_SRV" \ |
| 4735 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 4736 | 0 \ |
| 4737 | -c "x509_verify_cert() returned" \ |
| 4738 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4739 | -c "! Certificate verification flags"\ |
| 4740 | -C "! mbedtls_ssl_handshake returned" \ |
| 4741 | -C "X509 - Certificate verification failed" \ |
| 4742 | -C "SSL - No CA Chain is set, but required to operate" |
| 4743 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4744 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 4745 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 4746 | "$P_SRV" \ |
| 4747 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 4748 | 1 \ |
| 4749 | -c "x509_verify_cert() returned" \ |
| 4750 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4751 | -c "! Certificate verification flags"\ |
| 4752 | -c "! mbedtls_ssl_handshake returned" \ |
| 4753 | -c "SSL - No CA Chain is set, but required to operate" |
| 4754 | |
| 4755 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4756 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4757 | # the client informs the server about the supported curves - it does, though, in the |
| 4758 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4759 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4760 | # different means to have the server ignoring the client's supported curve list. |
| 4761 | |
| 4762 | requires_config_enabled MBEDTLS_ECP_C |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4763 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 4764 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4765 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4766 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4767 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4768 | 1 \ |
| 4769 | -c "bad certificate (EC key curve)"\ |
| 4770 | -c "! Certificate verification flags"\ |
| 4771 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4772 | |
| 4773 | requires_config_enabled MBEDTLS_ECP_C |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4774 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 4775 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4776 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4777 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4778 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4779 | 1 \ |
| 4780 | -c "bad certificate (EC key curve)"\ |
| 4781 | -c "! Certificate verification flags"\ |
| 4782 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4783 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4784 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4785 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 4786 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4787 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4788 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4789 | 0 \ |
| 4790 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4791 | -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] | 4792 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4793 | -C "X509 - Certificate verification failed" |
| 4794 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4795 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 4796 | run_test "Authentication: client SHA256, server required" \ |
| 4797 | "$P_SRV auth_mode=required" \ |
| 4798 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4799 | key_file=data_files/server6.key \ |
| 4800 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4801 | 0 \ |
| 4802 | -c "Supported Signature Algorithm found: 4," \ |
| 4803 | -c "Supported Signature Algorithm found: 5," |
| 4804 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4805 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 4806 | run_test "Authentication: client SHA384, server required" \ |
| 4807 | "$P_SRV auth_mode=required" \ |
| 4808 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4809 | key_file=data_files/server6.key \ |
| 4810 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4811 | 0 \ |
| 4812 | -c "Supported Signature Algorithm found: 4," \ |
| 4813 | -c "Supported Signature Algorithm found: 5," |
| 4814 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4815 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4816 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 4817 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4818 | "$P_CLI debug_level=3 crt_file=none \ |
| 4819 | key_file=data_files/server5.key" \ |
| 4820 | 1 \ |
| 4821 | -S "skip write certificate request" \ |
| 4822 | -C "skip parse certificate request" \ |
| 4823 | -c "got a certificate request" \ |
| 4824 | -c "= write certificate$" \ |
| 4825 | -C "skip write certificate$" \ |
| 4826 | -S "x509_verify_cert() returned" \ |
| 4827 | -s "client has no certificate" \ |
| 4828 | -s "! mbedtls_ssl_handshake returned" \ |
| 4829 | -c "! mbedtls_ssl_handshake returned" \ |
| 4830 | -s "No client certification received from the client, but required by the authentication mode" |
| 4831 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4832 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4833 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4834 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4835 | "$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] | 4836 | key_file=data_files/server5.key" \ |
| 4837 | 1 \ |
| 4838 | -S "skip write certificate request" \ |
| 4839 | -C "skip parse certificate request" \ |
| 4840 | -c "got a certificate request" \ |
| 4841 | -C "skip write certificate" \ |
| 4842 | -C "skip write certificate verify" \ |
| 4843 | -S "skip parse certificate verify" \ |
| 4844 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4845 | -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] | 4846 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4847 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4848 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4849 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4850 | # We don't check that the client receives the alert because it might |
| 4851 | # detect that its write end of the connection is closed and abort |
| 4852 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4853 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4854 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 4855 | run_test "Authentication: client cert self-signed and trusted, server required" \ |
| 4856 | "$P_SRV debug_level=3 auth_mode=required ca_file=data_files/server5-selfsigned.crt" \ |
| 4857 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4858 | key_file=data_files/server5.key" \ |
| 4859 | 0 \ |
| 4860 | -S "skip write certificate request" \ |
| 4861 | -C "skip parse certificate request" \ |
| 4862 | -c "got a certificate request" \ |
| 4863 | -C "skip write certificate" \ |
| 4864 | -C "skip write certificate verify" \ |
| 4865 | -S "skip parse certificate verify" \ |
| 4866 | -S "x509_verify_cert() returned" \ |
| 4867 | -S "! The certificate is not correctly signed" \ |
| 4868 | -S "X509 - Certificate verification failed" |
| 4869 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4870 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4871 | run_test "Authentication: client cert not trusted, server required" \ |
| 4872 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4873 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4874 | key_file=data_files/server5.key" \ |
| 4875 | 1 \ |
| 4876 | -S "skip write certificate request" \ |
| 4877 | -C "skip parse certificate request" \ |
| 4878 | -c "got a certificate request" \ |
| 4879 | -C "skip write certificate" \ |
| 4880 | -C "skip write certificate verify" \ |
| 4881 | -S "skip parse certificate verify" \ |
| 4882 | -s "x509_verify_cert() returned" \ |
| 4883 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4884 | -s "! mbedtls_ssl_handshake returned" \ |
| 4885 | -c "! mbedtls_ssl_handshake returned" \ |
| 4886 | -s "X509 - Certificate verification failed" |
| 4887 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4888 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4889 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4890 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4891 | "$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] | 4892 | key_file=data_files/server5.key" \ |
| 4893 | 0 \ |
| 4894 | -S "skip write certificate request" \ |
| 4895 | -C "skip parse certificate request" \ |
| 4896 | -c "got a certificate request" \ |
| 4897 | -C "skip write certificate" \ |
| 4898 | -C "skip write certificate verify" \ |
| 4899 | -S "skip parse certificate verify" \ |
| 4900 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4901 | -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] | 4902 | -S "! mbedtls_ssl_handshake returned" \ |
| 4903 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4904 | -S "X509 - Certificate verification failed" |
| 4905 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4906 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4907 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4908 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 4909 | "$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] | 4910 | key_file=data_files/server5.key" \ |
| 4911 | 0 \ |
| 4912 | -s "skip write certificate request" \ |
| 4913 | -C "skip parse certificate request" \ |
| 4914 | -c "got no certificate request" \ |
| 4915 | -c "skip write certificate" \ |
| 4916 | -c "skip write certificate verify" \ |
| 4917 | -s "skip parse certificate verify" \ |
| 4918 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4919 | -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] | 4920 | -S "! mbedtls_ssl_handshake returned" \ |
| 4921 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4922 | -S "X509 - Certificate verification failed" |
| 4923 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4924 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4925 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4926 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4927 | "$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] | 4928 | 0 \ |
| 4929 | -S "skip write certificate request" \ |
| 4930 | -C "skip parse certificate request" \ |
| 4931 | -c "got a certificate request" \ |
| 4932 | -C "skip write certificate$" \ |
| 4933 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4934 | -c "skip write certificate verify" \ |
| 4935 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4936 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4937 | -S "! mbedtls_ssl_handshake returned" \ |
| 4938 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4939 | -S "X509 - Certificate verification failed" |
| 4940 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4941 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4942 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4943 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4944 | "$O_CLI" \ |
| 4945 | 0 \ |
| 4946 | -S "skip write certificate request" \ |
| 4947 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4948 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4949 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4950 | -S "X509 - Certificate verification failed" |
| 4951 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4952 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4953 | run_test "Authentication: client no cert, openssl server optional" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4954 | "$O_SRV -verify 10 -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4955 | "$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] | 4956 | 0 \ |
| 4957 | -C "skip parse certificate request" \ |
| 4958 | -c "got a certificate request" \ |
| 4959 | -C "skip write certificate$" \ |
| 4960 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4961 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4962 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4963 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4964 | run_test "Authentication: client no cert, openssl server required" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4965 | "$O_SRV -Verify 10 -tls1_2" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4966 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 4967 | 1 \ |
| 4968 | -C "skip parse certificate request" \ |
| 4969 | -c "got a certificate request" \ |
| 4970 | -C "skip write certificate$" \ |
| 4971 | -c "skip write certificate verify" \ |
| 4972 | -c "! mbedtls_ssl_handshake returned" |
| 4973 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4974 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 4975 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 4976 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4977 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4978 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4979 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4980 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 4981 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 4982 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 4983 | # 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] | 4984 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4985 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4986 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4987 | run_test "Authentication: server max_int chain, client default" \ |
| 4988 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4989 | key_file=data_files/dir-maxpath/09.key" \ |
| 4990 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4991 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4992 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4993 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4994 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4995 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4996 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4997 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 4998 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4999 | key_file=data_files/dir-maxpath/10.key" \ |
| 5000 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5001 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5002 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5003 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5004 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5005 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5006 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5007 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 5008 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5009 | key_file=data_files/dir-maxpath/10.key" \ |
| 5010 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 5011 | auth_mode=optional" \ |
| 5012 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5013 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5014 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5015 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5016 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5017 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5018 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 5019 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5020 | key_file=data_files/dir-maxpath/10.key" \ |
| 5021 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 5022 | auth_mode=none" \ |
| 5023 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5024 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5025 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5026 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5027 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5028 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5029 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 5030 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 5031 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5032 | key_file=data_files/dir-maxpath/10.key" \ |
| 5033 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5034 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5035 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5036 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5037 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5038 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5039 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 5040 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 5041 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5042 | key_file=data_files/dir-maxpath/10.key" \ |
| 5043 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5044 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5045 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5046 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5047 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5048 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5049 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 5050 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5051 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5052 | key_file=data_files/dir-maxpath/10.key" \ |
| 5053 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5054 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5055 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5056 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5057 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5058 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5059 | run_test "Authentication: client max_int chain, server required" \ |
| 5060 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5061 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 5062 | key_file=data_files/dir-maxpath/09.key" \ |
| 5063 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5064 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5065 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5066 | # Tests for CA list in CertificateRequest messages |
| 5067 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5068 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5069 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 5070 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5071 | "$P_CLI crt_file=data_files/server6.crt \ |
| 5072 | key_file=data_files/server6.key" \ |
| 5073 | 0 \ |
| 5074 | -s "requested DN" |
| 5075 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5076 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5077 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 5078 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 5079 | "$P_CLI crt_file=data_files/server6.crt \ |
| 5080 | key_file=data_files/server6.key" \ |
| 5081 | 0 \ |
| 5082 | -S "requested DN" |
| 5083 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5084 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5085 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 5086 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 5087 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5088 | key_file=data_files/server5.key" \ |
| 5089 | 1 \ |
| 5090 | -S "requested DN" \ |
| 5091 | -s "x509_verify_cert() returned" \ |
| 5092 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5093 | -s "! mbedtls_ssl_handshake returned" \ |
| 5094 | -c "! mbedtls_ssl_handshake returned" \ |
| 5095 | -s "X509 - Certificate verification failed" |
| 5096 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 5097 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 5098 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5099 | |
| 5100 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5101 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5102 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 5103 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5104 | key_file=data_files/server5.key" \ |
| 5105 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5106 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5107 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5108 | -c "x509_verify_cert() returned" \ |
| 5109 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5110 | -c "! mbedtls_ssl_handshake returned" \ |
| 5111 | -c "X509 - Certificate verification failed" |
| 5112 | |
| 5113 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5114 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5115 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 5116 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5117 | key_file=data_files/server5.key" \ |
| 5118 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 5119 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5120 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5121 | -c "x509_verify_cert() returned" \ |
| 5122 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5123 | -C "! mbedtls_ssl_handshake returned" \ |
| 5124 | -C "X509 - Certificate verification failed" |
| 5125 | |
| 5126 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 5127 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 5128 | # the client informs the server about the supported curves - it does, though, in the |
| 5129 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 5130 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 5131 | # different means to have the server ignoring the client's supported curve list. |
| 5132 | |
| 5133 | requires_config_enabled MBEDTLS_ECP_C |
| 5134 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5135 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5136 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 5137 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5138 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5139 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 5140 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5141 | -c "use CA callback for X.509 CRT verification" \ |
| 5142 | -c "bad certificate (EC key curve)" \ |
| 5143 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5144 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 5145 | |
| 5146 | requires_config_enabled MBEDTLS_ECP_C |
| 5147 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5148 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5149 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 5150 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5151 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5152 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 5153 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5154 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5155 | -c "bad certificate (EC key curve)"\ |
| 5156 | -c "! Certificate verification flags"\ |
| 5157 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 5158 | |
| 5159 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5160 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5161 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 5162 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5163 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5164 | key_file=data_files/server6.key \ |
| 5165 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 5166 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5167 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5168 | -c "Supported Signature Algorithm found: 4," \ |
| 5169 | -c "Supported Signature Algorithm found: 5," |
| 5170 | |
| 5171 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5172 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5173 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 5174 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5175 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5176 | key_file=data_files/server6.key \ |
| 5177 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 5178 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5179 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5180 | -c "Supported Signature Algorithm found: 4," \ |
| 5181 | -c "Supported Signature Algorithm found: 5," |
| 5182 | |
| 5183 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5184 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5185 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 5186 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5187 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 5188 | key_file=data_files/server5.key" \ |
| 5189 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5190 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5191 | -S "skip write certificate request" \ |
| 5192 | -C "skip parse certificate request" \ |
| 5193 | -c "got a certificate request" \ |
| 5194 | -C "skip write certificate" \ |
| 5195 | -C "skip write certificate verify" \ |
| 5196 | -S "skip parse certificate verify" \ |
| 5197 | -s "x509_verify_cert() returned" \ |
| 5198 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5199 | -s "! mbedtls_ssl_handshake returned" \ |
| 5200 | -s "send alert level=2 message=48" \ |
| 5201 | -c "! mbedtls_ssl_handshake returned" \ |
| 5202 | -s "X509 - Certificate verification failed" |
| 5203 | # We don't check that the client receives the alert because it might |
| 5204 | # detect that its write end of the connection is closed and abort |
| 5205 | # before reading the alert message. |
| 5206 | |
| 5207 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5208 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5209 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 5210 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5211 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5212 | key_file=data_files/server5.key" \ |
| 5213 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5214 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5215 | -S "skip write certificate request" \ |
| 5216 | -C "skip parse certificate request" \ |
| 5217 | -c "got a certificate request" \ |
| 5218 | -C "skip write certificate" \ |
| 5219 | -C "skip write certificate verify" \ |
| 5220 | -S "skip parse certificate verify" \ |
| 5221 | -s "x509_verify_cert() returned" \ |
| 5222 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5223 | -s "! mbedtls_ssl_handshake returned" \ |
| 5224 | -c "! mbedtls_ssl_handshake returned" \ |
| 5225 | -s "X509 - Certificate verification failed" |
| 5226 | |
| 5227 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5228 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5229 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 5230 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 5231 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 5232 | key_file=data_files/server5.key" \ |
| 5233 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5234 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5235 | -S "skip write certificate request" \ |
| 5236 | -C "skip parse certificate request" \ |
| 5237 | -c "got a certificate request" \ |
| 5238 | -C "skip write certificate" \ |
| 5239 | -C "skip write certificate verify" \ |
| 5240 | -S "skip parse certificate verify" \ |
| 5241 | -s "x509_verify_cert() returned" \ |
| 5242 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5243 | -S "! mbedtls_ssl_handshake returned" \ |
| 5244 | -C "! mbedtls_ssl_handshake returned" \ |
| 5245 | -S "X509 - Certificate verification failed" |
| 5246 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5247 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5248 | requires_full_size_output_buffer |
| 5249 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5250 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5251 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 5252 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 5253 | key_file=data_files/dir-maxpath/09.key" \ |
| 5254 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5255 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5256 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5257 | -C "X509 - A fatal error occurred" |
| 5258 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5259 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5260 | requires_full_size_output_buffer |
| 5261 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5262 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5263 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 5264 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5265 | key_file=data_files/dir-maxpath/10.key" \ |
| 5266 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5267 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5268 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5269 | -c "X509 - A fatal error occurred" |
| 5270 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5271 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5272 | requires_full_size_output_buffer |
| 5273 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5274 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5275 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 5276 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5277 | key_file=data_files/dir-maxpath/10.key" \ |
| 5278 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 5279 | debug_level=3 auth_mode=optional" \ |
| 5280 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5281 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5282 | -c "X509 - A fatal error occurred" |
| 5283 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5284 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5285 | requires_full_size_output_buffer |
| 5286 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5287 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5288 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 5289 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 5290 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5291 | key_file=data_files/dir-maxpath/10.key" \ |
| 5292 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5293 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5294 | -s "X509 - A fatal error occurred" |
| 5295 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5296 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5297 | requires_full_size_output_buffer |
| 5298 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5299 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5300 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 5301 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5302 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5303 | key_file=data_files/dir-maxpath/10.key" \ |
| 5304 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5305 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5306 | -s "X509 - A fatal error occurred" |
| 5307 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5308 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5309 | requires_full_size_output_buffer |
| 5310 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5311 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5312 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 5313 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5314 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 5315 | key_file=data_files/dir-maxpath/09.key" \ |
| 5316 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5317 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5318 | -S "X509 - A fatal error occurred" |
| 5319 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5320 | # Tests for certificate selection based on SHA verson |
| 5321 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5322 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5323 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 5324 | "$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] | 5325 | key_file=data_files/server5.key \ |
| 5326 | crt_file2=data_files/server5-sha1.crt \ |
| 5327 | key_file2=data_files/server5.key" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 5328 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5329 | 0 \ |
| 5330 | -c "signed using.*ECDSA with SHA256" \ |
| 5331 | -C "signed using.*ECDSA with SHA1" |
| 5332 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5333 | # tests for SNI |
| 5334 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5335 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5336 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5337 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5338 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5339 | 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] | 5340 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5341 | 0 \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5342 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 5343 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5344 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5345 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5346 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5347 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5348 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5349 | 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] | 5350 | 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] | 5351 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5352 | 0 \ |
| 5353 | -s "parse ServerName extension" \ |
| 5354 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5355 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5356 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5357 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5358 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5359 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5360 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5361 | 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] | 5362 | 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] | 5363 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5364 | 0 \ |
| 5365 | -s "parse ServerName extension" \ |
| 5366 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5367 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5368 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5369 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5370 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5371 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5372 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5373 | 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] | 5374 | 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] | 5375 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5376 | 1 \ |
| 5377 | -s "parse ServerName extension" \ |
| 5378 | -s "ssl_sni_wrapper() returned" \ |
| 5379 | -s "mbedtls_ssl_handshake returned" \ |
| 5380 | -c "mbedtls_ssl_handshake returned" \ |
| 5381 | -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] | 5382 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5383 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5384 | run_test "SNI: client auth no override: optional" \ |
| 5385 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5386 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5387 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 5388 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5389 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5390 | -S "skip write certificate request" \ |
| 5391 | -C "skip parse certificate request" \ |
| 5392 | -c "got a certificate request" \ |
| 5393 | -C "skip write certificate" \ |
| 5394 | -C "skip write certificate verify" \ |
| 5395 | -S "skip parse certificate verify" |
| 5396 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5397 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5398 | run_test "SNI: client auth override: none -> optional" \ |
| 5399 | "$P_SRV debug_level=3 auth_mode=none \ |
| 5400 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5401 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 5402 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5403 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5404 | -S "skip write certificate request" \ |
| 5405 | -C "skip parse certificate request" \ |
| 5406 | -c "got a certificate request" \ |
| 5407 | -C "skip write certificate" \ |
| 5408 | -C "skip write certificate verify" \ |
| 5409 | -S "skip parse certificate verify" |
| 5410 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5411 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5412 | run_test "SNI: client auth override: optional -> none" \ |
| 5413 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5414 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5415 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 5416 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5417 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5418 | -s "skip write certificate request" \ |
| 5419 | -C "skip parse certificate request" \ |
| 5420 | -c "got no certificate request" \ |
| 5421 | -c "skip write certificate" \ |
| 5422 | -c "skip write certificate verify" \ |
| 5423 | -s "skip parse certificate verify" |
| 5424 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5425 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5426 | run_test "SNI: CA no override" \ |
| 5427 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5428 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5429 | ca_file=data_files/test-ca.crt \ |
| 5430 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 5431 | "$P_CLI debug_level=3 server_name=localhost \ |
| 5432 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5433 | 1 \ |
| 5434 | -S "skip write certificate request" \ |
| 5435 | -C "skip parse certificate request" \ |
| 5436 | -c "got a certificate request" \ |
| 5437 | -C "skip write certificate" \ |
| 5438 | -C "skip write certificate verify" \ |
| 5439 | -S "skip parse certificate verify" \ |
| 5440 | -s "x509_verify_cert() returned" \ |
| 5441 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5442 | -S "The certificate has been revoked (is on a CRL)" |
| 5443 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5444 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5445 | run_test "SNI: CA override" \ |
| 5446 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5447 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5448 | ca_file=data_files/test-ca.crt \ |
| 5449 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 5450 | "$P_CLI debug_level=3 server_name=localhost \ |
| 5451 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5452 | 0 \ |
| 5453 | -S "skip write certificate request" \ |
| 5454 | -C "skip parse certificate request" \ |
| 5455 | -c "got a certificate request" \ |
| 5456 | -C "skip write certificate" \ |
| 5457 | -C "skip write certificate verify" \ |
| 5458 | -S "skip parse certificate verify" \ |
| 5459 | -S "x509_verify_cert() returned" \ |
| 5460 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5461 | -S "The certificate has been revoked (is on a CRL)" |
| 5462 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5463 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5464 | run_test "SNI: CA override with CRL" \ |
| 5465 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5466 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5467 | ca_file=data_files/test-ca.crt \ |
| 5468 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 5469 | "$P_CLI debug_level=3 server_name=localhost \ |
| 5470 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5471 | 1 \ |
| 5472 | -S "skip write certificate request" \ |
| 5473 | -C "skip parse certificate request" \ |
| 5474 | -c "got a certificate request" \ |
| 5475 | -C "skip write certificate" \ |
| 5476 | -C "skip write certificate verify" \ |
| 5477 | -S "skip parse certificate verify" \ |
| 5478 | -s "x509_verify_cert() returned" \ |
| 5479 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5480 | -s "The certificate has been revoked (is on a CRL)" |
| 5481 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5482 | # Tests for SNI and DTLS |
| 5483 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5484 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5485 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5486 | run_test "SNI: DTLS, no SNI callback" \ |
| 5487 | "$P_SRV debug_level=3 dtls=1 \ |
| 5488 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 5489 | "$P_CLI server_name=localhost dtls=1" \ |
| 5490 | 0 \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5491 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 5492 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 5493 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5494 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5495 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5496 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5497 | "$P_SRV debug_level=3 dtls=1 \ |
| 5498 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5499 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5500 | "$P_CLI server_name=localhost dtls=1" \ |
| 5501 | 0 \ |
| 5502 | -s "parse ServerName extension" \ |
| 5503 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5504 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 5505 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5506 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5507 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5508 | run_test "SNI: DTLS, matching cert 2" \ |
| 5509 | "$P_SRV debug_level=3 dtls=1 \ |
| 5510 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5511 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5512 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 5513 | 0 \ |
| 5514 | -s "parse ServerName extension" \ |
| 5515 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5516 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 5517 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5518 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5519 | run_test "SNI: DTLS, no matching cert" \ |
| 5520 | "$P_SRV debug_level=3 dtls=1 \ |
| 5521 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5522 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5523 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 5524 | 1 \ |
| 5525 | -s "parse ServerName extension" \ |
| 5526 | -s "ssl_sni_wrapper() returned" \ |
| 5527 | -s "mbedtls_ssl_handshake returned" \ |
| 5528 | -c "mbedtls_ssl_handshake returned" \ |
| 5529 | -c "SSL - A fatal alert message was received from our peer" |
| 5530 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5531 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5532 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 5533 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5534 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5535 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 5536 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5537 | 0 \ |
| 5538 | -S "skip write certificate request" \ |
| 5539 | -C "skip parse certificate request" \ |
| 5540 | -c "got a certificate request" \ |
| 5541 | -C "skip write certificate" \ |
| 5542 | -C "skip write certificate verify" \ |
| 5543 | -S "skip parse certificate verify" |
| 5544 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5545 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5546 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 5547 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 5548 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5549 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 5550 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5551 | 0 \ |
| 5552 | -S "skip write certificate request" \ |
| 5553 | -C "skip parse certificate request" \ |
| 5554 | -c "got a certificate request" \ |
| 5555 | -C "skip write certificate" \ |
| 5556 | -C "skip write certificate verify" \ |
| 5557 | -S "skip parse certificate verify" |
| 5558 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5559 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5560 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 5561 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5562 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5563 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 5564 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5565 | 0 \ |
| 5566 | -s "skip write certificate request" \ |
| 5567 | -C "skip parse certificate request" \ |
| 5568 | -c "got no certificate request" \ |
| 5569 | -c "skip write certificate" \ |
| 5570 | -c "skip write certificate verify" \ |
| 5571 | -s "skip parse certificate verify" |
| 5572 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5573 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5574 | run_test "SNI: DTLS, CA no override" \ |
| 5575 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5576 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5577 | ca_file=data_files/test-ca.crt \ |
| 5578 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 5579 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5580 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5581 | 1 \ |
| 5582 | -S "skip write certificate request" \ |
| 5583 | -C "skip parse certificate request" \ |
| 5584 | -c "got a certificate request" \ |
| 5585 | -C "skip write certificate" \ |
| 5586 | -C "skip write certificate verify" \ |
| 5587 | -S "skip parse certificate verify" \ |
| 5588 | -s "x509_verify_cert() returned" \ |
| 5589 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5590 | -S "The certificate has been revoked (is on a CRL)" |
| 5591 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5592 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5593 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5594 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5595 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5596 | ca_file=data_files/test-ca.crt \ |
| 5597 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 5598 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5599 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5600 | 0 \ |
| 5601 | -S "skip write certificate request" \ |
| 5602 | -C "skip parse certificate request" \ |
| 5603 | -c "got a certificate request" \ |
| 5604 | -C "skip write certificate" \ |
| 5605 | -C "skip write certificate verify" \ |
| 5606 | -S "skip parse certificate verify" \ |
| 5607 | -S "x509_verify_cert() returned" \ |
| 5608 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5609 | -S "The certificate has been revoked (is on a CRL)" |
| 5610 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5611 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5612 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5613 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5614 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 5615 | ca_file=data_files/test-ca.crt \ |
| 5616 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 5617 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5618 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5619 | 1 \ |
| 5620 | -S "skip write certificate request" \ |
| 5621 | -C "skip parse certificate request" \ |
| 5622 | -c "got a certificate request" \ |
| 5623 | -C "skip write certificate" \ |
| 5624 | -C "skip write certificate verify" \ |
| 5625 | -S "skip parse certificate verify" \ |
| 5626 | -s "x509_verify_cert() returned" \ |
| 5627 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5628 | -s "The certificate has been revoked (is on a CRL)" |
| 5629 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5630 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 5631 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5632 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5633 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5634 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 5635 | "$P_CLI nbio=2 tickets=0" \ |
| 5636 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5637 | -S "mbedtls_ssl_handshake returned" \ |
| 5638 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5639 | -c "Read from server: .* bytes read" |
| 5640 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5641 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5642 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5643 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 5644 | "$P_CLI nbio=2 tickets=0" \ |
| 5645 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5646 | -S "mbedtls_ssl_handshake returned" \ |
| 5647 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5648 | -c "Read from server: .* bytes read" |
| 5649 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5650 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5651 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5652 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 5653 | "$P_CLI nbio=2 tickets=1" \ |
| 5654 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5655 | -S "mbedtls_ssl_handshake returned" \ |
| 5656 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5657 | -c "Read from server: .* bytes read" |
| 5658 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5659 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5660 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5661 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 5662 | "$P_CLI nbio=2 tickets=1" \ |
| 5663 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5664 | -S "mbedtls_ssl_handshake returned" \ |
| 5665 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5666 | -c "Read from server: .* bytes read" |
| 5667 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5668 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5669 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5670 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 5671 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 5672 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5673 | -S "mbedtls_ssl_handshake returned" \ |
| 5674 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5675 | -c "Read from server: .* bytes read" |
| 5676 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5677 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5678 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5679 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 5680 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 5681 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5682 | -S "mbedtls_ssl_handshake returned" \ |
| 5683 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5684 | -c "Read from server: .* bytes read" |
| 5685 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5686 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5687 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5688 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 5689 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 5690 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5691 | -S "mbedtls_ssl_handshake returned" \ |
| 5692 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5693 | -c "Read from server: .* bytes read" |
| 5694 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5695 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 5696 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5697 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5698 | run_test "Event-driven I/O: basic handshake" \ |
| 5699 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 5700 | "$P_CLI event=1 tickets=0" \ |
| 5701 | 0 \ |
| 5702 | -S "mbedtls_ssl_handshake returned" \ |
| 5703 | -C "mbedtls_ssl_handshake returned" \ |
| 5704 | -c "Read from server: .* bytes read" |
| 5705 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5706 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5707 | run_test "Event-driven I/O: client auth" \ |
| 5708 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 5709 | "$P_CLI event=1 tickets=0" \ |
| 5710 | 0 \ |
| 5711 | -S "mbedtls_ssl_handshake returned" \ |
| 5712 | -C "mbedtls_ssl_handshake returned" \ |
| 5713 | -c "Read from server: .* bytes read" |
| 5714 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5715 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5716 | run_test "Event-driven I/O: ticket" \ |
| 5717 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 5718 | "$P_CLI event=1 tickets=1" \ |
| 5719 | 0 \ |
| 5720 | -S "mbedtls_ssl_handshake returned" \ |
| 5721 | -C "mbedtls_ssl_handshake returned" \ |
| 5722 | -c "Read from server: .* bytes read" |
| 5723 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5724 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5725 | run_test "Event-driven I/O: ticket + client auth" \ |
| 5726 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 5727 | "$P_CLI event=1 tickets=1" \ |
| 5728 | 0 \ |
| 5729 | -S "mbedtls_ssl_handshake returned" \ |
| 5730 | -C "mbedtls_ssl_handshake returned" \ |
| 5731 | -c "Read from server: .* bytes read" |
| 5732 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5733 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5734 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 5735 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 5736 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 5737 | 0 \ |
| 5738 | -S "mbedtls_ssl_handshake returned" \ |
| 5739 | -C "mbedtls_ssl_handshake returned" \ |
| 5740 | -c "Read from server: .* bytes read" |
| 5741 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5742 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5743 | run_test "Event-driven I/O: ticket + resume" \ |
| 5744 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 5745 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 5746 | 0 \ |
| 5747 | -S "mbedtls_ssl_handshake returned" \ |
| 5748 | -C "mbedtls_ssl_handshake returned" \ |
| 5749 | -c "Read from server: .* bytes read" |
| 5750 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5751 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5752 | run_test "Event-driven I/O: session-id resume" \ |
| 5753 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 5754 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 5755 | 0 \ |
| 5756 | -S "mbedtls_ssl_handshake returned" \ |
| 5757 | -C "mbedtls_ssl_handshake returned" \ |
| 5758 | -c "Read from server: .* bytes read" |
| 5759 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5760 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5761 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 5762 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 5763 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 5764 | 0 \ |
| 5765 | -c "Read from server: .* bytes read" |
| 5766 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5767 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5768 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 5769 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 5770 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 5771 | 0 \ |
| 5772 | -c "Read from server: .* bytes read" |
| 5773 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5774 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5775 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 5776 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 5777 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 5778 | 0 \ |
| 5779 | -c "Read from server: .* bytes read" |
| 5780 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5781 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5782 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 5783 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 5784 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 5785 | 0 \ |
| 5786 | -c "Read from server: .* bytes read" |
| 5787 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5788 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5789 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 5790 | "$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] | 5791 | "$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] | 5792 | 0 \ |
| 5793 | -c "Read from server: .* bytes read" |
| 5794 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5795 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5796 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 5797 | "$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] | 5798 | "$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] | 5799 | 0 \ |
| 5800 | -c "Read from server: .* bytes read" |
| 5801 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5802 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5803 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 5804 | "$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] | 5805 | "$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] | 5806 | 0 \ |
| 5807 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5808 | |
| 5809 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 5810 | # During session resumption, the client will send its ApplicationData record |
| 5811 | # within the same datagram as the Finished messages. In this situation, the |
| 5812 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 5813 | # because the ApplicationData request has already been queued internally. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5814 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5815 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 5816 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5817 | "$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] | 5818 | "$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] | 5819 | 0 \ |
| 5820 | -c "Read from server: .* bytes read" |
| 5821 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5822 | # Tests for version negotiation |
| 5823 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5824 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5825 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5826 | "$P_SRV" \ |
| 5827 | "$P_CLI" \ |
| 5828 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5829 | -S "mbedtls_ssl_handshake returned" \ |
| 5830 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5831 | -s "Protocol is TLSv1.2" \ |
| 5832 | -c "Protocol is TLSv1.2" |
| 5833 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5834 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 5835 | run_test "Not supported version check: cli TLS 1.0" \ |
| 5836 | "$P_SRV" \ |
| 5837 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 5838 | 1 \ |
| 5839 | -s "Handshake protocol not within min/max boundaries" \ |
| 5840 | -c "Error in protocol version" \ |
| 5841 | -S "Protocol is TLSv1.0" \ |
| 5842 | -C "Handshake was completed" |
| 5843 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5844 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 5845 | run_test "Not supported version check: cli TLS 1.1" \ |
| 5846 | "$P_SRV" \ |
| 5847 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 5848 | 1 \ |
| 5849 | -s "Handshake protocol not within min/max boundaries" \ |
| 5850 | -c "Error in protocol version" \ |
| 5851 | -S "Protocol is TLSv1.1" \ |
| 5852 | -C "Handshake was completed" |
| 5853 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5854 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 5855 | run_test "Not supported version check: srv max TLS 1.0" \ |
| 5856 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 5857 | "$P_CLI" \ |
| 5858 | 1 \ |
| 5859 | -s "Error in protocol version" \ |
| 5860 | -c "Handshake protocol not within min/max boundaries" \ |
| 5861 | -S "Version: TLS1.0" \ |
| 5862 | -C "Protocol is TLSv1.0" |
| 5863 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5864 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 5865 | run_test "Not supported version check: srv max TLS 1.1" \ |
| 5866 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 5867 | "$P_CLI" \ |
| 5868 | 1 \ |
| 5869 | -s "Error in protocol version" \ |
| 5870 | -c "Handshake protocol not within min/max boundaries" \ |
| 5871 | -S "Version: TLS1.1" \ |
| 5872 | -C "Protocol is TLSv1.1" |
| 5873 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5874 | # Tests for ALPN extension |
| 5875 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5876 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5877 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5878 | "$P_SRV debug_level=3" \ |
| 5879 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5880 | 0 \ |
| 5881 | -C "client hello, adding alpn extension" \ |
| 5882 | -S "found alpn extension" \ |
| 5883 | -C "got an alert message, type: \\[2:120]" \ |
| 5884 | -S "server hello, adding alpn extension" \ |
| 5885 | -C "found alpn extension " \ |
| 5886 | -C "Application Layer Protocol is" \ |
| 5887 | -S "Application Layer Protocol is" |
| 5888 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5889 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5890 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5891 | "$P_SRV debug_level=3" \ |
| 5892 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5893 | 0 \ |
| 5894 | -c "client hello, adding alpn extension" \ |
| 5895 | -s "found alpn extension" \ |
| 5896 | -C "got an alert message, type: \\[2:120]" \ |
| 5897 | -S "server hello, adding alpn extension" \ |
| 5898 | -C "found alpn extension " \ |
| 5899 | -c "Application Layer Protocol is (none)" \ |
| 5900 | -S "Application Layer Protocol is" |
| 5901 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5902 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5903 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5904 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5905 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5906 | 0 \ |
| 5907 | -C "client hello, adding alpn extension" \ |
| 5908 | -S "found alpn extension" \ |
| 5909 | -C "got an alert message, type: \\[2:120]" \ |
| 5910 | -S "server hello, adding alpn extension" \ |
| 5911 | -C "found alpn extension " \ |
| 5912 | -C "Application Layer Protocol is" \ |
| 5913 | -s "Application Layer Protocol is (none)" |
| 5914 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5915 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5916 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5917 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5918 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5919 | 0 \ |
| 5920 | -c "client hello, adding alpn extension" \ |
| 5921 | -s "found alpn extension" \ |
| 5922 | -C "got an alert message, type: \\[2:120]" \ |
| 5923 | -s "server hello, adding alpn extension" \ |
| 5924 | -c "found alpn extension" \ |
| 5925 | -c "Application Layer Protocol is abc" \ |
| 5926 | -s "Application Layer Protocol is abc" |
| 5927 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5928 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5929 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5930 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5931 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5932 | 0 \ |
| 5933 | -c "client hello, adding alpn extension" \ |
| 5934 | -s "found alpn extension" \ |
| 5935 | -C "got an alert message, type: \\[2:120]" \ |
| 5936 | -s "server hello, adding alpn extension" \ |
| 5937 | -c "found alpn extension" \ |
| 5938 | -c "Application Layer Protocol is abc" \ |
| 5939 | -s "Application Layer Protocol is abc" |
| 5940 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5941 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5942 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5943 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5944 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5945 | 0 \ |
| 5946 | -c "client hello, adding alpn extension" \ |
| 5947 | -s "found alpn extension" \ |
| 5948 | -C "got an alert message, type: \\[2:120]" \ |
| 5949 | -s "server hello, adding alpn extension" \ |
| 5950 | -c "found alpn extension" \ |
| 5951 | -c "Application Layer Protocol is 1234" \ |
| 5952 | -s "Application Layer Protocol is 1234" |
| 5953 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5954 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5955 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5956 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 5957 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5958 | 1 \ |
| 5959 | -c "client hello, adding alpn extension" \ |
| 5960 | -s "found alpn extension" \ |
| 5961 | -c "got an alert message, type: \\[2:120]" \ |
| 5962 | -S "server hello, adding alpn extension" \ |
| 5963 | -C "found alpn extension" \ |
| 5964 | -C "Application Layer Protocol is 1234" \ |
| 5965 | -S "Application Layer Protocol is 1234" |
| 5966 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 5967 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5968 | # Tests for keyUsage in leaf certificates, part 1: |
| 5969 | # server-side certificate/suite selection |
| 5970 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5971 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5972 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5973 | "$P_SRV key_file=data_files/server2.key \ |
| 5974 | crt_file=data_files/server2.ku-ds.crt" \ |
| 5975 | "$P_CLI" \ |
| 5976 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 5977 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5978 | |
| 5979 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5980 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5981 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5982 | "$P_SRV key_file=data_files/server2.key \ |
| 5983 | crt_file=data_files/server2.ku-ke.crt" \ |
| 5984 | "$P_CLI" \ |
| 5985 | 0 \ |
| 5986 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 5987 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5988 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5989 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5990 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5991 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5992 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5993 | 1 \ |
| 5994 | -C "Ciphersuite is " |
| 5995 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5996 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5997 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5998 | "$P_SRV key_file=data_files/server5.key \ |
| 5999 | crt_file=data_files/server5.ku-ds.crt" \ |
| 6000 | "$P_CLI" \ |
| 6001 | 0 \ |
| 6002 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 6003 | |
| 6004 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6005 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6006 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6007 | "$P_SRV key_file=data_files/server5.key \ |
| 6008 | crt_file=data_files/server5.ku-ka.crt" \ |
| 6009 | "$P_CLI" \ |
| 6010 | 0 \ |
| 6011 | -c "Ciphersuite is TLS-ECDH-" |
| 6012 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6013 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6014 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6015 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6016 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6017 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6018 | 1 \ |
| 6019 | -C "Ciphersuite is " |
| 6020 | |
| 6021 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6022 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6023 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6024 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6025 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6026 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6027 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6028 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6029 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6030 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6031 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6032 | -C "Processing of the Certificate handshake message failed" \ |
| 6033 | -c "Ciphersuite is TLS-" |
| 6034 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6035 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6036 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6037 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6038 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6039 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6040 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6041 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6042 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6043 | -C "Processing of the Certificate handshake message failed" \ |
| 6044 | -c "Ciphersuite is TLS-" |
| 6045 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6046 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6047 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6048 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6049 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6050 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6051 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6052 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6053 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6054 | -C "Processing of the Certificate handshake message failed" \ |
| 6055 | -c "Ciphersuite is TLS-" |
| 6056 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6057 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6058 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6059 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6060 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6061 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6062 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6063 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6064 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6065 | -c "Processing of the Certificate handshake message failed" \ |
| 6066 | -C "Ciphersuite is TLS-" |
| 6067 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6068 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6069 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6070 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6071 | -cert data_files/server2.ku-ke.crt" \ |
| 6072 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 6073 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6074 | 0 \ |
| 6075 | -c "bad certificate (usage extensions)" \ |
| 6076 | -C "Processing of the Certificate handshake message failed" \ |
| 6077 | -c "Ciphersuite is TLS-" \ |
| 6078 | -c "! Usage does not match the keyUsage extension" |
| 6079 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6080 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6081 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6082 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6083 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6084 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6085 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6086 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6087 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6088 | -C "Processing of the Certificate handshake message failed" \ |
| 6089 | -c "Ciphersuite is TLS-" |
| 6090 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6091 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6092 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6093 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6094 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6095 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6096 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6097 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6098 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6099 | -c "Processing of the Certificate handshake message failed" \ |
| 6100 | -C "Ciphersuite is TLS-" |
| 6101 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6102 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6103 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6104 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6105 | -cert data_files/server2.ku-ds.crt" \ |
| 6106 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 6107 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6108 | 0 \ |
| 6109 | -c "bad certificate (usage extensions)" \ |
| 6110 | -C "Processing of the Certificate handshake message failed" \ |
| 6111 | -c "Ciphersuite is TLS-" \ |
| 6112 | -c "! Usage does not match the keyUsage extension" |
| 6113 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6114 | # Tests for keyUsage in leaf certificates, part 3: |
| 6115 | # server-side checking of client cert |
| 6116 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6117 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6118 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6119 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6120 | "$O_CLI -key data_files/server2.key \ |
| 6121 | -cert data_files/server2.ku-ds.crt" \ |
| 6122 | 0 \ |
| 6123 | -S "bad certificate (usage extensions)" \ |
| 6124 | -S "Processing of the Certificate handshake message failed" |
| 6125 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6126 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6127 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6128 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6129 | "$O_CLI -key data_files/server2.key \ |
| 6130 | -cert data_files/server2.ku-ke.crt" \ |
| 6131 | 0 \ |
| 6132 | -s "bad certificate (usage extensions)" \ |
| 6133 | -S "Processing of the Certificate handshake message failed" |
| 6134 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6135 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6136 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6137 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6138 | "$O_CLI -key data_files/server2.key \ |
| 6139 | -cert data_files/server2.ku-ke.crt" \ |
| 6140 | 1 \ |
| 6141 | -s "bad certificate (usage extensions)" \ |
| 6142 | -s "Processing of the Certificate handshake message failed" |
| 6143 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6144 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6145 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6146 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6147 | "$O_CLI -key data_files/server5.key \ |
| 6148 | -cert data_files/server5.ku-ds.crt" \ |
| 6149 | 0 \ |
| 6150 | -S "bad certificate (usage extensions)" \ |
| 6151 | -S "Processing of the Certificate handshake message failed" |
| 6152 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6153 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6154 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6155 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6156 | "$O_CLI -key data_files/server5.key \ |
| 6157 | -cert data_files/server5.ku-ka.crt" \ |
| 6158 | 0 \ |
| 6159 | -s "bad certificate (usage extensions)" \ |
| 6160 | -S "Processing of the Certificate handshake message failed" |
| 6161 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6162 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 6163 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6164 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6165 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6166 | "$P_SRV key_file=data_files/server5.key \ |
| 6167 | crt_file=data_files/server5.eku-srv.crt" \ |
| 6168 | "$P_CLI" \ |
| 6169 | 0 |
| 6170 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6171 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6172 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6173 | "$P_SRV key_file=data_files/server5.key \ |
| 6174 | crt_file=data_files/server5.eku-srv.crt" \ |
| 6175 | "$P_CLI" \ |
| 6176 | 0 |
| 6177 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6178 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6179 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6180 | "$P_SRV key_file=data_files/server5.key \ |
| 6181 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 6182 | "$P_CLI" \ |
| 6183 | 0 |
| 6184 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6185 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6186 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 6187 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6188 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 6189 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6190 | 1 |
| 6191 | |
| 6192 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 6193 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6194 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6195 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6196 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6197 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6198 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6199 | 0 \ |
| 6200 | -C "bad certificate (usage extensions)" \ |
| 6201 | -C "Processing of the Certificate handshake message failed" \ |
| 6202 | -c "Ciphersuite is TLS-" |
| 6203 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6204 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6205 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6206 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6207 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6208 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6209 | 0 \ |
| 6210 | -C "bad certificate (usage extensions)" \ |
| 6211 | -C "Processing of the Certificate handshake message failed" \ |
| 6212 | -c "Ciphersuite is TLS-" |
| 6213 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6214 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6215 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6216 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6217 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6218 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6219 | 0 \ |
| 6220 | -C "bad certificate (usage extensions)" \ |
| 6221 | -C "Processing of the Certificate handshake message failed" \ |
| 6222 | -c "Ciphersuite is TLS-" |
| 6223 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6224 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6225 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6226 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6227 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6228 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6229 | 1 \ |
| 6230 | -c "bad certificate (usage extensions)" \ |
| 6231 | -c "Processing of the Certificate handshake message failed" \ |
| 6232 | -C "Ciphersuite is TLS-" |
| 6233 | |
| 6234 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 6235 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6236 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6237 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6238 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6239 | "$O_CLI -key data_files/server5.key \ |
| 6240 | -cert data_files/server5.eku-cli.crt" \ |
| 6241 | 0 \ |
| 6242 | -S "bad certificate (usage extensions)" \ |
| 6243 | -S "Processing of the Certificate handshake message failed" |
| 6244 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6245 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6246 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6247 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6248 | "$O_CLI -key data_files/server5.key \ |
| 6249 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 6250 | 0 \ |
| 6251 | -S "bad certificate (usage extensions)" \ |
| 6252 | -S "Processing of the Certificate handshake message failed" |
| 6253 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6254 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6255 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6256 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6257 | "$O_CLI -key data_files/server5.key \ |
| 6258 | -cert data_files/server5.eku-cs_any.crt" \ |
| 6259 | 0 \ |
| 6260 | -S "bad certificate (usage extensions)" \ |
| 6261 | -S "Processing of the Certificate handshake message failed" |
| 6262 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6263 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6264 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6265 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6266 | "$O_CLI -key data_files/server5.key \ |
| 6267 | -cert data_files/server5.eku-cs.crt" \ |
| 6268 | 0 \ |
| 6269 | -s "bad certificate (usage extensions)" \ |
| 6270 | -S "Processing of the Certificate handshake message failed" |
| 6271 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6272 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6273 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6274 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6275 | "$O_CLI -key data_files/server5.key \ |
| 6276 | -cert data_files/server5.eku-cs.crt" \ |
| 6277 | 1 \ |
| 6278 | -s "bad certificate (usage extensions)" \ |
| 6279 | -s "Processing of the Certificate handshake message failed" |
| 6280 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6281 | # Tests for DHM parameters loading |
| 6282 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6283 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6284 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6285 | "$P_SRV" \ |
| 6286 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6287 | debug_level=3" \ |
| 6288 | 0 \ |
| 6289 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 6290 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6291 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6292 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6293 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6294 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 6295 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6296 | debug_level=3" \ |
| 6297 | 0 \ |
| 6298 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 6299 | -c "value of 'DHM: G ' (2 bits)" |
| 6300 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6301 | # Tests for DHM client-side size checking |
| 6302 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6303 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6304 | run_test "DHM size: server default, client default, OK" \ |
| 6305 | "$P_SRV" \ |
| 6306 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6307 | debug_level=1" \ |
| 6308 | 0 \ |
| 6309 | -C "DHM prime too short:" |
| 6310 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6311 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6312 | run_test "DHM size: server default, client 2048, OK" \ |
| 6313 | "$P_SRV" \ |
| 6314 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6315 | debug_level=1 dhmlen=2048" \ |
| 6316 | 0 \ |
| 6317 | -C "DHM prime too short:" |
| 6318 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6319 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6320 | run_test "DHM size: server 1024, client default, OK" \ |
| 6321 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 6322 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6323 | debug_level=1" \ |
| 6324 | 0 \ |
| 6325 | -C "DHM prime too short:" |
| 6326 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6327 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6328 | run_test "DHM size: server 999, client 999, OK" \ |
| 6329 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 6330 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6331 | debug_level=1 dhmlen=999" \ |
| 6332 | 0 \ |
| 6333 | -C "DHM prime too short:" |
| 6334 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6335 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6336 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 6337 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 6338 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6339 | debug_level=1 dhmlen=1000" \ |
| 6340 | 0 \ |
| 6341 | -C "DHM prime too short:" |
| 6342 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6343 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6344 | run_test "DHM size: server 1000, client default, rejected" \ |
| 6345 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 6346 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6347 | debug_level=1" \ |
| 6348 | 1 \ |
| 6349 | -c "DHM prime too short:" |
| 6350 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6351 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6352 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 6353 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 6354 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6355 | debug_level=1 dhmlen=1001" \ |
| 6356 | 1 \ |
| 6357 | -c "DHM prime too short:" |
| 6358 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6359 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6360 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 6361 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 6362 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6363 | debug_level=1 dhmlen=1000" \ |
| 6364 | 1 \ |
| 6365 | -c "DHM prime too short:" |
| 6366 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6367 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6368 | run_test "DHM size: server 998, client 999, rejected" \ |
| 6369 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 6370 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6371 | debug_level=1 dhmlen=999" \ |
| 6372 | 1 \ |
| 6373 | -c "DHM prime too short:" |
| 6374 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6375 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6376 | run_test "DHM size: server default, client 2049, rejected" \ |
| 6377 | "$P_SRV" \ |
| 6378 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6379 | debug_level=1 dhmlen=2049" \ |
| 6380 | 1 \ |
| 6381 | -c "DHM prime too short:" |
| 6382 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6383 | # Tests for PSK callback |
| 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 "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6387 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 6388 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6389 | psk_identity=foo psk=abc123" \ |
| 6390 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6391 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 6392 | -S "SSL - Unknown identity received" \ |
| 6393 | -S "SSL - Verification of the message MAC failed" |
| 6394 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6395 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6396 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6397 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 6398 | "$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] | 6399 | "$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] | 6400 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6401 | 0 \ |
| 6402 | -c "skip PMS generation for opaque PSK"\ |
| 6403 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6404 | -C "session hash for extended master secret"\ |
| 6405 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6406 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6407 | -S "SSL - Unknown identity received" \ |
| 6408 | -S "SSL - Verification of the message MAC failed" |
| 6409 | |
| 6410 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6411 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6412 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 6413 | "$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] | 6414 | "$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] | 6415 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6416 | 0 \ |
| 6417 | -c "skip PMS generation for opaque PSK"\ |
| 6418 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6419 | -C "session hash for extended master secret"\ |
| 6420 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6421 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6422 | -S "SSL - Unknown identity received" \ |
| 6423 | -S "SSL - Verification of the message MAC failed" |
| 6424 | |
| 6425 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6426 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6427 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 6428 | "$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] | 6429 | "$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] | 6430 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6431 | 0 \ |
| 6432 | -c "skip PMS generation for opaque PSK"\ |
| 6433 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6434 | -c "session hash for extended master secret"\ |
| 6435 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6436 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6437 | -S "SSL - Unknown identity received" \ |
| 6438 | -S "SSL - Verification of the message MAC failed" |
| 6439 | |
| 6440 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6441 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6442 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 6443 | "$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] | 6444 | "$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] | 6445 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6446 | 0 \ |
| 6447 | -c "skip PMS generation for opaque PSK"\ |
| 6448 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6449 | -c "session hash for extended master secret"\ |
| 6450 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6451 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6452 | -S "SSL - Unknown identity received" \ |
| 6453 | -S "SSL - Verification of the message MAC failed" |
| 6454 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6455 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6456 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6457 | 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] | 6458 | "$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" \ |
| 6459 | "$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] | 6460 | psk_identity=foo psk=abc123" \ |
| 6461 | 0 \ |
| 6462 | -C "skip PMS generation for opaque PSK"\ |
| 6463 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6464 | -C "session hash for extended master secret"\ |
| 6465 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6466 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6467 | -S "SSL - Unknown identity received" \ |
| 6468 | -S "SSL - Verification of the message MAC failed" |
| 6469 | |
| 6470 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6471 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6472 | 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] | 6473 | "$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" \ |
| 6474 | "$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] | 6475 | psk_identity=foo psk=abc123" \ |
| 6476 | 0 \ |
| 6477 | -C "skip PMS generation for opaque PSK"\ |
| 6478 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6479 | -C "session hash for extended master secret"\ |
| 6480 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6481 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6482 | -S "SSL - Unknown identity received" \ |
| 6483 | -S "SSL - Verification of the message MAC failed" |
| 6484 | |
| 6485 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6486 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6487 | 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] | 6488 | "$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] | 6489 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6490 | "$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] | 6491 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 6492 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6493 | -c "session hash for extended master secret"\ |
| 6494 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6495 | -C "skip PMS generation for opaque PSK"\ |
| 6496 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6497 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6498 | -S "SSL - Unknown identity received" \ |
| 6499 | -S "SSL - Verification of the message MAC failed" |
| 6500 | |
| 6501 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6502 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6503 | 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] | 6504 | "$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] | 6505 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6506 | "$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] | 6507 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 6508 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6509 | -c "session hash for extended master secret"\ |
| 6510 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6511 | -C "skip PMS generation for opaque PSK"\ |
| 6512 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6513 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6514 | -S "SSL - Unknown identity received" \ |
| 6515 | -S "SSL - Verification of the message MAC failed" |
| 6516 | |
| 6517 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6518 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6519 | 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] | 6520 | "$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" \ |
| 6521 | "$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] | 6522 | psk_identity=def psk=beef" \ |
| 6523 | 0 \ |
| 6524 | -C "skip PMS generation for opaque PSK"\ |
| 6525 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6526 | -C "session hash for extended master secret"\ |
| 6527 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6528 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6529 | -S "SSL - Unknown identity received" \ |
| 6530 | -S "SSL - Verification of the message MAC failed" |
| 6531 | |
| 6532 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6533 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6534 | 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] | 6535 | "$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" \ |
| 6536 | "$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] | 6537 | psk_identity=def psk=beef" \ |
| 6538 | 0 \ |
| 6539 | -C "skip PMS generation for opaque PSK"\ |
| 6540 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6541 | -C "session hash for extended master secret"\ |
| 6542 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6543 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6544 | -S "SSL - Unknown identity received" \ |
| 6545 | -S "SSL - Verification of the message MAC failed" |
| 6546 | |
| 6547 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6548 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6549 | 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] | 6550 | "$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] | 6551 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6552 | "$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] | 6553 | psk_identity=abc psk=dead extended_ms=1" \ |
| 6554 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6555 | -c "session hash for extended master secret"\ |
| 6556 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6557 | -C "skip PMS generation for opaque PSK"\ |
| 6558 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6559 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6560 | -S "SSL - Unknown identity received" \ |
| 6561 | -S "SSL - Verification of the message MAC failed" |
| 6562 | |
| 6563 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6564 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6565 | 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] | 6566 | "$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] | 6567 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6568 | "$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] | 6569 | psk_identity=abc psk=dead extended_ms=1" \ |
| 6570 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6571 | -c "session hash for extended master secret"\ |
| 6572 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6573 | -C "skip PMS generation for opaque PSK"\ |
| 6574 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6575 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6576 | -S "SSL - Unknown identity received" \ |
| 6577 | -S "SSL - Verification of the message MAC failed" |
| 6578 | |
| 6579 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6580 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6581 | 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] | 6582 | "$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" \ |
| 6583 | "$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] | 6584 | psk_identity=def psk=beef" \ |
| 6585 | 0 \ |
| 6586 | -C "skip PMS generation for opaque PSK"\ |
| 6587 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6588 | -C "session hash for extended master secret"\ |
| 6589 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6590 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6591 | -S "SSL - Unknown identity received" \ |
| 6592 | -S "SSL - Verification of the message MAC failed" |
| 6593 | |
| 6594 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6595 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6596 | 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] | 6597 | "$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" \ |
| 6598 | "$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] | 6599 | psk_identity=def psk=beef" \ |
| 6600 | 0 \ |
| 6601 | -C "skip PMS generation for opaque PSK"\ |
| 6602 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6603 | -C "session hash for extended master secret"\ |
| 6604 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6605 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6606 | -S "SSL - Unknown identity received" \ |
| 6607 | -S "SSL - Verification of the message MAC failed" |
| 6608 | |
| 6609 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6610 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6611 | 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] | 6612 | "$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" \ |
| 6613 | "$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] | 6614 | psk_identity=def psk=beef" \ |
| 6615 | 0 \ |
| 6616 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6617 | -C "session hash for extended master secret"\ |
| 6618 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6619 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6620 | -S "SSL - Unknown identity received" \ |
| 6621 | -S "SSL - Verification of the message MAC failed" |
| 6622 | |
| 6623 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6624 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6625 | 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] | 6626 | "$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" \ |
| 6627 | "$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] | 6628 | psk_identity=def psk=beef" \ |
| 6629 | 0 \ |
| 6630 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6631 | -C "session hash for extended master secret"\ |
| 6632 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6633 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6634 | -S "SSL - Unknown identity received" \ |
| 6635 | -S "SSL - Verification of the message MAC failed" |
| 6636 | |
| 6637 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6638 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6639 | 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] | 6640 | "$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" \ |
| 6641 | "$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] | 6642 | psk_identity=def psk=beef" \ |
| 6643 | 1 \ |
| 6644 | -s "SSL - Verification of the message MAC failed" |
| 6645 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6646 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6647 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 6648 | "$P_SRV" \ |
| 6649 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6650 | psk_identity=foo psk=abc123" \ |
| 6651 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 6652 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6653 | -S "SSL - Unknown identity received" \ |
| 6654 | -S "SSL - Verification of the message MAC failed" |
| 6655 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6656 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6657 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6658 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 6659 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6660 | psk_identity=foo psk=abc123" \ |
| 6661 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6662 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6663 | -s "SSL - Unknown identity received" \ |
| 6664 | -S "SSL - Verification of the message MAC failed" |
| 6665 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6666 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6667 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6668 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6669 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6670 | psk_identity=abc psk=dead" \ |
| 6671 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6672 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6673 | -S "SSL - Unknown identity received" \ |
| 6674 | -S "SSL - Verification of the message MAC failed" |
| 6675 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6676 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6677 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6678 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6679 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6680 | psk_identity=def psk=beef" \ |
| 6681 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6682 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6683 | -S "SSL - Unknown identity received" \ |
| 6684 | -S "SSL - Verification of the message MAC failed" |
| 6685 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6686 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6687 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6688 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6689 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6690 | psk_identity=ghi psk=beef" \ |
| 6691 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6692 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6693 | -s "SSL - Unknown identity received" \ |
| 6694 | -S "SSL - Verification of the message MAC failed" |
| 6695 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6696 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6697 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6698 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6699 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6700 | psk_identity=abc psk=beef" \ |
| 6701 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6702 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6703 | -S "SSL - Unknown identity received" \ |
| 6704 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6705 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6706 | # Tests for EC J-PAKE |
| 6707 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6708 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6709 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6710 | run_test "ECJPAKE: client not configured" \ |
| 6711 | "$P_SRV debug_level=3" \ |
| 6712 | "$P_CLI debug_level=3" \ |
| 6713 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6714 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6715 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6716 | -S "found ecjpake kkpp extension" \ |
| 6717 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6718 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6719 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6720 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 6721 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6722 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6723 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6724 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6725 | run_test "ECJPAKE: server not configured" \ |
| 6726 | "$P_SRV debug_level=3" \ |
| 6727 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 6728 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6729 | 1 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 6730 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6731 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6732 | -s "found ecjpake kkpp extension" \ |
| 6733 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6734 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6735 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6736 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 6737 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6738 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6739 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6740 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6741 | run_test "ECJPAKE: working, TLS" \ |
| 6742 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 6743 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 6744 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 6745 | 0 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 6746 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6747 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6748 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6749 | -s "found ecjpake kkpp extension" \ |
| 6750 | -S "skip ecjpake kkpp extension" \ |
| 6751 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6752 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6753 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 6754 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6755 | -S "SSL - Verification of the message MAC failed" |
| 6756 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6757 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6758 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6759 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6760 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 6761 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 6762 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 6763 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6764 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6765 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6766 | -s "SSL - Verification of the message MAC failed" |
| 6767 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6768 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6769 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6770 | run_test "ECJPAKE: working, DTLS" \ |
| 6771 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 6772 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 6773 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6774 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6775 | -c "re-using cached ecjpake parameters" \ |
| 6776 | -S "SSL - Verification of the message MAC failed" |
| 6777 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6778 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6779 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6780 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 6781 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 6782 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 6783 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6784 | 0 \ |
| 6785 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6786 | -S "SSL - Verification of the message MAC failed" |
| 6787 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6788 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6789 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6790 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6791 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 6792 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 6793 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 6794 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6795 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6796 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6797 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6798 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 6799 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6800 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6801 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 6802 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 6803 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 6804 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 6805 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6806 | 0 |
| 6807 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 6808 | # Test for ClientHello without extensions |
| 6809 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 6810 | requires_gnutls |
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 | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 6812 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 6813 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6814 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 6815 | 0 \ |
| 6816 | -s "dumping 'client hello extensions' (0 bytes)" |
| 6817 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6818 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6819 | |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 6820 | # The server first reads buffer_size-1 bytes, then reads the remainder. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6821 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6822 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 6823 | "$P_SRV buffer_size=100" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6824 | "$P_CLI request_size=100" \ |
| 6825 | 0 \ |
| 6826 | -s "Read from client: 100 bytes read$" |
| 6827 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6828 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 6829 | run_test "mbedtls_ssl_get_bytes_avail: extra data (+1)" \ |
| 6830 | "$P_SRV buffer_size=100" \ |
| 6831 | "$P_CLI request_size=101" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6832 | 0 \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 6833 | -s "Read from client: 101 bytes read (100 + 1)" |
| 6834 | |
| 6835 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6836 | requires_max_content_len 200 |
| 6837 | run_test "mbedtls_ssl_get_bytes_avail: extra data (*2)" \ |
| 6838 | "$P_SRV buffer_size=100" \ |
| 6839 | "$P_CLI request_size=200" \ |
| 6840 | 0 \ |
| 6841 | -s "Read from client: 200 bytes read (100 + 100)" |
| 6842 | |
| 6843 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6844 | run_test "mbedtls_ssl_get_bytes_avail: extra data (max)" \ |
| 6845 | "$P_SRV buffer_size=100" \ |
| 6846 | "$P_CLI request_size=$MAX_CONTENT_LEN" \ |
| 6847 | 0 \ |
| 6848 | -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] | 6849 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6850 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6851 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6852 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 6853 | "$P_SRV force_version=tls12" \ |
| 6854 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6855 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6856 | 0 \ |
| 6857 | -s "Read from client: 1 bytes read" |
| 6858 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6859 | run_test "Small client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 6860 | "$P_SRV force_version=tls12" \ |
| 6861 | "$P_CLI request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6862 | 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] | 6863 | 0 \ |
| 6864 | -s "Read from client: 1 bytes read" |
| 6865 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6866 | run_test "Small client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 6867 | "$P_SRV force_version=tls12" \ |
| 6868 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6869 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6870 | 0 \ |
| 6871 | -s "Read from client: 1 bytes read" |
| 6872 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6873 | run_test "Small client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 6874 | "$P_SRV force_version=tls12" \ |
| 6875 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6876 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6877 | 0 \ |
| 6878 | -s "Read from client: 1 bytes read" |
| 6879 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6880 | run_test "Small client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 6881 | "$P_SRV force_version=tls12" \ |
| 6882 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6883 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6884 | 0 \ |
| 6885 | -s "Read from client: 1 bytes read" |
| 6886 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6887 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6888 | |
| 6889 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6890 | run_test "Small client packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6891 | "$P_SRV dtls=1 force_version=dtls12" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6892 | "$P_CLI dtls=1 request_size=1 \ |
| 6893 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6894 | 0 \ |
| 6895 | -s "Read from client: 1 bytes read" |
| 6896 | |
| 6897 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6898 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6899 | "$P_SRV dtls=1 force_version=dtls12 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6900 | "$P_CLI dtls=1 request_size=1 \ |
| 6901 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6902 | 0 \ |
| 6903 | -s "Read from client: 1 bytes read" |
| 6904 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6905 | # Tests for small server packets |
| 6906 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6907 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 6908 | "$P_SRV response_size=1 force_version=tls12" \ |
| 6909 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6910 | 0 \ |
| 6911 | -c "Read from server: 1 bytes read" |
| 6912 | |
| 6913 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 6914 | "$P_SRV response_size=1 force_version=tls12" \ |
| 6915 | "$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] | 6916 | 0 \ |
| 6917 | -c "Read from server: 1 bytes read" |
| 6918 | |
| 6919 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 6920 | "$P_SRV response_size=1 force_version=tls12" \ |
| 6921 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6922 | 0 \ |
| 6923 | -c "Read from server: 1 bytes read" |
| 6924 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6925 | run_test "Small server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 6926 | "$P_SRV response_size=1 force_version=tls12" \ |
| 6927 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6928 | 0 \ |
| 6929 | -c "Read from server: 1 bytes read" |
| 6930 | |
| 6931 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 6932 | "$P_SRV response_size=1 force_version=tls12" \ |
| 6933 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6934 | 0 \ |
| 6935 | -c "Read from server: 1 bytes read" |
| 6936 | |
| 6937 | # Tests for small server packets in DTLS |
| 6938 | |
| 6939 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6940 | run_test "Small server packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6941 | "$P_SRV dtls=1 response_size=1 force_version=dtls12" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6942 | "$P_CLI dtls=1 \ |
| 6943 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6944 | 0 \ |
| 6945 | -c "Read from server: 1 bytes read" |
| 6946 | |
| 6947 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6948 | run_test "Small server packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6949 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6950 | "$P_CLI dtls=1 \ |
| 6951 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6952 | 0 \ |
| 6953 | -c "Read from server: 1 bytes read" |
| 6954 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6955 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6956 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6957 | # How many fragments do we expect to write $1 bytes? |
| 6958 | fragments_for_write() { |
| 6959 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 6960 | } |
| 6961 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6962 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 6963 | "$P_SRV force_version=tls12" \ |
| 6964 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6965 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6966 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6967 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6968 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6969 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6970 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 6971 | "$P_SRV force_version=tls12" \ |
| 6972 | "$P_CLI request_size=16384 etm=0 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6973 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6974 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6975 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6976 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6977 | run_test "Large client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 6978 | "$P_SRV force_version=tls12" \ |
| 6979 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6980 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6981 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6982 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6983 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6984 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6985 | run_test "Large client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 6986 | "$P_SRV force_version=tls12" \ |
| 6987 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6988 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6989 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6990 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6991 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6992 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6993 | run_test "Large client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 6994 | "$P_SRV force_version=tls12" \ |
| 6995 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6996 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6997 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6998 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6999 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7000 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7001 | # 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] | 7002 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7003 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 7004 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7005 | 0 \ |
| 7006 | -c "Read from server: 16384 bytes read" |
| 7007 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7008 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7009 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 7010 | "$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] | 7011 | 0 \ |
| 7012 | -s "16384 bytes written in 1 fragments" \ |
| 7013 | -c "Read from server: 16384 bytes read" |
| 7014 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7015 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7016 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 7017 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7018 | 0 \ |
| 7019 | -c "Read from server: 16384 bytes read" |
| 7020 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7021 | 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] | 7022 | "$P_SRV response_size=16384 trunc_hmac=1 force_version=tls12" \ |
| 7023 | "$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] | 7024 | 0 \ |
| 7025 | -s "16384 bytes written in 1 fragments" \ |
| 7026 | -c "Read from server: 16384 bytes read" |
| 7027 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7028 | run_test "Large server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7029 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 7030 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7031 | 0 \ |
| 7032 | -c "Read from server: 16384 bytes read" |
| 7033 | |
| 7034 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7035 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 7036 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7037 | 0 \ |
| 7038 | -c "Read from server: 16384 bytes read" |
| 7039 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7040 | # Tests for restartable ECC |
| 7041 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7042 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 7043 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7044 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7045 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7046 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7047 | run_test "EC restart: TLS, default" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7048 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7049 | "$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] | 7050 | 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] | 7051 | debug_level=1" \ |
| 7052 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7053 | -C "x509_verify_cert.*4b00" \ |
| 7054 | -C "mbedtls_pk_verify.*4b00" \ |
| 7055 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7056 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7057 | |
| 7058 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7059 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7060 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7061 | run_test "EC restart: TLS, max_ops=0" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7062 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7063 | "$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] | 7064 | 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] | 7065 | debug_level=1 ec_max_ops=0" \ |
| 7066 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7067 | -C "x509_verify_cert.*4b00" \ |
| 7068 | -C "mbedtls_pk_verify.*4b00" \ |
| 7069 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7070 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7071 | |
| 7072 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7073 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7074 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7075 | run_test "EC restart: TLS, max_ops=65535" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7076 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7077 | "$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] | 7078 | 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] | 7079 | debug_level=1 ec_max_ops=65535" \ |
| 7080 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7081 | -C "x509_verify_cert.*4b00" \ |
| 7082 | -C "mbedtls_pk_verify.*4b00" \ |
| 7083 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7084 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7085 | |
| 7086 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7087 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7088 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7089 | run_test "EC restart: TLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7090 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7091 | "$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] | 7092 | 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] | 7093 | debug_level=1 ec_max_ops=1000" \ |
| 7094 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7095 | -c "x509_verify_cert.*4b00" \ |
| 7096 | -c "mbedtls_pk_verify.*4b00" \ |
| 7097 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7098 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7099 | |
| 7100 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7101 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7102 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7103 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7104 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7105 | crt_file=data_files/server5-badsign.crt \ |
| 7106 | key_file=data_files/server5.key" \ |
| 7107 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7108 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7109 | debug_level=1 ec_max_ops=1000" \ |
| 7110 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7111 | -c "x509_verify_cert.*4b00" \ |
| 7112 | -C "mbedtls_pk_verify.*4b00" \ |
| 7113 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7114 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7115 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 7116 | -c "! mbedtls_ssl_handshake returned" \ |
| 7117 | -c "X509 - Certificate verification failed" |
| 7118 | |
| 7119 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7120 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7121 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7122 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7123 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7124 | crt_file=data_files/server5-badsign.crt \ |
| 7125 | key_file=data_files/server5.key" \ |
| 7126 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7127 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7128 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 7129 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7130 | -c "x509_verify_cert.*4b00" \ |
| 7131 | -c "mbedtls_pk_verify.*4b00" \ |
| 7132 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7133 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7134 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 7135 | -C "! mbedtls_ssl_handshake returned" \ |
| 7136 | -C "X509 - Certificate verification failed" |
| 7137 | |
| 7138 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7139 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7140 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7141 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7142 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7143 | crt_file=data_files/server5-badsign.crt \ |
| 7144 | key_file=data_files/server5.key" \ |
| 7145 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7146 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7147 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 7148 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7149 | -C "x509_verify_cert.*4b00" \ |
| 7150 | -c "mbedtls_pk_verify.*4b00" \ |
| 7151 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7152 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7153 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 7154 | -C "! mbedtls_ssl_handshake returned" \ |
| 7155 | -C "X509 - Certificate verification failed" |
| 7156 | |
| 7157 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7158 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7159 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7160 | run_test "EC restart: DTLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7161 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7162 | "$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] | 7163 | 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] | 7164 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 7165 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7166 | -c "x509_verify_cert.*4b00" \ |
| 7167 | -c "mbedtls_pk_verify.*4b00" \ |
| 7168 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7169 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7170 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7171 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7172 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7173 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7174 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7175 | "$P_SRV curves=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7176 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7177 | debug_level=1 ec_max_ops=1000" \ |
| 7178 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7179 | -c "x509_verify_cert.*4b00" \ |
| 7180 | -c "mbedtls_pk_verify.*4b00" \ |
| 7181 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7182 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7183 | |
| 7184 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7185 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7186 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7187 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7188 | "$P_SRV curves=secp256r1 psk=abc123" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7189 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7190 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 7191 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7192 | -C "x509_verify_cert.*4b00" \ |
| 7193 | -C "mbedtls_pk_verify.*4b00" \ |
| 7194 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7195 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7196 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7197 | # Tests of asynchronous private key support in SSL |
| 7198 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7199 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7200 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7201 | run_test "SSL async private: sign, delay=0" \ |
| 7202 | "$P_SRV \ |
| 7203 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7204 | "$P_CLI" \ |
| 7205 | 0 \ |
| 7206 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7207 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7208 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7209 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7210 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7211 | run_test "SSL async private: sign, delay=1" \ |
| 7212 | "$P_SRV \ |
| 7213 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7214 | "$P_CLI" \ |
| 7215 | 0 \ |
| 7216 | -s "Async sign callback: using key slot " \ |
| 7217 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7218 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7219 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 7220 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7221 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 7222 | run_test "SSL async private: sign, delay=2" \ |
| 7223 | "$P_SRV \ |
| 7224 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 7225 | "$P_CLI" \ |
| 7226 | 0 \ |
| 7227 | -s "Async sign callback: using key slot " \ |
| 7228 | -U "Async sign callback: using key slot " \ |
| 7229 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 7230 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7231 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7232 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7233 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 7234 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7235 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 7236 | run_test "SSL async private: sign, SNI" \ |
| 7237 | "$P_SRV debug_level=3 \ |
| 7238 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 7239 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 7240 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 7241 | "$P_CLI server_name=polarssl.example" \ |
| 7242 | 0 \ |
| 7243 | -s "Async sign callback: using key slot " \ |
| 7244 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 7245 | -s "parse ServerName extension" \ |
| 7246 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 7247 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 7248 | |
| 7249 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7250 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7251 | run_test "SSL async private: decrypt, delay=0" \ |
| 7252 | "$P_SRV \ |
| 7253 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 7254 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7255 | 0 \ |
| 7256 | -s "Async decrypt callback: using key slot " \ |
| 7257 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7258 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7259 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7260 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7261 | run_test "SSL async private: decrypt, delay=1" \ |
| 7262 | "$P_SRV \ |
| 7263 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7264 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7265 | 0 \ |
| 7266 | -s "Async decrypt callback: using key slot " \ |
| 7267 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7268 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7269 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7270 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7271 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7272 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 7273 | "$P_SRV psk=abc123 \ |
| 7274 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 7275 | "$P_CLI psk=abc123 \ |
| 7276 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 7277 | 0 \ |
| 7278 | -s "Async decrypt callback: using key slot " \ |
| 7279 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7280 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7281 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7282 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7283 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 7284 | "$P_SRV psk=abc123 \ |
| 7285 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7286 | "$P_CLI psk=abc123 \ |
| 7287 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 7288 | 0 \ |
| 7289 | -s "Async decrypt callback: using key slot " \ |
| 7290 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7291 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7292 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7293 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7294 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7295 | run_test "SSL async private: sign callback not present" \ |
| 7296 | "$P_SRV \ |
| 7297 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7298 | "$P_CLI; [ \$? -eq 1 ] && |
| 7299 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7300 | 0 \ |
| 7301 | -S "Async sign callback" \ |
| 7302 | -s "! mbedtls_ssl_handshake returned" \ |
| 7303 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 7304 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 7305 | -s "Successful connection" |
| 7306 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7307 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7308 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7309 | run_test "SSL async private: decrypt callback not present" \ |
| 7310 | "$P_SRV debug_level=1 \ |
| 7311 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 7312 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 7313 | [ \$? -eq 1 ] && $P_CLI" \ |
| 7314 | 0 \ |
| 7315 | -S "Async decrypt callback" \ |
| 7316 | -s "! mbedtls_ssl_handshake returned" \ |
| 7317 | -s "got no RSA private key" \ |
| 7318 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 7319 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7320 | |
| 7321 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7322 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7323 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7324 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7325 | "$P_SRV \ |
| 7326 | async_operations=s async_private_delay1=1 \ |
| 7327 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7328 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7329 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7330 | 0 \ |
| 7331 | -s "Async sign callback: using key slot 0," \ |
| 7332 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7333 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7334 | |
| 7335 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7336 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7337 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7338 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7339 | "$P_SRV \ |
| 7340 | async_operations=s async_private_delay2=1 \ |
| 7341 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7342 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7343 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7344 | 0 \ |
| 7345 | -s "Async sign callback: using key slot 0," \ |
| 7346 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7347 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7348 | |
| 7349 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7350 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7351 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 7352 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7353 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 7354 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7355 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7356 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7357 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7358 | 0 \ |
| 7359 | -s "Async sign callback: using key slot 1," \ |
| 7360 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7361 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7362 | |
| 7363 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7364 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7365 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7366 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7367 | "$P_SRV \ |
| 7368 | async_operations=s async_private_delay1=1 \ |
| 7369 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7370 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7371 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7372 | 0 \ |
| 7373 | -s "Async sign callback: no key matches this certificate." |
| 7374 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7375 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7376 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7377 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7378 | "$P_SRV \ |
| 7379 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7380 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7381 | "$P_CLI" \ |
| 7382 | 1 \ |
| 7383 | -s "Async sign callback: injected error" \ |
| 7384 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 7385 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7386 | -s "! mbedtls_ssl_handshake returned" |
| 7387 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7388 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7389 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7390 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7391 | "$P_SRV \ |
| 7392 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7393 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7394 | "$P_CLI" \ |
| 7395 | 1 \ |
| 7396 | -s "Async sign callback: using key slot " \ |
| 7397 | -S "Async resume" \ |
| 7398 | -s "Async cancel" |
| 7399 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7400 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7401 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7402 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7403 | "$P_SRV \ |
| 7404 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7405 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7406 | "$P_CLI" \ |
| 7407 | 1 \ |
| 7408 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7409 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 7410 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7411 | -s "! mbedtls_ssl_handshake returned" |
| 7412 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7413 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7414 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7415 | run_test "SSL async private: decrypt, error in start" \ |
| 7416 | "$P_SRV \ |
| 7417 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7418 | async_private_error=1" \ |
| 7419 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7420 | 1 \ |
| 7421 | -s "Async decrypt callback: injected error" \ |
| 7422 | -S "Async resume" \ |
| 7423 | -S "Async cancel" \ |
| 7424 | -s "! mbedtls_ssl_handshake returned" |
| 7425 | |
| 7426 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7427 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7428 | run_test "SSL async private: decrypt, cancel after start" \ |
| 7429 | "$P_SRV \ |
| 7430 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7431 | async_private_error=2" \ |
| 7432 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7433 | 1 \ |
| 7434 | -s "Async decrypt callback: using key slot " \ |
| 7435 | -S "Async resume" \ |
| 7436 | -s "Async cancel" |
| 7437 | |
| 7438 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7439 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7440 | run_test "SSL async private: decrypt, error in resume" \ |
| 7441 | "$P_SRV \ |
| 7442 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7443 | async_private_error=3" \ |
| 7444 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7445 | 1 \ |
| 7446 | -s "Async decrypt callback: using key slot " \ |
| 7447 | -s "Async resume callback: decrypt done but injected error" \ |
| 7448 | -S "Async cancel" \ |
| 7449 | -s "! mbedtls_ssl_handshake returned" |
| 7450 | |
| 7451 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7452 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7453 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7454 | "$P_SRV \ |
| 7455 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7456 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7457 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 7458 | 0 \ |
| 7459 | -s "Async cancel" \ |
| 7460 | -s "! mbedtls_ssl_handshake returned" \ |
| 7461 | -s "Async resume" \ |
| 7462 | -s "Successful connection" |
| 7463 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7464 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7465 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7466 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7467 | "$P_SRV \ |
| 7468 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7469 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7470 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 7471 | 0 \ |
| 7472 | -s "! mbedtls_ssl_handshake returned" \ |
| 7473 | -s "Async resume" \ |
| 7474 | -s "Successful connection" |
| 7475 | |
| 7476 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7477 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7478 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7479 | 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] | 7480 | "$P_SRV \ |
| 7481 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 7482 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7483 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7484 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 7485 | [ \$? -eq 1 ] && |
| 7486 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7487 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 7488 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7489 | -S "Async resume" \ |
| 7490 | -s "Async cancel" \ |
| 7491 | -s "! mbedtls_ssl_handshake returned" \ |
| 7492 | -s "Async sign callback: no key matches this certificate." \ |
| 7493 | -s "Successful connection" |
| 7494 | |
| 7495 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7496 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7497 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7498 | 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] | 7499 | "$P_SRV \ |
| 7500 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 7501 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7502 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7503 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 7504 | [ \$? -eq 1 ] && |
| 7505 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7506 | 0 \ |
| 7507 | -s "Async resume" \ |
| 7508 | -s "! mbedtls_ssl_handshake returned" \ |
| 7509 | -s "Async sign callback: no key matches this certificate." \ |
| 7510 | -s "Successful connection" |
| 7511 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7512 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7513 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7514 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7515 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7516 | "$P_SRV \ |
| 7517 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7518 | exchanges=2 renegotiation=1" \ |
| 7519 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7520 | 0 \ |
| 7521 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7522 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7523 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7524 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7525 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7526 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7527 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7528 | "$P_SRV \ |
| 7529 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7530 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7531 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 7532 | 0 \ |
| 7533 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7534 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7535 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7536 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7537 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7538 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7539 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7540 | "$P_SRV \ |
| 7541 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7542 | exchanges=2 renegotiation=1" \ |
| 7543 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 7544 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7545 | 0 \ |
| 7546 | -s "Async decrypt callback: using key slot " \ |
| 7547 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7548 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7549 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7550 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7551 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7552 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7553 | "$P_SRV \ |
| 7554 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7555 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7556 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 7557 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7558 | 0 \ |
| 7559 | -s "Async decrypt callback: using key slot " \ |
| 7560 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7561 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7562 | # Tests for ECC extensions (rfc 4492) |
| 7563 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7564 | requires_config_enabled MBEDTLS_AES_C |
| 7565 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7566 | requires_config_enabled MBEDTLS_SHA256_C |
| 7567 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7568 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7569 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 7570 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7571 | "$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] | 7572 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 7573 | -C "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7574 | -C "client hello, adding supported_point_formats extension" \ |
| 7575 | -S "found supported elliptic curves extension" \ |
| 7576 | -S "found supported point formats extension" |
| 7577 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7578 | requires_config_enabled MBEDTLS_AES_C |
| 7579 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7580 | requires_config_enabled MBEDTLS_SHA256_C |
| 7581 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7582 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7583 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7584 | "$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] | 7585 | "$P_CLI debug_level=3" \ |
| 7586 | 0 \ |
| 7587 | -C "found supported_point_formats extension" \ |
| 7588 | -S "server hello, supported_point_formats extension" |
| 7589 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7590 | requires_config_enabled MBEDTLS_AES_C |
| 7591 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7592 | requires_config_enabled MBEDTLS_SHA256_C |
| 7593 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7594 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7595 | run_test "Force an ECC ciphersuite in the client side" \ |
| 7596 | "$P_SRV debug_level=3" \ |
| 7597 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7598 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 7599 | -c "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7600 | -c "client hello, adding supported_point_formats extension" \ |
| 7601 | -s "found supported elliptic curves extension" \ |
| 7602 | -s "found supported point formats extension" |
| 7603 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7604 | requires_config_enabled MBEDTLS_AES_C |
| 7605 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7606 | requires_config_enabled MBEDTLS_SHA256_C |
| 7607 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7608 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7609 | run_test "Force an ECC ciphersuite in the server side" \ |
| 7610 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7611 | "$P_CLI debug_level=3" \ |
| 7612 | 0 \ |
| 7613 | -c "found supported_point_formats extension" \ |
| 7614 | -s "server hello, supported_point_formats extension" |
| 7615 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7616 | # Tests for DTLS HelloVerifyRequest |
| 7617 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7618 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7619 | run_test "DTLS cookie: enabled" \ |
| 7620 | "$P_SRV dtls=1 debug_level=2" \ |
| 7621 | "$P_CLI dtls=1 debug_level=2" \ |
| 7622 | 0 \ |
| 7623 | -s "cookie verification failed" \ |
| 7624 | -s "cookie verification passed" \ |
| 7625 | -S "cookie verification skipped" \ |
| 7626 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7627 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7628 | -S "SSL - The requested feature is not available" |
| 7629 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7630 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7631 | run_test "DTLS cookie: disabled" \ |
| 7632 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 7633 | "$P_CLI dtls=1 debug_level=2" \ |
| 7634 | 0 \ |
| 7635 | -S "cookie verification failed" \ |
| 7636 | -S "cookie verification passed" \ |
| 7637 | -s "cookie verification skipped" \ |
| 7638 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7639 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7640 | -S "SSL - The requested feature is not available" |
| 7641 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7642 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7643 | run_test "DTLS cookie: default (failing)" \ |
| 7644 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 7645 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 7646 | 1 \ |
| 7647 | -s "cookie verification failed" \ |
| 7648 | -S "cookie verification passed" \ |
| 7649 | -S "cookie verification skipped" \ |
| 7650 | -C "received hello verify request" \ |
| 7651 | -S "hello verification requested" \ |
| 7652 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7653 | |
| 7654 | requires_ipv6 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7655 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7656 | run_test "DTLS cookie: enabled, IPv6" \ |
| 7657 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 7658 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 7659 | 0 \ |
| 7660 | -s "cookie verification failed" \ |
| 7661 | -s "cookie verification passed" \ |
| 7662 | -S "cookie verification skipped" \ |
| 7663 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7664 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7665 | -S "SSL - The requested feature is not available" |
| 7666 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7667 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7668 | run_test "DTLS cookie: enabled, nbio" \ |
| 7669 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 7670 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7671 | 0 \ |
| 7672 | -s "cookie verification failed" \ |
| 7673 | -s "cookie verification passed" \ |
| 7674 | -S "cookie verification skipped" \ |
| 7675 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7676 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7677 | -S "SSL - The requested feature is not available" |
| 7678 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7679 | # Tests for client reconnecting from the same port with DTLS |
| 7680 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7681 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7682 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7683 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7684 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 7685 | "$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] | 7686 | 0 \ |
| 7687 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7688 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7689 | -S "Client initiated reconnection from same port" |
| 7690 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7691 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7692 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7693 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7694 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 7695 | "$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] | 7696 | 0 \ |
| 7697 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7698 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7699 | -s "Client initiated reconnection from same port" |
| 7700 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7701 | 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] | 7702 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7703 | 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] | 7704 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 7705 | "$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] | 7706 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7707 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7708 | -s "Client initiated reconnection from same port" |
| 7709 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7710 | 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] | 7711 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7712 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 7713 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 7714 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 7715 | 0 \ |
| 7716 | -S "The operation timed out" \ |
| 7717 | -s "Client initiated reconnection from same port" |
| 7718 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7719 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7720 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 7721 | "$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] | 7722 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 7723 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7724 | -s "The operation timed out" \ |
| 7725 | -S "Client initiated reconnection from same port" |
| 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 | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 7728 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 7729 | -p "$P_PXY inject_clihlo=1" \ |
| 7730 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 7731 | "$P_CLI dtls=1 exchanges=2" \ |
| 7732 | 0 \ |
| 7733 | -s "possible client reconnect from the same port" \ |
| 7734 | -S "Client initiated reconnection from same port" |
| 7735 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7736 | # Tests for various cases of client authentication with DTLS |
| 7737 | # (focused on handshake flows and message parsing) |
| 7738 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7739 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7740 | run_test "DTLS client auth: required" \ |
| 7741 | "$P_SRV dtls=1 auth_mode=required" \ |
| 7742 | "$P_CLI dtls=1" \ |
| 7743 | 0 \ |
| 7744 | -s "Verifying peer X.509 certificate... ok" |
| 7745 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7746 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7747 | run_test "DTLS client auth: optional, client has no cert" \ |
| 7748 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 7749 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 7750 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7751 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7752 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7753 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7754 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7755 | "$P_SRV dtls=1 auth_mode=none" \ |
| 7756 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 7757 | 0 \ |
| 7758 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7759 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7760 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7761 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 7762 | run_test "DTLS wrong PSK: badmac alert" \ |
| 7763 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 7764 | "$P_CLI dtls=1 psk=abc124" \ |
| 7765 | 1 \ |
| 7766 | -s "SSL - Verification of the message MAC failed" \ |
| 7767 | -c "SSL - A fatal alert message was received from our peer" |
| 7768 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7769 | # Tests for receiving fragmented handshake messages with DTLS |
| 7770 | |
| 7771 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7772 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7773 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 7774 | "$G_SRV -u --mtu 2048 -a" \ |
| 7775 | "$P_CLI dtls=1 debug_level=2" \ |
| 7776 | 0 \ |
| 7777 | -C "found fragmented DTLS handshake message" \ |
| 7778 | -C "error" |
| 7779 | |
| 7780 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7781 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7782 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 7783 | "$G_SRV -u --mtu 512" \ |
| 7784 | "$P_CLI dtls=1 debug_level=2" \ |
| 7785 | 0 \ |
| 7786 | -c "found fragmented DTLS handshake message" \ |
| 7787 | -C "error" |
| 7788 | |
| 7789 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7790 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7791 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 7792 | "$G_SRV -u --mtu 128" \ |
| 7793 | "$P_CLI dtls=1 debug_level=2" \ |
| 7794 | 0 \ |
| 7795 | -c "found fragmented DTLS handshake message" \ |
| 7796 | -C "error" |
| 7797 | |
| 7798 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7799 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7800 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 7801 | "$G_SRV -u --mtu 128" \ |
| 7802 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7803 | 0 \ |
| 7804 | -c "found fragmented DTLS handshake message" \ |
| 7805 | -C "error" |
| 7806 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7807 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7808 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7809 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7810 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 7811 | "$G_SRV -u --mtu 256" \ |
| 7812 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 7813 | 0 \ |
| 7814 | -c "found fragmented DTLS handshake message" \ |
| 7815 | -c "client hello, adding renegotiation extension" \ |
| 7816 | -c "found renegotiation extension" \ |
| 7817 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7818 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7819 | -C "error" \ |
| 7820 | -s "Extra-header:" |
| 7821 | |
| 7822 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7823 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7824 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7825 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 7826 | "$G_SRV -u --mtu 256" \ |
| 7827 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 7828 | 0 \ |
| 7829 | -c "found fragmented DTLS handshake message" \ |
| 7830 | -c "client hello, adding renegotiation extension" \ |
| 7831 | -c "found renegotiation extension" \ |
| 7832 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7833 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7834 | -C "error" \ |
| 7835 | -s "Extra-header:" |
| 7836 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7837 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 7838 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 7839 | "$O_SRV -dtls -mtu 2048" \ |
| 7840 | "$P_CLI dtls=1 debug_level=2" \ |
| 7841 | 0 \ |
| 7842 | -C "found fragmented DTLS handshake message" \ |
| 7843 | -C "error" |
| 7844 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7845 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 7846 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 7847 | "$O_SRV -dtls -mtu 768" \ |
| 7848 | "$P_CLI dtls=1 debug_level=2" \ |
| 7849 | 0 \ |
| 7850 | -c "found fragmented DTLS handshake message" \ |
| 7851 | -C "error" |
| 7852 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7853 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 7854 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 7855 | "$O_SRV -dtls -mtu 256" \ |
| 7856 | "$P_CLI dtls=1 debug_level=2" \ |
| 7857 | 0 \ |
| 7858 | -c "found fragmented DTLS handshake message" \ |
| 7859 | -C "error" |
| 7860 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7861 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 7862 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 7863 | "$O_SRV -dtls -mtu 256" \ |
| 7864 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7865 | 0 \ |
| 7866 | -c "found fragmented DTLS handshake message" \ |
| 7867 | -C "error" |
| 7868 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7869 | # Tests for sending fragmented handshake messages with DTLS |
| 7870 | # |
| 7871 | # Use client auth when we need the client to send large messages, |
| 7872 | # and use large cert chains on both sides too (the long chains we have all use |
| 7873 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 7874 | # Sizes reached (UDP payload): |
| 7875 | # - 2037B for server certificate |
| 7876 | # - 1542B for client certificate |
| 7877 | # - 1013B for newsessionticket |
| 7878 | # - all others below 512B |
| 7879 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 7880 | |
| 7881 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7882 | requires_config_enabled MBEDTLS_RSA_C |
| 7883 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7884 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7885 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7886 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7887 | run_test "DTLS fragmenting: none (for reference)" \ |
| 7888 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7889 | crt_file=data_files/server7_int-ca.crt \ |
| 7890 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7891 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7892 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7893 | "$P_CLI dtls=1 debug_level=2 \ |
| 7894 | crt_file=data_files/server8_int-ca2.crt \ |
| 7895 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7896 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7897 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7898 | 0 \ |
| 7899 | -S "found fragmented DTLS handshake message" \ |
| 7900 | -C "found fragmented DTLS handshake message" \ |
| 7901 | -C "error" |
| 7902 | |
| 7903 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7904 | requires_config_enabled MBEDTLS_RSA_C |
| 7905 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7906 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7907 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7908 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7909 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7910 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7911 | crt_file=data_files/server7_int-ca.crt \ |
| 7912 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7913 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7914 | max_frag_len=1024" \ |
| 7915 | "$P_CLI dtls=1 debug_level=2 \ |
| 7916 | crt_file=data_files/server8_int-ca2.crt \ |
| 7917 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7918 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7919 | max_frag_len=2048" \ |
| 7920 | 0 \ |
| 7921 | -S "found fragmented DTLS handshake message" \ |
| 7922 | -c "found fragmented DTLS handshake message" \ |
| 7923 | -C "error" |
| 7924 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7925 | # With the MFL extension, the server has no way of forcing |
| 7926 | # the client to not exceed a certain MTU; hence, the following |
| 7927 | # test can't be replicated with an MTU proxy such as the one |
| 7928 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7929 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7930 | requires_config_enabled MBEDTLS_RSA_C |
| 7931 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7932 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7933 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7934 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7935 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7936 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7937 | crt_file=data_files/server7_int-ca.crt \ |
| 7938 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7939 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7940 | max_frag_len=512" \ |
| 7941 | "$P_CLI dtls=1 debug_level=2 \ |
| 7942 | crt_file=data_files/server8_int-ca2.crt \ |
| 7943 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7944 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7945 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7946 | 0 \ |
| 7947 | -S "found fragmented DTLS handshake message" \ |
| 7948 | -c "found fragmented DTLS handshake message" \ |
| 7949 | -C "error" |
| 7950 | |
| 7951 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7952 | requires_config_enabled MBEDTLS_RSA_C |
| 7953 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7954 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7955 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7956 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7957 | 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] | 7958 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 7959 | crt_file=data_files/server7_int-ca.crt \ |
| 7960 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7961 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7962 | max_frag_len=2048" \ |
| 7963 | "$P_CLI dtls=1 debug_level=2 \ |
| 7964 | crt_file=data_files/server8_int-ca2.crt \ |
| 7965 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7966 | hs_timeout=2500-60000 \ |
| 7967 | max_frag_len=1024" \ |
| 7968 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7969 | -S "found fragmented DTLS handshake message" \ |
| 7970 | -c "found fragmented DTLS handshake message" \ |
| 7971 | -C "error" |
| 7972 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7973 | # While not required by the standard defining the MFL extension |
| 7974 | # (according to which it only applies to records, not to datagrams), |
| 7975 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7976 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7977 | # to the peer. |
| 7978 | # The next test checks that no datagrams significantly larger than the |
| 7979 | # negotiated MFL are sent. |
| 7980 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7981 | requires_config_enabled MBEDTLS_RSA_C |
| 7982 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7983 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7984 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7985 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7986 | 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] | 7987 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7988 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 7989 | crt_file=data_files/server7_int-ca.crt \ |
| 7990 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7991 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7992 | max_frag_len=2048" \ |
| 7993 | "$P_CLI dtls=1 debug_level=2 \ |
| 7994 | crt_file=data_files/server8_int-ca2.crt \ |
| 7995 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7996 | hs_timeout=2500-60000 \ |
| 7997 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7998 | 0 \ |
| 7999 | -S "found fragmented DTLS handshake message" \ |
| 8000 | -c "found fragmented DTLS handshake message" \ |
| 8001 | -C "error" |
| 8002 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8003 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8004 | requires_config_enabled MBEDTLS_RSA_C |
| 8005 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8006 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8007 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8008 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8009 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8010 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8011 | crt_file=data_files/server7_int-ca.crt \ |
| 8012 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8013 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8014 | max_frag_len=2048" \ |
| 8015 | "$P_CLI dtls=1 debug_level=2 \ |
| 8016 | crt_file=data_files/server8_int-ca2.crt \ |
| 8017 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8018 | hs_timeout=2500-60000 \ |
| 8019 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8020 | 0 \ |
| 8021 | -s "found fragmented DTLS handshake message" \ |
| 8022 | -c "found fragmented DTLS handshake message" \ |
| 8023 | -C "error" |
| 8024 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8025 | # While not required by the standard defining the MFL extension |
| 8026 | # (according to which it only applies to records, not to datagrams), |
| 8027 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 8028 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 8029 | # to the peer. |
| 8030 | # The next test checks that no datagrams significantly larger than the |
| 8031 | # negotiated MFL are sent. |
| 8032 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8033 | requires_config_enabled MBEDTLS_RSA_C |
| 8034 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8035 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8036 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8037 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8038 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 8039 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8040 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8041 | crt_file=data_files/server7_int-ca.crt \ |
| 8042 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8043 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8044 | max_frag_len=2048" \ |
| 8045 | "$P_CLI dtls=1 debug_level=2 \ |
| 8046 | crt_file=data_files/server8_int-ca2.crt \ |
| 8047 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8048 | hs_timeout=2500-60000 \ |
| 8049 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8050 | 0 \ |
| 8051 | -s "found fragmented DTLS handshake message" \ |
| 8052 | -c "found fragmented DTLS handshake message" \ |
| 8053 | -C "error" |
| 8054 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8055 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8056 | requires_config_enabled MBEDTLS_RSA_C |
| 8057 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8058 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8059 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8060 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 8061 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8062 | crt_file=data_files/server7_int-ca.crt \ |
| 8063 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8064 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8065 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8066 | "$P_CLI dtls=1 debug_level=2 \ |
| 8067 | crt_file=data_files/server8_int-ca2.crt \ |
| 8068 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8069 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8070 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8071 | 0 \ |
| 8072 | -S "found fragmented DTLS handshake message" \ |
| 8073 | -C "found fragmented DTLS handshake message" \ |
| 8074 | -C "error" |
| 8075 | |
| 8076 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8077 | requires_config_enabled MBEDTLS_RSA_C |
| 8078 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8079 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8080 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8081 | run_test "DTLS fragmenting: client (MTU)" \ |
| 8082 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8083 | crt_file=data_files/server7_int-ca.crt \ |
| 8084 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8085 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8086 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8087 | "$P_CLI dtls=1 debug_level=2 \ |
| 8088 | crt_file=data_files/server8_int-ca2.crt \ |
| 8089 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8090 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8091 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8092 | 0 \ |
| 8093 | -s "found fragmented DTLS handshake message" \ |
| 8094 | -C "found fragmented DTLS handshake message" \ |
| 8095 | -C "error" |
| 8096 | |
| 8097 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8098 | requires_config_enabled MBEDTLS_RSA_C |
| 8099 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8100 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8101 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8102 | run_test "DTLS fragmenting: server (MTU)" \ |
| 8103 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8104 | crt_file=data_files/server7_int-ca.crt \ |
| 8105 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8106 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8107 | mtu=512" \ |
| 8108 | "$P_CLI dtls=1 debug_level=2 \ |
| 8109 | crt_file=data_files/server8_int-ca2.crt \ |
| 8110 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8111 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8112 | mtu=2048" \ |
| 8113 | 0 \ |
| 8114 | -S "found fragmented DTLS handshake message" \ |
| 8115 | -c "found fragmented DTLS handshake message" \ |
| 8116 | -C "error" |
| 8117 | |
| 8118 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8119 | requires_config_enabled MBEDTLS_RSA_C |
| 8120 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8121 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8122 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8123 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8124 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8125 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8126 | crt_file=data_files/server7_int-ca.crt \ |
| 8127 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8128 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 8129 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8130 | "$P_CLI dtls=1 debug_level=2 \ |
| 8131 | crt_file=data_files/server8_int-ca2.crt \ |
| 8132 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8133 | hs_timeout=2500-60000 \ |
| 8134 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8135 | 0 \ |
| 8136 | -s "found fragmented DTLS handshake message" \ |
| 8137 | -c "found fragmented DTLS handshake message" \ |
| 8138 | -C "error" |
| 8139 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8140 | # 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] | 8141 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8142 | requires_config_enabled MBEDTLS_RSA_C |
| 8143 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8144 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8145 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8146 | requires_config_enabled MBEDTLS_AES_C |
| 8147 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8148 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8149 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8150 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 8151 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 8152 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8153 | crt_file=data_files/server7_int-ca.crt \ |
| 8154 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8155 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 8156 | mtu=512" \ |
| 8157 | "$P_CLI dtls=1 debug_level=2 \ |
| 8158 | crt_file=data_files/server8_int-ca2.crt \ |
| 8159 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8160 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8161 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8162 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8163 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8164 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8165 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8166 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8167 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8168 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8169 | # 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] | 8170 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 8171 | # retransmissions, but in some cases (like both the server and client using |
| 8172 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 8173 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 8174 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8175 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8176 | requires_config_enabled MBEDTLS_RSA_C |
| 8177 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8178 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8179 | requires_config_enabled MBEDTLS_AES_C |
| 8180 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8181 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8182 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 8183 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8184 | -p "$P_PXY mtu=508" \ |
| 8185 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8186 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8187 | key_file=data_files/server7.key \ |
| 8188 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8189 | "$P_CLI dtls=1 debug_level=2 \ |
| 8190 | crt_file=data_files/server8_int-ca2.crt \ |
| 8191 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8192 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8193 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8194 | 0 \ |
| 8195 | -s "found fragmented DTLS handshake message" \ |
| 8196 | -c "found fragmented DTLS handshake message" \ |
| 8197 | -C "error" |
| 8198 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8199 | # 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] | 8200 | only_with_valgrind |
| 8201 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8202 | requires_config_enabled MBEDTLS_RSA_C |
| 8203 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8204 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8205 | requires_config_enabled MBEDTLS_AES_C |
| 8206 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8207 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8208 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 8209 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8210 | -p "$P_PXY mtu=508" \ |
| 8211 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8212 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8213 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8214 | hs_timeout=250-10000" \ |
| 8215 | "$P_CLI dtls=1 debug_level=2 \ |
| 8216 | crt_file=data_files/server8_int-ca2.crt \ |
| 8217 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8218 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8219 | hs_timeout=250-10000" \ |
| 8220 | 0 \ |
| 8221 | -s "found fragmented DTLS handshake message" \ |
| 8222 | -c "found fragmented DTLS handshake message" \ |
| 8223 | -C "error" |
| 8224 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8225 | # 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] | 8226 | # OTOH the client might resend if the server is to slow to reset after sending |
| 8227 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8228 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8229 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8230 | requires_config_enabled MBEDTLS_RSA_C |
| 8231 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8232 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8233 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8234 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8235 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8236 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8237 | crt_file=data_files/server7_int-ca.crt \ |
| 8238 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8239 | hs_timeout=10000-60000 \ |
| 8240 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8241 | "$P_CLI dtls=1 debug_level=2 \ |
| 8242 | crt_file=data_files/server8_int-ca2.crt \ |
| 8243 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8244 | hs_timeout=10000-60000 \ |
| 8245 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8246 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8247 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8248 | -s "found fragmented DTLS handshake message" \ |
| 8249 | -c "found fragmented DTLS handshake message" \ |
| 8250 | -C "error" |
| 8251 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8252 | # 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] | 8253 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 8254 | # OTOH the client might resend if the server is to slow to reset after sending |
| 8255 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8256 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8257 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8258 | requires_config_enabled MBEDTLS_RSA_C |
| 8259 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8260 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8261 | requires_config_enabled MBEDTLS_AES_C |
| 8262 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8263 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8264 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8265 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8266 | -p "$P_PXY mtu=512" \ |
| 8267 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8268 | crt_file=data_files/server7_int-ca.crt \ |
| 8269 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8270 | hs_timeout=10000-60000 \ |
| 8271 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8272 | "$P_CLI dtls=1 debug_level=2 \ |
| 8273 | crt_file=data_files/server8_int-ca2.crt \ |
| 8274 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8275 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8276 | hs_timeout=10000-60000 \ |
| 8277 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8278 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8279 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8280 | -s "found fragmented DTLS handshake message" \ |
| 8281 | -c "found fragmented DTLS handshake message" \ |
| 8282 | -C "error" |
| 8283 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8284 | not_with_valgrind # spurious autoreduction due to timeout |
| 8285 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8286 | requires_config_enabled MBEDTLS_RSA_C |
| 8287 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8288 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8289 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8290 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8291 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8292 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8293 | crt_file=data_files/server7_int-ca.crt \ |
| 8294 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8295 | hs_timeout=10000-60000 \ |
| 8296 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8297 | "$P_CLI dtls=1 debug_level=2 \ |
| 8298 | crt_file=data_files/server8_int-ca2.crt \ |
| 8299 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8300 | hs_timeout=10000-60000 \ |
| 8301 | mtu=1024 nbio=2" \ |
| 8302 | 0 \ |
| 8303 | -S "autoreduction" \ |
| 8304 | -s "found fragmented DTLS handshake message" \ |
| 8305 | -c "found fragmented DTLS handshake message" \ |
| 8306 | -C "error" |
| 8307 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8308 | # 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] | 8309 | not_with_valgrind # spurious autoreduction due to timeout |
| 8310 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8311 | requires_config_enabled MBEDTLS_RSA_C |
| 8312 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8313 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8314 | requires_config_enabled MBEDTLS_AES_C |
| 8315 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8316 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8317 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8318 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 8319 | -p "$P_PXY mtu=512" \ |
| 8320 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8321 | crt_file=data_files/server7_int-ca.crt \ |
| 8322 | key_file=data_files/server7.key \ |
| 8323 | hs_timeout=10000-60000 \ |
| 8324 | mtu=512 nbio=2" \ |
| 8325 | "$P_CLI dtls=1 debug_level=2 \ |
| 8326 | crt_file=data_files/server8_int-ca2.crt \ |
| 8327 | key_file=data_files/server8.key \ |
| 8328 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8329 | hs_timeout=10000-60000 \ |
| 8330 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8331 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8332 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8333 | -s "found fragmented DTLS handshake message" \ |
| 8334 | -c "found fragmented DTLS handshake message" \ |
| 8335 | -C "error" |
| 8336 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8337 | # 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] | 8338 | # This ensures things still work after session_reset(). |
| 8339 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8340 | # Since we don't support reading fragmented ClientHello yet, |
| 8341 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 8342 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8343 | # An autoreduction on the client-side might happen if the server is |
| 8344 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 8345 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8346 | # resumed listening, which would result in a spurious autoreduction. |
| 8347 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8348 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8349 | requires_config_enabled MBEDTLS_RSA_C |
| 8350 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8351 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8352 | requires_config_enabled MBEDTLS_AES_C |
| 8353 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8354 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8355 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8356 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 8357 | -p "$P_PXY mtu=1450" \ |
| 8358 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8359 | crt_file=data_files/server7_int-ca.crt \ |
| 8360 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8361 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8362 | mtu=1450" \ |
| 8363 | "$P_CLI dtls=1 debug_level=2 \ |
| 8364 | crt_file=data_files/server8_int-ca2.crt \ |
| 8365 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8366 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8367 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 8368 | 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] | 8369 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8370 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8371 | -s "found fragmented DTLS handshake message" \ |
| 8372 | -c "found fragmented DTLS handshake message" \ |
| 8373 | -C "error" |
| 8374 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8375 | # An autoreduction on the client-side might happen if the server is |
| 8376 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8377 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8378 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8379 | requires_config_enabled MBEDTLS_RSA_C |
| 8380 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8381 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8382 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8383 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8384 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8385 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8386 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8387 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 8388 | -p "$P_PXY mtu=512" \ |
| 8389 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8390 | crt_file=data_files/server7_int-ca.crt \ |
| 8391 | key_file=data_files/server7.key \ |
| 8392 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8393 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8394 | mtu=512" \ |
| 8395 | "$P_CLI dtls=1 debug_level=2 \ |
| 8396 | crt_file=data_files/server8_int-ca2.crt \ |
| 8397 | key_file=data_files/server8.key \ |
| 8398 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8399 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8400 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8401 | mtu=512" \ |
| 8402 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8403 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8404 | -s "found fragmented DTLS handshake message" \ |
| 8405 | -c "found fragmented DTLS handshake message" \ |
| 8406 | -C "error" |
| 8407 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8408 | # An autoreduction on the client-side might happen if the server is |
| 8409 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8410 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8411 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8412 | requires_config_enabled MBEDTLS_RSA_C |
| 8413 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8414 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8415 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8416 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8417 | requires_config_enabled MBEDTLS_AES_C |
| 8418 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8419 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8420 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8421 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 8422 | -p "$P_PXY mtu=512" \ |
| 8423 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8424 | crt_file=data_files/server7_int-ca.crt \ |
| 8425 | key_file=data_files/server7.key \ |
| 8426 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8427 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8428 | mtu=512" \ |
| 8429 | "$P_CLI dtls=1 debug_level=2 \ |
| 8430 | crt_file=data_files/server8_int-ca2.crt \ |
| 8431 | key_file=data_files/server8.key \ |
| 8432 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8433 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8434 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8435 | mtu=512" \ |
| 8436 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8437 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8438 | -s "found fragmented DTLS handshake message" \ |
| 8439 | -c "found fragmented DTLS handshake message" \ |
| 8440 | -C "error" |
| 8441 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8442 | # An autoreduction on the client-side might happen if the server is |
| 8443 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8444 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8445 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8446 | requires_config_enabled MBEDTLS_RSA_C |
| 8447 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8448 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8449 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8450 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8451 | requires_config_enabled MBEDTLS_AES_C |
| 8452 | requires_config_enabled MBEDTLS_CCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8453 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8454 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8455 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8456 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8457 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8458 | crt_file=data_files/server7_int-ca.crt \ |
| 8459 | key_file=data_files/server7.key \ |
| 8460 | exchanges=2 renegotiation=1 \ |
| 8461 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8462 | hs_timeout=10000-60000 \ |
| 8463 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8464 | "$P_CLI dtls=1 debug_level=2 \ |
| 8465 | crt_file=data_files/server8_int-ca2.crt \ |
| 8466 | key_file=data_files/server8.key \ |
| 8467 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8468 | hs_timeout=10000-60000 \ |
| 8469 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8470 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8471 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8472 | -s "found fragmented DTLS handshake message" \ |
| 8473 | -c "found fragmented DTLS handshake message" \ |
| 8474 | -C "error" |
| 8475 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8476 | # An autoreduction on the client-side might happen if the server is |
| 8477 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8478 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8479 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8480 | requires_config_enabled MBEDTLS_RSA_C |
| 8481 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8482 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8483 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8484 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8485 | requires_config_enabled MBEDTLS_AES_C |
| 8486 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8487 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8488 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8489 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8490 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8491 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8492 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8493 | crt_file=data_files/server7_int-ca.crt \ |
| 8494 | key_file=data_files/server7.key \ |
| 8495 | exchanges=2 renegotiation=1 \ |
| 8496 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8497 | hs_timeout=10000-60000 \ |
| 8498 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8499 | "$P_CLI dtls=1 debug_level=2 \ |
| 8500 | crt_file=data_files/server8_int-ca2.crt \ |
| 8501 | key_file=data_files/server8.key \ |
| 8502 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8503 | hs_timeout=10000-60000 \ |
| 8504 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8505 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8506 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8507 | -s "found fragmented DTLS handshake message" \ |
| 8508 | -c "found fragmented DTLS handshake message" \ |
| 8509 | -C "error" |
| 8510 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8511 | # An autoreduction on the client-side might happen if the server is |
| 8512 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8513 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8514 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8515 | requires_config_enabled MBEDTLS_RSA_C |
| 8516 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8517 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8518 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8519 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8520 | requires_config_enabled MBEDTLS_AES_C |
| 8521 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8522 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8523 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8524 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8525 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8526 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8527 | crt_file=data_files/server7_int-ca.crt \ |
| 8528 | key_file=data_files/server7.key \ |
| 8529 | exchanges=2 renegotiation=1 \ |
| 8530 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8531 | hs_timeout=10000-60000 \ |
| 8532 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8533 | "$P_CLI dtls=1 debug_level=2 \ |
| 8534 | crt_file=data_files/server8_int-ca2.crt \ |
| 8535 | key_file=data_files/server8.key \ |
| 8536 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8537 | hs_timeout=10000-60000 \ |
| 8538 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8539 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8540 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8541 | -s "found fragmented DTLS handshake message" \ |
| 8542 | -c "found fragmented DTLS handshake message" \ |
| 8543 | -C "error" |
| 8544 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8545 | # 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] | 8546 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8547 | requires_config_enabled MBEDTLS_RSA_C |
| 8548 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8549 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8550 | requires_config_enabled MBEDTLS_AES_C |
| 8551 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8552 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8553 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8554 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8555 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 8556 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8557 | "$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] | 8558 | crt_file=data_files/server7_int-ca.crt \ |
| 8559 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8560 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8561 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8562 | crt_file=data_files/server8_int-ca2.crt \ |
| 8563 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8564 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8565 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8566 | 0 \ |
| 8567 | -s "found fragmented DTLS handshake message" \ |
| 8568 | -c "found fragmented DTLS handshake message" \ |
| 8569 | -C "error" |
| 8570 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8571 | # 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] | 8572 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8573 | requires_config_enabled MBEDTLS_RSA_C |
| 8574 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8575 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8576 | requires_config_enabled MBEDTLS_AES_C |
| 8577 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8578 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8579 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8580 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8581 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 8582 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 8583 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8584 | crt_file=data_files/server7_int-ca.crt \ |
| 8585 | key_file=data_files/server7.key \ |
| 8586 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 8587 | "$P_CLI dtls=1 debug_level=2 \ |
| 8588 | crt_file=data_files/server8_int-ca2.crt \ |
| 8589 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8590 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8591 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 8592 | 0 \ |
| 8593 | -s "found fragmented DTLS handshake message" \ |
| 8594 | -c "found fragmented DTLS handshake message" \ |
| 8595 | -C "error" |
| 8596 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8597 | # interop tests for DTLS fragmentating with reliable connection |
| 8598 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8599 | # here and below we just want to test that the we fragment in a way that |
| 8600 | # pleases other implementations, so we don't need the peer to fragment |
| 8601 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8602 | requires_config_enabled MBEDTLS_RSA_C |
| 8603 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8604 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8605 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8606 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 8607 | "$G_SRV -u" \ |
| 8608 | "$P_CLI dtls=1 debug_level=2 \ |
| 8609 | crt_file=data_files/server8_int-ca2.crt \ |
| 8610 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8611 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8612 | 0 \ |
| 8613 | -c "fragmenting handshake message" \ |
| 8614 | -C "error" |
| 8615 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 8616 | # We use --insecure for the GnuTLS client because it expects |
| 8617 | # the hostname / IP it connects to to be the name used in the |
| 8618 | # certificate obtained from the server. Here, however, it |
| 8619 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 8620 | # as the server name in the certificate. This will make the |
| 8621 | # certifiate validation fail, but passing --insecure makes |
| 8622 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8623 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8624 | requires_config_enabled MBEDTLS_RSA_C |
| 8625 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8626 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 8627 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8628 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8629 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8630 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8631 | crt_file=data_files/server7_int-ca.crt \ |
| 8632 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8633 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8634 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8635 | 0 \ |
| 8636 | -s "fragmenting handshake message" |
| 8637 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8638 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8639 | requires_config_enabled MBEDTLS_RSA_C |
| 8640 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8641 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8642 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 8643 | "$O_SRV -dtls1_2 -verify 10" \ |
| 8644 | "$P_CLI dtls=1 debug_level=2 \ |
| 8645 | crt_file=data_files/server8_int-ca2.crt \ |
| 8646 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8647 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8648 | 0 \ |
| 8649 | -c "fragmenting handshake message" \ |
| 8650 | -C "error" |
| 8651 | |
| 8652 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8653 | requires_config_enabled MBEDTLS_RSA_C |
| 8654 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8655 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8656 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 8657 | "$P_SRV dtls=1 debug_level=2 \ |
| 8658 | crt_file=data_files/server7_int-ca.crt \ |
| 8659 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8660 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8661 | "$O_CLI -dtls1_2" \ |
| 8662 | 0 \ |
| 8663 | -s "fragmenting handshake message" |
| 8664 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8665 | # interop tests for DTLS fragmentating with unreliable connection |
| 8666 | # |
| 8667 | # again we just want to test that the we fragment in a way that |
| 8668 | # pleases other implementations, so we don't need the peer to fragment |
| 8669 | requires_gnutls_next |
| 8670 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8671 | requires_config_enabled MBEDTLS_RSA_C |
| 8672 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8673 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8674 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8675 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 8676 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8677 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8678 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8679 | crt_file=data_files/server8_int-ca2.crt \ |
| 8680 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8681 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8682 | 0 \ |
| 8683 | -c "fragmenting handshake message" \ |
| 8684 | -C "error" |
| 8685 | |
| 8686 | requires_gnutls_next |
| 8687 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8688 | requires_config_enabled MBEDTLS_RSA_C |
| 8689 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8690 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8691 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8692 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 8693 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8694 | "$P_SRV dtls=1 debug_level=2 \ |
| 8695 | crt_file=data_files/server7_int-ca.crt \ |
| 8696 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8697 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8698 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8699 | 0 \ |
| 8700 | -s "fragmenting handshake message" |
| 8701 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8702 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 8703 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8704 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8705 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8706 | ## (this should happen in some 1.1.1_ release according to the ticket). |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8707 | skip_next_test |
| 8708 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8709 | requires_config_enabled MBEDTLS_RSA_C |
| 8710 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8711 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8712 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8713 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 8714 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8715 | "$O_SRV -dtls1_2 -verify 10" \ |
| 8716 | "$P_CLI dtls=1 debug_level=2 \ |
| 8717 | crt_file=data_files/server8_int-ca2.crt \ |
| 8718 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8719 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8720 | 0 \ |
| 8721 | -c "fragmenting handshake message" \ |
| 8722 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8723 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8724 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8725 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8726 | requires_config_enabled MBEDTLS_RSA_C |
| 8727 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8728 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8729 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8730 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 8731 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8732 | "$P_SRV dtls=1 debug_level=2 \ |
| 8733 | crt_file=data_files/server7_int-ca.crt \ |
| 8734 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8735 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8736 | "$O_CLI -dtls1_2" \ |
| 8737 | 0 \ |
| 8738 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8739 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8740 | # Tests for DTLS-SRTP (RFC 5764) |
| 8741 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8742 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8743 | run_test "DTLS-SRTP all profiles supported" \ |
| 8744 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8745 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8746 | 0 \ |
| 8747 | -s "found use_srtp extension" \ |
| 8748 | -s "found srtp profile" \ |
| 8749 | -s "selected srtp profile" \ |
| 8750 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8751 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8752 | -c "client hello, adding use_srtp extension" \ |
| 8753 | -c "found use_srtp extension" \ |
| 8754 | -c "found srtp profile" \ |
| 8755 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8756 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8757 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8758 | -C "error" |
| 8759 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8760 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8761 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8762 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8763 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 8764 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8765 | "$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] | 8766 | 0 \ |
| 8767 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8768 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 8769 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8770 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8771 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8772 | -c "client hello, adding use_srtp extension" \ |
| 8773 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8774 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8775 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8776 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8777 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8778 | -C "error" |
| 8779 | |
| 8780 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8781 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8782 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8783 | "$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] | 8784 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8785 | 0 \ |
| 8786 | -s "found use_srtp extension" \ |
| 8787 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8788 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8789 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8790 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8791 | -c "client hello, adding use_srtp extension" \ |
| 8792 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8793 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8794 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8795 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8796 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8797 | -C "error" |
| 8798 | |
| 8799 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8800 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8801 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 8802 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8803 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8804 | 0 \ |
| 8805 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8806 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8807 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8808 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8809 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8810 | -c "client hello, adding use_srtp extension" \ |
| 8811 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8812 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8813 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8814 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8815 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8816 | -C "error" |
| 8817 | |
| 8818 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8819 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8820 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 8821 | "$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] | 8822 | "$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] | 8823 | 0 \ |
| 8824 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8825 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8826 | -S "selected srtp profile" \ |
| 8827 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8828 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8829 | -c "client hello, adding use_srtp extension" \ |
| 8830 | -C "found use_srtp extension" \ |
| 8831 | -C "found srtp profile" \ |
| 8832 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8833 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8834 | -C "error" |
| 8835 | |
| 8836 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8837 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8838 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 8839 | "$P_SRV dtls=1 debug_level=3" \ |
| 8840 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8841 | 0 \ |
| 8842 | -s "found use_srtp extension" \ |
| 8843 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8844 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8845 | -c "client hello, adding use_srtp extension" \ |
| 8846 | -C "found use_srtp extension" \ |
| 8847 | -C "found srtp profile" \ |
| 8848 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8849 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8850 | -C "error" |
| 8851 | |
| 8852 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8853 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8854 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 8855 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 8856 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8857 | 0 \ |
| 8858 | -s "found use_srtp extension" \ |
| 8859 | -s "found srtp profile" \ |
| 8860 | -s "selected srtp profile" \ |
| 8861 | -s "server hello, adding use_srtp extension" \ |
| 8862 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8863 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8864 | -c "client hello, adding use_srtp extension" \ |
| 8865 | -c "found use_srtp extension" \ |
| 8866 | -c "found srtp profile" \ |
| 8867 | -c "selected srtp profile" \ |
| 8868 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8869 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8870 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8871 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 8872 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8873 | -C "error" |
| 8874 | |
| 8875 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8876 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8877 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 8878 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8879 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8880 | 0 \ |
| 8881 | -s "found use_srtp extension" \ |
| 8882 | -s "found srtp profile" \ |
| 8883 | -s "selected srtp profile" \ |
| 8884 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8885 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 8886 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8887 | -S "dumping 'using mki' (8 bytes)" \ |
| 8888 | -c "client hello, adding use_srtp extension" \ |
| 8889 | -c "found use_srtp extension" \ |
| 8890 | -c "found srtp profile" \ |
| 8891 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8892 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 8893 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8894 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8895 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8896 | -C "dumping 'received mki' (8 bytes)" \ |
| 8897 | -C "error" |
| 8898 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8899 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8900 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8901 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 8902 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8903 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8904 | 0 \ |
| 8905 | -s "found use_srtp extension" \ |
| 8906 | -s "found srtp profile" \ |
| 8907 | -s "selected srtp profile" \ |
| 8908 | -s "server hello, adding use_srtp extension" \ |
| 8909 | -s "DTLS-SRTP key material is"\ |
| 8910 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 8911 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 8912 | |
| 8913 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8914 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8915 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 8916 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8917 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8918 | 0 \ |
| 8919 | -s "found use_srtp extension" \ |
| 8920 | -s "found srtp profile" \ |
| 8921 | -s "selected srtp profile" \ |
| 8922 | -s "server hello, adding use_srtp extension" \ |
| 8923 | -s "DTLS-SRTP key material is"\ |
| 8924 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 8925 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8926 | |
| 8927 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8928 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8929 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 8930 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8931 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8932 | 0 \ |
| 8933 | -s "found use_srtp extension" \ |
| 8934 | -s "found srtp profile" \ |
| 8935 | -s "selected srtp profile" \ |
| 8936 | -s "server hello, adding use_srtp extension" \ |
| 8937 | -s "DTLS-SRTP key material is"\ |
| 8938 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 8939 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8940 | |
| 8941 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
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-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 8944 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8945 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8946 | 0 \ |
| 8947 | -s "found use_srtp extension" \ |
| 8948 | -s "found srtp profile" \ |
| 8949 | -s "selected srtp profile" \ |
| 8950 | -s "server hello, adding use_srtp extension" \ |
| 8951 | -s "DTLS-SRTP key material is"\ |
| 8952 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 8953 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8954 | |
| 8955 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8956 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8957 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 8958 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8959 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8960 | 0 \ |
| 8961 | -s "found use_srtp extension" \ |
| 8962 | -s "found srtp profile" \ |
| 8963 | -s "selected srtp profile" \ |
| 8964 | -s "server hello, adding use_srtp extension" \ |
| 8965 | -s "DTLS-SRTP key material is"\ |
| 8966 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 8967 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8968 | |
| 8969 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8970 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8971 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 8972 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 8973 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8974 | 0 \ |
| 8975 | -s "found use_srtp extension" \ |
| 8976 | -s "found srtp profile" \ |
| 8977 | -S "selected srtp profile" \ |
| 8978 | -S "server hello, adding use_srtp extension" \ |
| 8979 | -S "DTLS-SRTP key material is"\ |
| 8980 | -C "SRTP Extension negotiated, profile" |
| 8981 | |
| 8982 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8983 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8984 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 8985 | "$P_SRV dtls=1 debug_level=3" \ |
| 8986 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8987 | 0 \ |
| 8988 | -s "found use_srtp extension" \ |
| 8989 | -S "server hello, adding use_srtp extension" \ |
| 8990 | -S "DTLS-SRTP key material is"\ |
| 8991 | -C "SRTP Extension negotiated, profile" |
| 8992 | |
| 8993 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8994 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8995 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 8996 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8997 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8998 | 0 \ |
| 8999 | -c "client hello, adding use_srtp extension" \ |
| 9000 | -c "found use_srtp extension" \ |
| 9001 | -c "found srtp profile" \ |
| 9002 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 9003 | -c "DTLS-SRTP key material is"\ |
| 9004 | -C "error" |
| 9005 | |
| 9006 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9007 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9008 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 9009 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 9010 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9011 | 0 \ |
| 9012 | -c "client hello, adding use_srtp extension" \ |
| 9013 | -c "found use_srtp extension" \ |
| 9014 | -c "found srtp profile" \ |
| 9015 | -c "selected srtp profile" \ |
| 9016 | -c "DTLS-SRTP key material is"\ |
| 9017 | -C "error" |
| 9018 | |
| 9019 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9020 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9021 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 9022 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 9023 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9024 | 0 \ |
| 9025 | -c "client hello, adding use_srtp extension" \ |
| 9026 | -c "found use_srtp extension" \ |
| 9027 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9028 | -c "selected srtp profile" \ |
| 9029 | -c "DTLS-SRTP key material is"\ |
| 9030 | -C "error" |
| 9031 | |
| 9032 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9033 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9034 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 9035 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 9036 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9037 | 0 \ |
| 9038 | -c "client hello, adding use_srtp extension" \ |
| 9039 | -c "found use_srtp extension" \ |
| 9040 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9041 | -c "selected srtp profile" \ |
| 9042 | -c "DTLS-SRTP key material is"\ |
| 9043 | -C "error" |
| 9044 | |
| 9045 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9046 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9047 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 9048 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 9049 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9050 | 0 \ |
| 9051 | -c "client hello, adding use_srtp extension" \ |
| 9052 | -c "found use_srtp extension" \ |
| 9053 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9054 | -c "selected srtp profile" \ |
| 9055 | -c "DTLS-SRTP key material is"\ |
| 9056 | -C "error" |
| 9057 | |
| 9058 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9059 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9060 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 9061 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 9062 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 9063 | 0 \ |
| 9064 | -c "client hello, adding use_srtp extension" \ |
| 9065 | -C "found use_srtp extension" \ |
| 9066 | -C "found srtp profile" \ |
| 9067 | -C "selected srtp profile" \ |
| 9068 | -C "DTLS-SRTP key material is"\ |
| 9069 | -C "error" |
| 9070 | |
| 9071 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9072 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9073 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 9074 | "$O_SRV -dtls" \ |
| 9075 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9076 | 0 \ |
| 9077 | -c "client hello, adding use_srtp extension" \ |
| 9078 | -C "found use_srtp extension" \ |
| 9079 | -C "found srtp profile" \ |
| 9080 | -C "selected srtp profile" \ |
| 9081 | -C "DTLS-SRTP key material is"\ |
| 9082 | -C "error" |
| 9083 | |
| 9084 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9085 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9086 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 9087 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 9088 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9089 | 0 \ |
| 9090 | -c "client hello, adding use_srtp extension" \ |
| 9091 | -c "found use_srtp extension" \ |
| 9092 | -c "found srtp profile" \ |
| 9093 | -c "selected srtp profile" \ |
| 9094 | -c "DTLS-SRTP key material is"\ |
| 9095 | -c "DTLS-SRTP no mki value negotiated"\ |
| 9096 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9097 | -C "dumping 'received mki' (8 bytes)" \ |
| 9098 | -C "error" |
| 9099 | |
| 9100 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9101 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9102 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9103 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9104 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9105 | "$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] | 9106 | 0 \ |
| 9107 | -s "found use_srtp extension" \ |
| 9108 | -s "found srtp profile" \ |
| 9109 | -s "selected srtp profile" \ |
| 9110 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9111 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9112 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 9113 | |
| 9114 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9115 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9116 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9117 | 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] | 9118 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9119 | "$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] | 9120 | 0 \ |
| 9121 | -s "found use_srtp extension" \ |
| 9122 | -s "found srtp profile" \ |
| 9123 | -s "selected srtp profile" \ |
| 9124 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9125 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9126 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 9127 | |
| 9128 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9129 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9130 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9131 | 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] | 9132 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9133 | "$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] | 9134 | 0 \ |
| 9135 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9136 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9137 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9138 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9139 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9140 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 9141 | |
| 9142 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9143 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9144 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9145 | 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] | 9146 | "$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] | 9147 | "$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] | 9148 | 0 \ |
| 9149 | -s "found use_srtp extension" \ |
| 9150 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9151 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9152 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9153 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9154 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 9155 | |
| 9156 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9157 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9158 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9159 | 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] | 9160 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9161 | "$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] | 9162 | 0 \ |
| 9163 | -s "found use_srtp extension" \ |
| 9164 | -s "found srtp profile" \ |
| 9165 | -s "selected srtp profile" \ |
| 9166 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9167 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9168 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 9169 | |
| 9170 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9171 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9172 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9173 | 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] | 9174 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 9175 | "$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] | 9176 | 0 \ |
| 9177 | -s "found use_srtp extension" \ |
| 9178 | -s "found srtp profile" \ |
| 9179 | -S "selected srtp profile" \ |
| 9180 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9181 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9182 | -C "SRTP profile:" |
| 9183 | |
| 9184 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9185 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9186 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9187 | 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] | 9188 | "$P_SRV dtls=1 debug_level=3" \ |
| 9189 | "$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] | 9190 | 0 \ |
| 9191 | -s "found use_srtp extension" \ |
| 9192 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9193 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9194 | -C "SRTP profile:" |
| 9195 | |
| 9196 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9197 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9198 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9199 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 9200 | "$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" \ |
| 9201 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9202 | 0 \ |
| 9203 | -c "client hello, adding use_srtp extension" \ |
| 9204 | -c "found use_srtp extension" \ |
| 9205 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9206 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9207 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9208 | -C "error" |
| 9209 | |
| 9210 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9211 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9212 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9213 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 9214 | "$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" \ |
| 9215 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9216 | 0 \ |
| 9217 | -c "client hello, adding use_srtp extension" \ |
| 9218 | -c "found use_srtp extension" \ |
| 9219 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9220 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9221 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9222 | -C "error" |
| 9223 | |
| 9224 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9225 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9226 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9227 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 9228 | "$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" \ |
| 9229 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9230 | 0 \ |
| 9231 | -c "client hello, adding use_srtp extension" \ |
| 9232 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9233 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9234 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9235 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9236 | -C "error" |
| 9237 | |
| 9238 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9239 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9240 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9241 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 9242 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9243 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9244 | 0 \ |
| 9245 | -c "client hello, adding use_srtp extension" \ |
| 9246 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9247 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9248 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9249 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9250 | -C "error" |
| 9251 | |
| 9252 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9253 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9254 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9255 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 9256 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9257 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9258 | 0 \ |
| 9259 | -c "client hello, adding use_srtp extension" \ |
| 9260 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9261 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9262 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9263 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9264 | -C "error" |
| 9265 | |
| 9266 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9267 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9268 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9269 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 9270 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9271 | "$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] | 9272 | 0 \ |
| 9273 | -c "client hello, adding use_srtp extension" \ |
| 9274 | -C "found use_srtp extension" \ |
| 9275 | -C "found srtp profile" \ |
| 9276 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9277 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9278 | -C "error" |
| 9279 | |
| 9280 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9281 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9282 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9283 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 9284 | "$G_SRV -u" \ |
| 9285 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9286 | 0 \ |
| 9287 | -c "client hello, adding use_srtp extension" \ |
| 9288 | -C "found use_srtp extension" \ |
| 9289 | -C "found srtp profile" \ |
| 9290 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9291 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9292 | -C "error" |
| 9293 | |
| 9294 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9295 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9296 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9297 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 9298 | "$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" \ |
| 9299 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9300 | 0 \ |
| 9301 | -c "client hello, adding use_srtp extension" \ |
| 9302 | -c "found use_srtp extension" \ |
| 9303 | -c "found srtp profile" \ |
| 9304 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9305 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 9306 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9307 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9308 | -c "dumping 'received mki' (8 bytes)" \ |
| 9309 | -C "error" |
| 9310 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 9311 | # Tests for specific things with "unreliable" UDP connection |
| 9312 | |
| 9313 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9314 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 9315 | run_test "DTLS proxy: reference" \ |
| 9316 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9317 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 9318 | "$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] | 9319 | 0 \ |
| 9320 | -C "replayed record" \ |
| 9321 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 9322 | -C "Buffer record from epoch" \ |
| 9323 | -S "Buffer record from epoch" \ |
| 9324 | -C "ssl_buffer_message" \ |
| 9325 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 9326 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9327 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 9328 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9329 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 9330 | -c "HTTP/1.0 200 OK" |
| 9331 | |
| 9332 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9333 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9334 | run_test "DTLS proxy: duplicate every packet" \ |
| 9335 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9336 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 9337 | "$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] | 9338 | 0 \ |
| 9339 | -c "replayed record" \ |
| 9340 | -s "replayed record" \ |
| 9341 | -c "record from another epoch" \ |
| 9342 | -s "record from another epoch" \ |
| 9343 | -S "resend" \ |
| 9344 | -s "Extra-header:" \ |
| 9345 | -c "HTTP/1.0 200 OK" |
| 9346 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9347 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9348 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 9349 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9350 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 9351 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9352 | 0 \ |
| 9353 | -c "replayed record" \ |
| 9354 | -S "replayed record" \ |
| 9355 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9356 | -s "record from another epoch" \ |
| 9357 | -c "resend" \ |
| 9358 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9359 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9360 | -c "HTTP/1.0 200 OK" |
| 9361 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9362 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9363 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 9364 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9365 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 9366 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9367 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9368 | -c "next record in same datagram" \ |
| 9369 | -s "next record in same datagram" |
| 9370 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9371 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9372 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 9373 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9374 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 9375 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9376 | 0 \ |
| 9377 | -c "next record in same datagram" \ |
| 9378 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9379 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9380 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9381 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 9382 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9383 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 9384 | "$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] | 9385 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9386 | -c "discarding invalid record (mac)" \ |
| 9387 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9388 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9389 | -c "HTTP/1.0 200 OK" \ |
| 9390 | -S "too many records with bad MAC" \ |
| 9391 | -S "Verification of the message MAC failed" |
| 9392 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9393 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9394 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 9395 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9396 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 9397 | "$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] | 9398 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9399 | -C "discarding invalid record (mac)" \ |
| 9400 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9401 | -S "Extra-header:" \ |
| 9402 | -C "HTTP/1.0 200 OK" \ |
| 9403 | -s "too many records with bad MAC" \ |
| 9404 | -s "Verification of the message MAC failed" |
| 9405 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9406 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9407 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 9408 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9409 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 9410 | "$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] | 9411 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9412 | -c "discarding invalid record (mac)" \ |
| 9413 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9414 | -s "Extra-header:" \ |
| 9415 | -c "HTTP/1.0 200 OK" \ |
| 9416 | -S "too many records with bad MAC" \ |
| 9417 | -S "Verification of the message MAC failed" |
| 9418 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9419 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9420 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 9421 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9422 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 9423 | "$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] | 9424 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9425 | -c "discarding invalid record (mac)" \ |
| 9426 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9427 | -s "Extra-header:" \ |
| 9428 | -c "HTTP/1.0 200 OK" \ |
| 9429 | -s "too many records with bad MAC" \ |
| 9430 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9431 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9432 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9433 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 9434 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 9435 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 9436 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9437 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9438 | -c "record from another epoch" \ |
| 9439 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9440 | -s "Extra-header:" \ |
| 9441 | -c "HTTP/1.0 200 OK" |
| 9442 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 9443 | # Tests for reordering support with DTLS |
| 9444 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 9445 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9446 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9447 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 9448 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9449 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9450 | hs_timeout=2500-60000" \ |
| 9451 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9452 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 9453 | 0 \ |
| 9454 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9455 | -c "Next handshake message has been buffered - load"\ |
| 9456 | -S "Buffering HS message" \ |
| 9457 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9458 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9459 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9460 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9461 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 9462 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 9463 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9464 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9465 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 9466 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9467 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9468 | hs_timeout=2500-60000" \ |
| 9469 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9470 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9471 | 0 \ |
| 9472 | -c "Buffering HS message" \ |
| 9473 | -c "found fragmented DTLS handshake message"\ |
| 9474 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 9475 | -c "Next handshake message has been buffered - load"\ |
| 9476 | -S "Buffering HS message" \ |
| 9477 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9478 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9479 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9480 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 9481 | -S "Remember CCS message" |
| 9482 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9483 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 9484 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 9485 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 9486 | # while keeping the ServerKeyExchange. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 9487 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9488 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9489 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9490 | 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] | 9491 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9492 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9493 | hs_timeout=2500-60000" \ |
| 9494 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9495 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9496 | 0 \ |
| 9497 | -c "Buffering HS message" \ |
| 9498 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9499 | -C "attempt to make space by freeing buffered messages" \ |
| 9500 | -S "Buffering HS message" \ |
| 9501 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9502 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9503 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9504 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9505 | -S "Remember CCS message" |
| 9506 | |
| 9507 | # The size constraints ensure that the delayed certificate message can't |
| 9508 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 9509 | # when dropping it first. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 9510 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9511 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 9512 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9513 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9514 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 9515 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9516 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9517 | hs_timeout=2500-60000" \ |
| 9518 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9519 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9520 | 0 \ |
| 9521 | -c "Buffering HS message" \ |
| 9522 | -c "attempt to make space by freeing buffered future messages" \ |
| 9523 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9524 | -S "Buffering HS message" \ |
| 9525 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9526 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9527 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9528 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9529 | -S "Remember CCS message" |
| 9530 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 9531 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9532 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9533 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 9534 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9535 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 9536 | hs_timeout=2500-60000" \ |
| 9537 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9538 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9539 | 0 \ |
| 9540 | -C "Buffering HS message" \ |
| 9541 | -C "Next handshake message has been buffered - load"\ |
| 9542 | -s "Buffering HS message" \ |
| 9543 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9544 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9545 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9546 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9547 | -S "Remember CCS message" |
| 9548 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 9549 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9550 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9551 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 9552 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9553 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9554 | hs_timeout=2500-60000" \ |
| 9555 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9556 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9557 | 0 \ |
| 9558 | -C "Buffering HS message" \ |
| 9559 | -C "Next handshake message has been buffered - load"\ |
| 9560 | -S "Buffering HS message" \ |
| 9561 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9562 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9563 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9564 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9565 | -S "Remember CCS message" |
| 9566 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 9567 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9568 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9569 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 9570 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9571 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9572 | hs_timeout=2500-60000" \ |
| 9573 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9574 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9575 | 0 \ |
| 9576 | -C "Buffering HS message" \ |
| 9577 | -C "Next handshake message has been buffered - load"\ |
| 9578 | -S "Buffering HS message" \ |
| 9579 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9580 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9581 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9582 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9583 | -s "Remember CCS message" |
| 9584 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9585 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9586 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9587 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9588 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9589 | hs_timeout=2500-60000" \ |
| 9590 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9591 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 9592 | 0 \ |
| 9593 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9594 | -s "Found buffered record from current epoch - load" \ |
| 9595 | -c "Buffer record from epoch 1" \ |
| 9596 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9597 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9598 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 9599 | # from the server are delayed, so that the encrypted Finished message |
| 9600 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 9601 | # in afterwards, the encrypted Finished message must be freed in order |
| 9602 | # to make space for the NewSessionTicket to be reassembled. |
| 9603 | # This works only in very particular circumstances: |
| 9604 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 9605 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 9606 | # the encrypted Finished message. |
| 9607 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 9608 | # needs to be fragmented. |
| 9609 | # - All messages sent by the server must be small enough to be either sent |
| 9610 | # without fragmentation or be reassembled within the bounds of |
| 9611 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 9612 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 9613 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 9614 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9615 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9616 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 9617 | -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] | 9618 | "$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] | 9619 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 9620 | 0 \ |
| 9621 | -s "Buffer record from epoch 1" \ |
| 9622 | -s "Found buffered record from current epoch - load" \ |
| 9623 | -c "Buffer record from epoch 1" \ |
| 9624 | -C "Found buffered record from current epoch - load" \ |
| 9625 | -c "Enough space available after freeing future epoch record" |
| 9626 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 9627 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 9628 | |
| 9629 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9630 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9631 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 9632 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9633 | "$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] | 9634 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9635 | "$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] | 9636 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9637 | 0 \ |
| 9638 | -s "Extra-header:" \ |
| 9639 | -c "HTTP/1.0 200 OK" |
| 9640 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9641 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9642 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9643 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 9644 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9645 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 9646 | "$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] | 9647 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9648 | 0 \ |
| 9649 | -s "Extra-header:" \ |
| 9650 | -c "HTTP/1.0 200 OK" |
| 9651 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9652 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9653 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9654 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 9655 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9656 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 9657 | "$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] | 9658 | 0 \ |
| 9659 | -s "Extra-header:" \ |
| 9660 | -c "HTTP/1.0 200 OK" |
| 9661 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9662 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9663 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9664 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 9665 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9666 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 9667 | "$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] | 9668 | 0 \ |
| 9669 | -s "Extra-header:" \ |
| 9670 | -c "HTTP/1.0 200 OK" |
| 9671 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9672 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9673 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9674 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 9675 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9676 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 9677 | "$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] | 9678 | 0 \ |
| 9679 | -s "Extra-header:" \ |
| 9680 | -c "HTTP/1.0 200 OK" |
| 9681 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9682 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9683 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9684 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 9685 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9686 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 9687 | "$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] | 9688 | 0 \ |
| 9689 | -s "Extra-header:" \ |
| 9690 | -c "HTTP/1.0 200 OK" |
| 9691 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9692 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9693 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9694 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 9695 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9696 | "$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] | 9697 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9698 | "$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] | 9699 | 0 \ |
| 9700 | -s "Extra-header:" \ |
| 9701 | -c "HTTP/1.0 200 OK" |
| 9702 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9703 | client_needs_more_time 4 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9704 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 9705 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 9706 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 9707 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9708 | "$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] | 9709 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9710 | "$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] | 9711 | 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] | 9712 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9713 | 0 \ |
| 9714 | -s "a session has been resumed" \ |
| 9715 | -c "a session has been resumed" \ |
| 9716 | -s "Extra-header:" \ |
| 9717 | -c "HTTP/1.0 200 OK" |
| 9718 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9719 | client_needs_more_time 4 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9720 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 9721 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 9722 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 9723 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9724 | "$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] | 9725 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9726 | "$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] | 9727 | 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] | 9728 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 9729 | 0 \ |
| 9730 | -s "a session has been resumed" \ |
| 9731 | -c "a session has been resumed" \ |
| 9732 | -s "Extra-header:" \ |
| 9733 | -c "HTTP/1.0 200 OK" |
| 9734 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9735 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9736 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9737 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9738 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 9739 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9740 | "$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] | 9741 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9742 | "$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] | 9743 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 9744 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9745 | 0 \ |
| 9746 | -c "=> renegotiate" \ |
| 9747 | -s "=> renegotiate" \ |
| 9748 | -s "Extra-header:" \ |
| 9749 | -c "HTTP/1.0 200 OK" |
| 9750 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9751 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9752 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9753 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9754 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 9755 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9756 | "$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] | 9757 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9758 | "$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] | 9759 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9760 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9761 | 0 \ |
| 9762 | -c "=> renegotiate" \ |
| 9763 | -s "=> renegotiate" \ |
| 9764 | -s "Extra-header:" \ |
| 9765 | -c "HTTP/1.0 200 OK" |
| 9766 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9767 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9768 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9769 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9770 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 9771 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9772 | "$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] | 9773 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9774 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9775 | "$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] | 9776 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9777 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9778 | 0 \ |
| 9779 | -c "=> renegotiate" \ |
| 9780 | -s "=> renegotiate" \ |
| 9781 | -s "Extra-header:" \ |
| 9782 | -c "HTTP/1.0 200 OK" |
| 9783 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9784 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9785 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9786 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9787 | 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] | 9788 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9789 | "$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] | 9790 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9791 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9792 | "$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] | 9793 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9794 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9795 | 0 \ |
| 9796 | -c "=> renegotiate" \ |
| 9797 | -s "=> renegotiate" \ |
| 9798 | -s "Extra-header:" \ |
| 9799 | -c "HTTP/1.0 200 OK" |
| 9800 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9801 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 9802 | ## all versions installed on the CI machines), reported here: |
| 9803 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 9804 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 9805 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 9806 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9807 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9808 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9809 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9810 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 9811 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 9812 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9813 | "$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] | 9814 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 9815 | -c "HTTP/1.0 200 OK" |
| 9816 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9817 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9818 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9819 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9820 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9821 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 9822 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 9823 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9824 | "$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] | 9825 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9826 | -c "HTTP/1.0 200 OK" |
| 9827 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9828 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9829 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9830 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9831 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9832 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 9833 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 9834 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9835 | "$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] | 9836 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9837 | -c "HTTP/1.0 200 OK" |
| 9838 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 9839 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9840 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9841 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9842 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9843 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 9844 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 9845 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9846 | "$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] | 9847 | 0 \ |
| 9848 | -s "Extra-header:" \ |
| 9849 | -c "Extra-header:" |
| 9850 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9851 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9852 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9853 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9854 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9855 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 9856 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9857 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9858 | "$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] | 9859 | 0 \ |
| 9860 | -s "Extra-header:" \ |
| 9861 | -c "Extra-header:" |
| 9862 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9863 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9864 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9865 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9866 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9867 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 9868 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9869 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9870 | "$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] | 9871 | 0 \ |
| 9872 | -s "Extra-header:" \ |
| 9873 | -c "Extra-header:" |
| 9874 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9875 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 9876 | run_test "export keys functionality" \ |
| 9877 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 9878 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 9879 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 9880 | -c "EAP-TLS key material is:"\ |
| 9881 | -s "EAP-TLS key material is:"\ |
| 9882 | -c "EAP-TLS IV is:" \ |
| 9883 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 9884 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 9885 | # openssl feature tests: check if tls1.3 exists. |
| 9886 | requires_openssl_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9887 | run_test "TLS 1.3: Test openssl tls1_3 feature" \ |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 9888 | "$O_NEXT_SRV -tls1_3 -msg" \ |
| 9889 | "$O_NEXT_CLI -tls1_3 -msg" \ |
| 9890 | 0 \ |
| 9891 | -c "TLS 1.3" \ |
| 9892 | -s "TLS 1.3" |
| 9893 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 9894 | # 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] | 9895 | requires_gnutls_tls1_3 |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 9896 | requires_gnutls_next_no_ticket |
| 9897 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9898 | run_test "TLS 1.3: Test gnutls tls1_3 feature" \ |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 9899 | "$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] | 9900 | "$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] | 9901 | 0 \ |
| 9902 | -s "Version: TLS1.3" \ |
| 9903 | -c "Version: TLS1.3" |
| 9904 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 9905 | # TLS1.3 test cases |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 9906 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9907 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9908 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9909 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9910 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9911 | run_test "TLS 1.3: minimal feature sets - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9912 | "$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] | 9913 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 9914 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 9915 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 9916 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 9917 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 9918 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 9919 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 9920 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 9921 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 9922 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 9923 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 9924 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 9925 | -c "<= ssl_tls13_process_server_hello" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 9926 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 9927 | -c "ECDH curve: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 9928 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 9929 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 9930 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 9931 | -c "=> parse certificate verify" \ |
| 9932 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 9933 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 9934 | -c "<= parse finished message" \ |
Gilles Peskine | c63a1e0 | 2022-01-13 01:10:24 +0100 | [diff] [blame] | 9935 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 9936 | -c "HTTP/1.0 200 ok" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 9937 | |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 9938 | requires_gnutls_tls1_3 |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 9939 | requires_gnutls_next_no_ticket |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9940 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9941 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9942 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9943 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9944 | run_test "TLS 1.3: minimal feature sets - gnutls" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9945 | "$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] | 9946 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 9947 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 9948 | -s "SERVER HELLO was queued" \ |
| 9949 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 9950 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 9951 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 9952 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 9953 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 9954 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 9955 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 9956 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 9957 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 9958 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 9959 | -c "<= ssl_tls13_process_server_hello" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 9960 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 9961 | -c "ECDH curve: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 9962 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 9963 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 9964 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 9965 | -c "=> parse certificate verify" \ |
| 9966 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 9967 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 9968 | -c "<= parse finished message" \ |
Gilles Peskine | 860429f | 2022-02-12 00:44:48 +0100 | [diff] [blame] | 9969 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 9970 | -c "HTTP/1.0 200 OK" |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 9971 | |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 9972 | requires_openssl_tls1_3 |
| 9973 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 9974 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 9975 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9976 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 9977 | requires_config_enabled MBEDTLS_SSL_ALPN |
| 9978 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9979 | run_test "TLS 1.3: alpn - openssl" \ |
| 9980 | "$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] | 9981 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 9982 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 9983 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 9984 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 9985 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 9986 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 9987 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 9988 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 9989 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 9990 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 9991 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 9992 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 9993 | -c "<= ssl_tls13_process_server_hello" \ |
| 9994 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 9995 | -c "ECDH curve: x25519" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 9996 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 9997 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 9998 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 9999 | -c "=> parse certificate verify" \ |
| 10000 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 10001 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 10002 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10003 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 10004 | -c "HTTP/1.0 200 ok" \ |
| 10005 | -c "Application Layer Protocol is h2" |
| 10006 | |
| 10007 | requires_gnutls_tls1_3 |
| 10008 | requires_gnutls_next_no_ticket |
| 10009 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10010 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10011 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10012 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10013 | requires_config_enabled MBEDTLS_SSL_ALPN |
| 10014 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 10015 | run_test "TLS 1.3: alpn - gnutls" \ |
| 10016 | "$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] | 10017 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 10018 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10019 | -s "SERVER HELLO was queued" \ |
| 10020 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 10021 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 10022 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 10023 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 10024 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 10025 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 10026 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 10027 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 10028 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 10029 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 10030 | -c "<= ssl_tls13_process_server_hello" \ |
| 10031 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10032 | -c "ECDH curve: x25519" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 10033 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10034 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 10035 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10036 | -c "=> parse certificate verify" \ |
| 10037 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 10038 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 10039 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10040 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 10041 | -c "HTTP/1.0 200 OK" \ |
| 10042 | -c "Application Layer Protocol is h2" |
| 10043 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10044 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 10045 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10046 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10047 | skip_handshake_stage_check |
| 10048 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 10049 | 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] | 10050 | "$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] | 10051 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10052 | 1 \ |
| 10053 | -s "Client's version: 3.3" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10054 | -S "Version: TLS1.0" \ |
| 10055 | -C "Protocol is TLSv1.0" |
| 10056 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10057 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 10058 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10059 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10060 | skip_handshake_stage_check |
| 10061 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 10062 | 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] | 10063 | "$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] | 10064 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10065 | 1 \ |
| 10066 | -s "Client's version: 3.3" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10067 | -S "Version: TLS1.1" \ |
| 10068 | -C "Protocol is TLSv1.1" |
| 10069 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10070 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 10071 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10072 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10073 | skip_handshake_stage_check |
| 10074 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 10075 | 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] | 10076 | "$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] | 10077 | "$P_CLI force_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10078 | 1 \ |
| 10079 | -s "Client's version: 3.3" \ |
| 10080 | -c "is a fatal alert message (msg 40)" \ |
| 10081 | -S "Version: TLS1.2" \ |
| 10082 | -C "Protocol is TLSv1.2" |
| 10083 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10084 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 10085 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10086 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10087 | skip_handshake_stage_check |
| 10088 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 10089 | 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] | 10090 | "$O_NEXT_SRV -msg -tls1" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10091 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10092 | 1 \ |
| 10093 | -s "fatal protocol_version" \ |
| 10094 | -c "is a fatal alert message (msg 70)" \ |
| 10095 | -S "Version: TLS1.0" \ |
| 10096 | -C "Protocol : TLSv1.0" |
| 10097 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10098 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 10099 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10100 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10101 | skip_handshake_stage_check |
| 10102 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 10103 | 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] | 10104 | "$O_NEXT_SRV -msg -tls1_1" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10105 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10106 | 1 \ |
| 10107 | -s "fatal protocol_version" \ |
| 10108 | -c "is a fatal alert message (msg 70)" \ |
| 10109 | -S "Version: TLS1.1" \ |
| 10110 | -C "Protocol : TLSv1.1" |
| 10111 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10112 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 10113 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10114 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10115 | skip_handshake_stage_check |
| 10116 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 10117 | 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] | 10118 | "$O_NEXT_SRV -msg -tls1_2" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10119 | "$P_CLI force_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10120 | 1 \ |
| 10121 | -s "fatal protocol_version" \ |
| 10122 | -c "is a fatal alert message (msg 70)" \ |
| 10123 | -S "Version: TLS1.2" \ |
| 10124 | -C "Protocol : TLSv1.2" |
| 10125 | |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 10126 | requires_openssl_tls1_3 |
| 10127 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10128 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10129 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10130 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10131 | run_test "TLS 1.3: Client authentication, no client certificate - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10132 | "$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] | 10133 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 10134 | 0 \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 10135 | -c "got a certificate request" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10136 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10137 | -s "TLS 1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10138 | -c "HTTP/1.0 200 ok" \ |
| 10139 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10140 | |
| 10141 | requires_gnutls_tls1_3 |
| 10142 | requires_gnutls_next_no_ticket |
| 10143 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10144 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10145 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10146 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10147 | run_test "TLS 1.3: Client authentication, no client certificate - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10148 | "$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] | 10149 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10150 | 0 \ |
| 10151 | -c "got a certificate request" \ |
| 10152 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE"\ |
| 10153 | -s "Version: TLS1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10154 | -c "HTTP/1.0 200 OK" \ |
| 10155 | -c "Protocol is TLSv1.3" |
| 10156 | |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 10157 | |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 10158 | requires_openssl_tls1_3 |
| 10159 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10160 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10161 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10162 | run_test "TLS 1.3: Client authentication, no server middlebox compat - openssl" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 10163 | "$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] | 10164 | "$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] | 10165 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 10166 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 10167 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10168 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10169 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 10170 | |
| 10171 | requires_gnutls_tls1_3 |
| 10172 | requires_gnutls_next_no_ticket |
| 10173 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10174 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10175 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10176 | run_test "TLS 1.3: Client authentication, no server middlebox compat - gnutls" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 10177 | "$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] | 10178 | "$P_CLI debug_level=3 crt_file=data_files/cli2.crt \ |
Jerry Yu | 25e0ddc | 2022-01-29 10:33:13 +0800 | [diff] [blame] | 10179 | key_file=data_files/cli2.key" \ |
Jerry Yu | c19884f | 2022-01-29 10:44:44 +0800 | [diff] [blame] | 10180 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 10181 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 10182 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10183 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10184 | -c "Protocol is TLSv1.3" |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 10185 | |
| 10186 | requires_openssl_tls1_3 |
| 10187 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10188 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10189 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10190 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10191 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10192 | "$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] | 10193 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp256r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10194 | key_file=data_files/ecdsa_secp256r1.key" \ |
| 10195 | 0 \ |
| 10196 | -c "got a certificate request" \ |
| 10197 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10198 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10199 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10200 | |
| 10201 | requires_gnutls_tls1_3 |
| 10202 | requires_gnutls_next_no_ticket |
| 10203 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10204 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10205 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10206 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10207 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10208 | "$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] | 10209 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp256r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10210 | key_file=data_files/ecdsa_secp256r1.key" \ |
| 10211 | 0 \ |
| 10212 | -c "got a certificate request" \ |
| 10213 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10214 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10215 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10216 | |
| 10217 | requires_openssl_tls1_3 |
| 10218 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10219 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10220 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10221 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10222 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10223 | "$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] | 10224 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp384r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10225 | key_file=data_files/ecdsa_secp384r1.key" \ |
| 10226 | 0 \ |
| 10227 | -c "got a certificate request" \ |
| 10228 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10229 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10230 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10231 | |
| 10232 | requires_gnutls_tls1_3 |
| 10233 | requires_gnutls_next_no_ticket |
| 10234 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10235 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10236 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10237 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10238 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10239 | "$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] | 10240 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp384r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10241 | key_file=data_files/ecdsa_secp384r1.key" \ |
| 10242 | 0 \ |
| 10243 | -c "got a certificate request" \ |
| 10244 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10245 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10246 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10247 | |
| 10248 | requires_openssl_tls1_3 |
| 10249 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10250 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10251 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10252 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10253 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10254 | "$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] | 10255 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10256 | key_file=data_files/ecdsa_secp521r1.key" \ |
| 10257 | 0 \ |
| 10258 | -c "got a certificate request" \ |
| 10259 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10260 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10261 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10262 | |
| 10263 | requires_gnutls_tls1_3 |
| 10264 | requires_gnutls_next_no_ticket |
| 10265 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10266 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10267 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10268 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10269 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10270 | "$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] | 10271 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10272 | key_file=data_files/ecdsa_secp521r1.key" \ |
| 10273 | 0 \ |
| 10274 | -c "got a certificate request" \ |
| 10275 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10276 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10277 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10278 | |
| 10279 | requires_openssl_tls1_3 |
| 10280 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10281 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10282 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10283 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10284 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10285 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10286 | "$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] | 10287 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 10288 | 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] | 10289 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10290 | -c "got a certificate request" \ |
| 10291 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10292 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 10293 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10294 | |
| 10295 | requires_gnutls_tls1_3 |
| 10296 | requires_gnutls_next_no_ticket |
| 10297 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10298 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10299 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10300 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10301 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10302 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10303 | "$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] | 10304 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 10305 | 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] | 10306 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10307 | -c "got a certificate request" \ |
| 10308 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10309 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 10310 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 10311 | |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 10312 | requires_openssl_tls1_3 |
| 10313 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10314 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10315 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10316 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10317 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 10318 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - openssl" \ |
| 10319 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 10320 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 10321 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384" \ |
| 10322 | 0 \ |
| 10323 | -c "got a certificate request" \ |
| 10324 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10325 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10326 | -c "Protocol is TLSv1.3" |
| 10327 | |
| 10328 | requires_gnutls_tls1_3 |
| 10329 | requires_gnutls_next_no_ticket |
| 10330 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10331 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10332 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10333 | requires_config_enabled MBEDTLS_RSA_C |
| 10334 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10335 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - gnutls" \ |
| 10336 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 10337 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 10338 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384" \ |
| 10339 | 0 \ |
| 10340 | -c "got a certificate request" \ |
| 10341 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10342 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10343 | -c "Protocol is TLSv1.3" |
| 10344 | |
| 10345 | requires_openssl_tls1_3 |
| 10346 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10347 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10348 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10349 | requires_config_enabled MBEDTLS_RSA_C |
| 10350 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10351 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - openssl" \ |
| 10352 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 10353 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 10354 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512" \ |
| 10355 | 0 \ |
| 10356 | -c "got a certificate request" \ |
| 10357 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10358 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10359 | -c "Protocol is TLSv1.3" |
| 10360 | |
| 10361 | requires_gnutls_tls1_3 |
| 10362 | requires_gnutls_next_no_ticket |
| 10363 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10364 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10365 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10366 | requires_config_enabled MBEDTLS_RSA_C |
| 10367 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10368 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - gnutls" \ |
| 10369 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 10370 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 10371 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512" \ |
| 10372 | 0 \ |
| 10373 | -c "got a certificate request" \ |
| 10374 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10375 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10376 | -c "Protocol is TLSv1.3" |
| 10377 | |
| 10378 | requires_openssl_tls1_3 |
| 10379 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10380 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10381 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10382 | requires_config_enabled MBEDTLS_RSA_C |
| 10383 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | ccb005e | 2022-02-22 17:38:34 +0800 | [diff] [blame] | 10384 | 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] | 10385 | "$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] | 10386 | -sigalgs ecdsa_secp256r1_sha256" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10387 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 10388 | 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] | 10389 | 1 \ |
| 10390 | -c "got a certificate request" \ |
| 10391 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10392 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 10393 | -c "signature algorithm not in received or offered list." \ |
| 10394 | -C "unkown pk type" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 10395 | |
| 10396 | requires_gnutls_tls1_3 |
| 10397 | requires_gnutls_next_no_ticket |
| 10398 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10399 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10400 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10401 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10402 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10403 | run_test "TLS 1.3: Client authentication, client alg not in server list - gnutls" \ |
| 10404 | "$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] | 10405 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 10406 | 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] | 10407 | 1 \ |
| 10408 | -c "got a certificate request" \ |
| 10409 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10410 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 10411 | -c "signature algorithm not in received or offered list." \ |
| 10412 | -C "unkown pk type" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 10413 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10414 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 10415 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 10416 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10417 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 10418 | requires_openssl_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 10419 | 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] | 10420 | "$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] | 10421 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 10422 | 0 \ |
| 10423 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 10424 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10425 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10426 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 10427 | -c "HTTP/1.0 200 ok" |
| 10428 | |
| 10429 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10430 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10431 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10432 | requires_config_enabled MBEDTLS_SSL_CLI_C |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 10433 | requires_openssl_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 10434 | 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] | 10435 | "$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] | 10436 | "$P_CLI debug_level=4" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 10437 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 10438 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 10439 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10440 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10441 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 10442 | -c "HTTP/1.0 200 ok" |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 10443 | |
Gilles Peskine | 2ecf4ff | 2022-04-13 19:08:38 +0200 | [diff] [blame] | 10444 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 10445 | requires_gnutls_tls1_3 |
| 10446 | requires_gnutls_next_no_ticket |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 10447 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 10448 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10449 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 10450 | 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] | 10451 | "$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] | 10452 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 10453 | 0 \ |
| 10454 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 10455 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10456 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10457 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 10458 | -c "HTTP/1.0 200 OK" |
| 10459 | |
Gilles Peskine | 2ecf4ff | 2022-04-13 19:08:38 +0200 | [diff] [blame] | 10460 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 10461 | requires_gnutls_tls1_3 |
| 10462 | requires_gnutls_next_no_ticket |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 10463 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10464 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10465 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 10466 | 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] | 10467 | "$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] | 10468 | "$P_CLI debug_level=4" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 10469 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 10470 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 10471 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10472 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10473 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 10474 | -c "HTTP/1.0 200 OK" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 10475 | |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 10476 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 10477 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 10478 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 10479 | requires_openssl_tls1_3 |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 10480 | run_test "TLS 1.3: Server side check - openssl" \ |
XiaokangQian | c4b8c99 | 2022-04-07 11:31:38 +0000 | [diff] [blame] | 10481 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 10482 | "$O_NEXT_CLI -msg -debug -tls1_3" \ |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 10483 | 1 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 10484 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 10485 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 10486 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 10487 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 10488 | -s "SSL - The requested feature is not available" \ |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 10489 | -s "=> parse client hello" \ |
| 10490 | -s "<= parse client hello" |
| 10491 | |
| 10492 | requires_gnutls_tls1_3 |
| 10493 | requires_gnutls_next_no_ticket |
| 10494 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 10495 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 10496 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 10497 | run_test "TLS 1.3: Server side check - gnutls" \ |
XiaokangQian | c4b8c99 | 2022-04-07 11:31:38 +0000 | [diff] [blame] | 10498 | "$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] | 10499 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V" \ |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 10500 | 1 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 10501 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 10502 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 10503 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 10504 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 10505 | -s "SSL - The requested feature is not available" \ |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 10506 | -s "=> parse client hello" \ |
| 10507 | -s "<= parse client hello" |
| 10508 | |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 10509 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10510 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10511 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Jerry Yu | 955ddd7 | 2022-04-22 22:27:33 +0800 | [diff] [blame] | 10512 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 10513 | run_test "TLS 1.3: Server side check - mbedtls" \ |
| 10514 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
| 10515 | "$P_CLI debug_level=4 force_version=tls13" \ |
| 10516 | 1 \ |
| 10517 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 10518 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 10519 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 10520 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 10521 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 10522 | -s "SSL - The requested feature is not available" \ |
| 10523 | -s "=> parse client hello" \ |
| 10524 | -s "<= parse client hello" |
| 10525 | |
Gilles Peskine | 2baaf60 | 2022-01-07 15:46:12 +0100 | [diff] [blame] | 10526 | for i in opt-testcases/*.sh |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 10527 | do |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 10528 | TEST_SUITE_NAME=${i##*/} |
| 10529 | TEST_SUITE_NAME=${TEST_SUITE_NAME%.*} |
| 10530 | . "$i" |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 10531 | done |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 10532 | unset TEST_SUITE_NAME |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 10533 | |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 10534 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10535 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 10536 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 10537 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10538 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 10539 | 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] | 10540 | "$O_NEXT_SRV -msg -tls1_3 -no_middlebox -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10541 | "$P_CLI debug_level=3" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 10542 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10543 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 10544 | -c "HTTP/1.0 200 ok" |
| 10545 | |
| 10546 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10547 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 10548 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 10549 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10550 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 10551 | 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] | 10552 | "$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] | 10553 | "$P_CLI debug_level=3" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 10554 | 1 \ |
| 10555 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 10556 | |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 10557 | requires_gnutls_tls1_3 |
| 10558 | requires_gnutls_next_no_ticket |
| 10559 | requires_gnutls_next_disable_tls13_compat |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10560 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 10561 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10562 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10563 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 10564 | run_test "TLS 1.3 m->G both peers do not support middlebox compatibility" \ |
| 10565 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE --disable-client-cert" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10566 | "$P_CLI debug_level=3" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 10567 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10568 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 10569 | -c "HTTP/1.0 200 OK" |
| 10570 | |
| 10571 | requires_gnutls_tls1_3 |
| 10572 | requires_gnutls_next_no_ticket |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10573 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 10574 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10575 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10576 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 10577 | run_test "TLS 1.3 m->G server with middlebox compat support, not client" \ |
| 10578 | "$G_NEXT_SRV --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] | 10579 | "$P_CLI debug_level=3" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 10580 | 1 \ |
| 10581 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 10582 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 10583 | # Test heap memory usage after handshake |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10584 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 10585 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 10586 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 10587 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10588 | requires_max_content_len 16384 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 10589 | run_tests_memory_after_hanshake |
| 10590 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 10591 | # Final report |
| 10592 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10593 | echo "------------------------------------------------------------------------" |
| 10594 | |
| 10595 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 10596 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10597 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 10598 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10599 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 10600 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 10601 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10602 | |
| 10603 | exit $FAILS |