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";; |
| 300 | esac |
| 301 | |
| 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 "$@" |
| 1295 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 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 | |
| 1306 | TIMES_LEFT=2 |
| 1307 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1308 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1309 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1310 | do_run_test_once |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1311 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1312 | check_test_failure "$@" |
| 1313 | case $outcome in |
| 1314 | PASS) break;; |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1315 | RETRY*) printf "$outcome ";; |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1316 | FAIL) return;; |
| 1317 | esac |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1318 | done |
| 1319 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1320 | # If we get this far, the test case passed. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1321 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1322 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1323 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1324 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1325 | if [ -n "$PXY_CMD" ]; then |
| 1326 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1327 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1328 | fi |
| 1329 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1330 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1331 | } |
| 1332 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1333 | run_test_psa() { |
| 1334 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1335 | set_maybe_calc_verify none |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1336 | run_test "PSA-supported ciphersuite: $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1337 | "$P_SRV debug_level=3 force_version=tls12" \ |
| 1338 | "$P_CLI debug_level=3 force_version=tls12 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1339 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1340 | -c "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1341 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1342 | -s "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1343 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1344 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1345 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1346 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1347 | -S "error" \ |
| 1348 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1349 | unset maybe_calc_verify |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1350 | } |
| 1351 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1352 | run_test_psa_force_curve() { |
| 1353 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1354 | set_maybe_calc_verify none |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1355 | run_test "PSA - ECDH with $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1356 | "$P_SRV debug_level=4 force_version=tls12 curves=$1" \ |
| 1357 | "$P_CLI debug_level=4 force_version=tls12 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 curves=$1" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1358 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1359 | -c "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1360 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1361 | -s "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1362 | -s "calc PSA finished" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1363 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1364 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1365 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1366 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1367 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1368 | unset maybe_calc_verify |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1369 | } |
| 1370 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1371 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1372 | # a maximum fragment length. |
| 1373 | # first argument ($1) is MFL for SSL client |
| 1374 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1375 | run_test_memory_after_hanshake_with_mfl() |
| 1376 | { |
| 1377 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1378 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1379 | |
| 1380 | # Leave some margin for robustness |
| 1381 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1382 | |
| 1383 | run_test "Handshake memory usage (MFL $1)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1384 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
| 1385 | "$P_CLI debug_level=3 force_version=tls12 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1386 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1387 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1388 | 0 \ |
| 1389 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1390 | } |
| 1391 | |
| 1392 | |
| 1393 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1394 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1395 | run_tests_memory_after_hanshake() |
| 1396 | { |
| 1397 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1398 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1399 | |
| 1400 | # first test with default MFU is to get reference memory usage |
| 1401 | MEMORY_USAGE_MFL_16K=0 |
| 1402 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1403 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
| 1404 | "$P_CLI debug_level=3 force_version=tls12 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1405 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1406 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1407 | 0 \ |
| 1408 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1409 | |
| 1410 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1411 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1412 | |
| 1413 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1414 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1415 | |
| 1416 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1417 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1418 | |
| 1419 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1420 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1421 | } |
| 1422 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1423 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1424 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1425 | rm -f context_srv.txt |
| 1426 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1427 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1428 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1429 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1430 | 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] | 1431 | exit 1 |
| 1432 | } |
| 1433 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1434 | # |
| 1435 | # MAIN |
| 1436 | # |
| 1437 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1438 | get_options "$@" |
| 1439 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1440 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1441 | # patterns rather than regular expressions, use a case statement instead |
| 1442 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1443 | # detects simple cases: plain substring, everything, nothing. |
| 1444 | # |
| 1445 | # As an exception, the character '.' is treated as an ordinary character |
| 1446 | # if it is the only special character in the string. This is because it's |
| 1447 | # rare to need "any one character", but needing a literal '.' is common |
| 1448 | # (e.g. '-f "DTLS 1.2"'). |
| 1449 | need_grep= |
| 1450 | case "$FILTER" in |
| 1451 | '^$') simple_filter=;; |
| 1452 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1453 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1454 | need_grep=1;; |
| 1455 | *) # No regexp or shell-pattern special character |
| 1456 | simple_filter="*$FILTER*";; |
| 1457 | esac |
| 1458 | case "$EXCLUDE" in |
| 1459 | '^$') simple_exclude=;; |
| 1460 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1461 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1462 | need_grep=1;; |
| 1463 | *) # No regexp or shell-pattern special character |
| 1464 | simple_exclude="*$EXCLUDE*";; |
| 1465 | esac |
| 1466 | if [ -n "$need_grep" ]; then |
| 1467 | is_excluded () { |
| 1468 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1469 | } |
| 1470 | else |
| 1471 | is_excluded () { |
| 1472 | case "$1" in |
| 1473 | $simple_exclude) true;; |
| 1474 | $simple_filter) false;; |
| 1475 | *) true;; |
| 1476 | esac |
| 1477 | } |
| 1478 | fi |
| 1479 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1480 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1481 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1482 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1483 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1484 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1485 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1486 | exit 1 |
| 1487 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1488 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1489 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1490 | exit 1 |
| 1491 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1492 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1493 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1494 | exit 1 |
| 1495 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1496 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1497 | if which valgrind >/dev/null 2>&1; then :; else |
| 1498 | echo "Memcheck not possible. Valgrind not found" |
| 1499 | exit 1 |
| 1500 | fi |
| 1501 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1502 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 1503 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1504 | exit 1 |
| 1505 | fi |
| 1506 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1507 | # used by watchdog |
| 1508 | MAIN_PID="$$" |
| 1509 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1510 | # We use somewhat arbitrary delays for tests: |
| 1511 | # - how long do we wait for the server to start (when lsof not available)? |
| 1512 | # - how long do we allow for the client to finish? |
| 1513 | # (not to check performance, just to avoid waiting indefinitely) |
| 1514 | # Things are slower with valgrind, so give extra time here. |
| 1515 | # |
| 1516 | # Note: without lsof, there is a trade-off between the running time of this |
| 1517 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1518 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1519 | # 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] | 1520 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1521 | START_DELAY=6 |
| 1522 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1523 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1524 | START_DELAY=2 |
| 1525 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1526 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1527 | |
| 1528 | # some particular tests need more time: |
| 1529 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1530 | # - for the server, we sleep for a number of seconds after the client exits |
| 1531 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1532 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1533 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1534 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1535 | # 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] | 1536 | # +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] | 1537 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 1538 | # 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] | 1539 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1540 | 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] | 1541 | 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] | 1542 | O_SRV="$O_SRV -accept $SRV_PORT" |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1543 | 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] | 1544 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1545 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1546 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1547 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1548 | 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] | 1549 | 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] | 1550 | fi |
| 1551 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 1552 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 1553 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1554 | 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] | 1555 | 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] | 1556 | fi |
| 1557 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1558 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1559 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1560 | 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] | 1561 | fi |
| 1562 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1563 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1564 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1565 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1566 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1567 | # Allow SHA-1, because many of our test certificates use it |
| 1568 | P_SRV="$P_SRV allow_sha1=1" |
| 1569 | P_CLI="$P_CLI allow_sha1=1" |
| 1570 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1571 | # Also pick a unique name for intermediate files |
| 1572 | SRV_OUT="srv_out.$$" |
| 1573 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1574 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1575 | SESSION="session.$$" |
| 1576 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1577 | SKIP_NEXT="NO" |
| 1578 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1579 | trap cleanup INT TERM HUP |
| 1580 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1581 | # Basic test |
| 1582 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1583 | # Checks that: |
| 1584 | # - 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] | 1585 | # - the expected parameters are selected |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1586 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 1587 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Gilles Peskine | 1438e16 | 2022-04-05 22:00:32 +0200 | [diff] [blame] | 1588 | requires_config_enabled MBEDTLS_SHA512_C # "signature_algorithm ext: 6" |
| 1589 | requires_config_enabled MBEDTLS_ECP_DP_CURVE25519_ENABLED |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1590 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1591 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1592 | "$P_CLI" \ |
| 1593 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1594 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1595 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1596 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 1597 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1598 | -S "error" \ |
| 1599 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1600 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1601 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 1602 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1603 | run_test "Default, DTLS" \ |
| 1604 | "$P_SRV dtls=1" \ |
| 1605 | "$P_CLI dtls=1" \ |
| 1606 | 0 \ |
| 1607 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1608 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1609 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1610 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1611 | run_test "TLS client auth: required" \ |
| 1612 | "$P_SRV auth_mode=required" \ |
| 1613 | "$P_CLI" \ |
| 1614 | 0 \ |
| 1615 | -s "Verifying peer X.509 certificate... ok" |
| 1616 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1617 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 1618 | run_test "key size: TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1619 | "$P_SRV" \ |
| 1620 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1621 | 0 \ |
| 1622 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1623 | -c "Key size is 256" |
| 1624 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1625 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 1626 | run_test "key size: TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1627 | "$P_SRV" \ |
| 1628 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1629 | 0 \ |
| 1630 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1631 | -c "Key size is 128" |
| 1632 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1633 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1634 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1635 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1636 | requires_config_enabled MBEDTLS_SHA256_C |
| 1637 | run_test "TLS: password protected client key" \ |
| 1638 | "$P_SRV auth_mode=required" \ |
| 1639 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1640 | 0 |
| 1641 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1642 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1643 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1644 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1645 | requires_config_enabled MBEDTLS_SHA256_C |
| 1646 | run_test "TLS: password protected server key" \ |
| 1647 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1648 | "$P_CLI" \ |
| 1649 | 0 |
| 1650 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1651 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1652 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1653 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1654 | requires_config_enabled MBEDTLS_RSA_C |
| 1655 | requires_config_enabled MBEDTLS_SHA256_C |
| 1656 | run_test "TLS: password protected server key, two certificates" \ |
| 1657 | "$P_SRV \ |
| 1658 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1659 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1660 | "$P_CLI" \ |
| 1661 | 0 |
| 1662 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1663 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1664 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1665 | run_test "CA callback on client" \ |
| 1666 | "$P_SRV debug_level=3" \ |
| 1667 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1668 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1669 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1670 | -S "error" \ |
| 1671 | -C "error" |
| 1672 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1673 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1674 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1675 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1676 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1677 | requires_config_enabled MBEDTLS_SHA256_C |
| 1678 | run_test "CA callback on server" \ |
| 1679 | "$P_SRV auth_mode=required" \ |
| 1680 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1681 | key_file=data_files/server5.key" \ |
| 1682 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1683 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1684 | -s "Verifying peer X.509 certificate... ok" \ |
| 1685 | -S "error" \ |
| 1686 | -C "error" |
| 1687 | |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1688 | # Test using an opaque private key for client authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1689 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1690 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1691 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1692 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1693 | requires_config_enabled MBEDTLS_SHA256_C |
| 1694 | run_test "Opaque key for client authentication" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1695 | "$P_SRV auth_mode=required crt_file=data_files/server5.crt \ |
| 1696 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1697 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1698 | key_file=data_files/server5.key" \ |
| 1699 | 0 \ |
| 1700 | -c "key type: Opaque" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1701 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1702 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1703 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1704 | -S "error" \ |
| 1705 | -C "error" |
| 1706 | |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1707 | # Test using an opaque private key for server authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1708 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1709 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1710 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1711 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1712 | requires_config_enabled MBEDTLS_SHA256_C |
| 1713 | run_test "Opaque key for server authentication" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1714 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
| 1715 | key_file=data_files/server5.key" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1716 | "$P_CLI crt_file=data_files/server5.crt \ |
| 1717 | key_file=data_files/server5.key" \ |
| 1718 | 0 \ |
| 1719 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1720 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 1721 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1722 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1723 | -S "error" \ |
| 1724 | -C "error" |
| 1725 | |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1726 | # Test using an opaque private key for client/server authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1727 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1728 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1729 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1730 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1731 | requires_config_enabled MBEDTLS_SHA256_C |
| 1732 | run_test "Opaque key for client/server authentication" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1733 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
| 1734 | key_file=data_files/server5.key" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1735 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1736 | key_file=data_files/server5.key" \ |
| 1737 | 0 \ |
| 1738 | -c "key type: Opaque" \ |
| 1739 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1740 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 1741 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1742 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1743 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1744 | -S "error" \ |
| 1745 | -C "error" |
| 1746 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1747 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 1748 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 1749 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 1750 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 1751 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 1752 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 1753 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 1754 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 1755 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 1756 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 1757 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 1758 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1759 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1760 | run_test_psa_force_curve "secp521r1" |
| 1761 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 1762 | run_test_psa_force_curve "brainpoolP512r1" |
| 1763 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 1764 | run_test_psa_force_curve "secp384r1" |
| 1765 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1766 | run_test_psa_force_curve "brainpoolP384r1" |
| 1767 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1768 | run_test_psa_force_curve "secp256r1" |
| 1769 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1770 | run_test_psa_force_curve "secp256k1" |
| 1771 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1772 | run_test_psa_force_curve "brainpoolP256r1" |
| 1773 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1774 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1775 | ## SECP224K1 is buggy via the PSA API |
| 1776 | ## (https://github.com/ARMmbed/mbedtls/issues/3541), |
| 1777 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 1778 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 1779 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 1780 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1781 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1782 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1783 | run_test_psa_force_curve "secp192r1" |
| 1784 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1785 | run_test_psa_force_curve "secp192k1" |
| 1786 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1787 | # Test current time in ServerHello |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1788 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1789 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 1790 | run_test "ServerHello contains gmt_unix_time" \ |
| 1791 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1792 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1793 | 0 \ |
| 1794 | -f "check_server_hello_time" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1795 | -F "check_server_hello_time" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1796 | |
| 1797 | # Test for uniqueness of IVs in AEAD ciphersuites |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1798 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1799 | run_test "Unique IV in GCM" \ |
| 1800 | "$P_SRV exchanges=20 debug_level=4" \ |
| 1801 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 1802 | 0 \ |
| 1803 | -u "IV used" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1804 | -U "IV used" |
| 1805 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1806 | # Tests for certificate verification callback |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1807 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1808 | run_test "Configuration-specific CRT verification callback" \ |
| 1809 | "$P_SRV debug_level=3" \ |
| 1810 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1811 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1812 | -S "error" \ |
| 1813 | -c "Verify requested for " \ |
| 1814 | -c "Use configuration-specific verification callback" \ |
| 1815 | -C "Use context-specific verification callback" \ |
| 1816 | -C "error" |
| 1817 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1818 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1819 | run_test "Context-specific CRT verification callback" \ |
| 1820 | "$P_SRV debug_level=3" \ |
| 1821 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 1822 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1823 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1824 | -c "Verify requested for " \ |
| 1825 | -c "Use context-specific verification callback" \ |
| 1826 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1827 | -C "error" |
| 1828 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1829 | # Tests for SHA-1 support |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1830 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1831 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1832 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1833 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1834 | 1 \ |
| 1835 | -c "The certificate is signed with an unacceptable hash" |
| 1836 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1837 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1838 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1839 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1840 | "$P_CLI allow_sha1=1" \ |
| 1841 | 0 |
| 1842 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1843 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1844 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1845 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1846 | "$P_CLI allow_sha1=0" \ |
| 1847 | 0 |
| 1848 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1849 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1850 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1851 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1852 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1853 | 1 \ |
| 1854 | -s "The certificate is signed with an unacceptable hash" |
| 1855 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1856 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1857 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1858 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1859 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1860 | 0 |
| 1861 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1862 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1863 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1864 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1865 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1866 | 0 |
| 1867 | |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1868 | # Dummy TLS 1.3 test |
| 1869 | # Currently only checking that passing TLS 1.3 key exchange modes to |
| 1870 | # ssl_client2/ssl_server2 example programs works. |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 1871 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1872 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1873 | run_test "TLS 1.3, key exchange mode parameter passing: PSK only" \ |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 1874 | "$P_SRV tls13_kex_modes=psk debug_level=4" \ |
| 1875 | "$P_CLI tls13_kex_modes=psk debug_level=4" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1876 | 0 |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 1877 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1878 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1879 | run_test "TLS 1.3, key exchange mode parameter passing: PSK-ephemeral only" \ |
| 1880 | "$P_SRV tls13_kex_modes=psk_ephemeral" \ |
| 1881 | "$P_CLI tls13_kex_modes=psk_ephemeral" \ |
| 1882 | 0 |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 1883 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1884 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1885 | 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] | 1886 | "$P_SRV tls13_kex_modes=ephemeral" \ |
| 1887 | "$P_CLI tls13_kex_modes=ephemeral" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1888 | 0 |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 1889 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1890 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1891 | run_test "TLS 1.3, key exchange mode parameter passing: All ephemeral" \ |
| 1892 | "$P_SRV tls13_kex_modes=ephemeral_all" \ |
| 1893 | "$P_CLI tls13_kex_modes=ephemeral_all" \ |
| 1894 | 0 |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 1895 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1896 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1897 | run_test "TLS 1.3, key exchange mode parameter passing: All PSK" \ |
| 1898 | "$P_SRV tls13_kex_modes=psk_all" \ |
| 1899 | "$P_CLI tls13_kex_modes=psk_all" \ |
| 1900 | 0 |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 1901 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1902 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1903 | run_test "TLS 1.3, key exchange mode parameter passing: All" \ |
| 1904 | "$P_SRV tls13_kex_modes=all" \ |
| 1905 | "$P_CLI tls13_kex_modes=all" \ |
| 1906 | 0 |
| 1907 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1908 | # Tests for datagram packing |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1909 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1910 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1911 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1912 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1913 | 0 \ |
| 1914 | -c "next record in same datagram" \ |
| 1915 | -s "next record in same datagram" |
| 1916 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1917 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1918 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1919 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1920 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1921 | 0 \ |
| 1922 | -s "next record in same datagram" \ |
| 1923 | -C "next record in same datagram" |
| 1924 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1925 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1926 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1927 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1928 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1929 | 0 \ |
| 1930 | -S "next record in same datagram" \ |
| 1931 | -c "next record in same datagram" |
| 1932 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1933 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1934 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1935 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1936 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1937 | 0 \ |
| 1938 | -S "next record in same datagram" \ |
| 1939 | -C "next record in same datagram" |
| 1940 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1941 | # Tests for Context serialization |
| 1942 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1943 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1944 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1945 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1946 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1947 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1948 | 0 \ |
| 1949 | -c "Deserializing connection..." \ |
| 1950 | -S "Deserializing connection..." |
| 1951 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1952 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1953 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1954 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 1955 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1956 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1957 | 0 \ |
| 1958 | -c "Deserializing connection..." \ |
| 1959 | -S "Deserializing connection..." |
| 1960 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1961 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1962 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1963 | run_test "Context serialization, client serializes, GCM" \ |
| 1964 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1965 | "$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] | 1966 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1967 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1968 | -S "Deserializing connection..." |
| 1969 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1970 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1971 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1972 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1973 | run_test "Context serialization, client serializes, with CID" \ |
| 1974 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1975 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1976 | 0 \ |
| 1977 | -c "Deserializing connection..." \ |
| 1978 | -S "Deserializing connection..." |
| 1979 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1980 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1981 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1982 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1983 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1984 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1985 | 0 \ |
| 1986 | -C "Deserializing connection..." \ |
| 1987 | -s "Deserializing connection..." |
| 1988 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1989 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1990 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1991 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 1992 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1993 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1994 | 0 \ |
| 1995 | -C "Deserializing connection..." \ |
| 1996 | -s "Deserializing connection..." |
| 1997 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1998 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1999 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2000 | run_test "Context serialization, server serializes, GCM" \ |
| 2001 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2002 | "$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] | 2003 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2004 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2005 | -s "Deserializing connection..." |
| 2006 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2007 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2008 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2009 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2010 | run_test "Context serialization, server serializes, with CID" \ |
| 2011 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2012 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2013 | 0 \ |
| 2014 | -C "Deserializing connection..." \ |
| 2015 | -s "Deserializing connection..." |
| 2016 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2017 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2018 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2019 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2020 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2021 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2022 | 0 \ |
| 2023 | -c "Deserializing connection..." \ |
| 2024 | -s "Deserializing connection..." |
| 2025 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2026 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2027 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2028 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 2029 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2030 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2031 | 0 \ |
| 2032 | -c "Deserializing connection..." \ |
| 2033 | -s "Deserializing connection..." |
| 2034 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2035 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2036 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2037 | run_test "Context serialization, both serialize, GCM" \ |
| 2038 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2039 | "$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] | 2040 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2041 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2042 | -s "Deserializing connection..." |
| 2043 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2044 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2045 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2046 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2047 | run_test "Context serialization, both serialize, with CID" \ |
| 2048 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2049 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2050 | 0 \ |
| 2051 | -c "Deserializing connection..." \ |
| 2052 | -s "Deserializing connection..." |
| 2053 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2054 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2055 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2056 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2057 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2058 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2059 | 0 \ |
| 2060 | -c "Deserializing connection..." \ |
| 2061 | -S "Deserializing connection..." |
| 2062 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2063 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2064 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2065 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 2066 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2067 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2068 | 0 \ |
| 2069 | -c "Deserializing connection..." \ |
| 2070 | -S "Deserializing connection..." |
| 2071 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2072 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2073 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2074 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 2075 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2076 | "$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] | 2077 | 0 \ |
| 2078 | -c "Deserializing connection..." \ |
| 2079 | -S "Deserializing connection..." |
| 2080 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2081 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2082 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2083 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2084 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 2085 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2086 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 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 | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2092 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2093 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2094 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2095 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 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, re-init, server serializes, ChaChaPoly" \ |
| 2103 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2104 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2105 | 0 \ |
| 2106 | -C "Deserializing connection..." \ |
| 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 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2110 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2111 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 2112 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2113 | "$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] | 2114 | 0 \ |
| 2115 | -C "Deserializing connection..." \ |
| 2116 | -s "Deserializing connection..." |
| 2117 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2118 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2119 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2120 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2121 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 2122 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2123 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 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 | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2129 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2130 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2131 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2132 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 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, re-init, both serialize, ChaChaPoly" \ |
| 2140 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2141 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2142 | 0 \ |
| 2143 | -c "Deserializing connection..." \ |
| 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 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2147 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2148 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 2149 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2150 | "$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] | 2151 | 0 \ |
| 2152 | -c "Deserializing connection..." \ |
| 2153 | -s "Deserializing connection..." |
| 2154 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2155 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2156 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2157 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2158 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 2159 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2160 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 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 |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 2166 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2167 | run_test "Saving the serialized context to a file" \ |
| 2168 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 2169 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 2170 | 0 \ |
| 2171 | -s "Save serialized context to a file... ok" \ |
| 2172 | -c "Save serialized context to a file... ok" |
| 2173 | rm -f context_srv.txt |
| 2174 | rm -f context_cli.txt |
| 2175 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2176 | # Tests for DTLS Connection ID extension |
| 2177 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2178 | # So far, the CID API isn't implemented, so we can't |
| 2179 | # grep for output witnessing its use. This needs to be |
| 2180 | # changed once the CID extension is implemented. |
| 2181 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2182 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2183 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2184 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2185 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 2186 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2187 | 0 \ |
| 2188 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2189 | -s "found CID extension" \ |
| 2190 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2191 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2192 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2193 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2194 | -C "found CID extension" \ |
| 2195 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2196 | -C "Copy CIDs into SSL transform" \ |
| 2197 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2198 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2199 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2200 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2201 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2202 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2203 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 2204 | 0 \ |
| 2205 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2206 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2207 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2208 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2209 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2210 | -C "found CID extension" \ |
| 2211 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2212 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 2213 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2214 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2215 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2216 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2217 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2218 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2219 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 2220 | 0 \ |
| 2221 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2222 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2223 | -c "client hello, adding CID extension" \ |
| 2224 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2225 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2226 | -s "server hello, adding CID extension" \ |
| 2227 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2228 | -c "Use of CID extension negotiated" \ |
| 2229 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2230 | -c "Copy CIDs into SSL transform" \ |
| 2231 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2232 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2233 | -s "Use of Connection ID has been negotiated" \ |
| 2234 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2235 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2236 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2237 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2238 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2239 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2240 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 2241 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 2242 | 0 \ |
| 2243 | -c "Enable use of CID extension." \ |
| 2244 | -s "Enable use of CID extension." \ |
| 2245 | -c "client hello, adding CID extension" \ |
| 2246 | -s "found CID extension" \ |
| 2247 | -s "Use of CID extension negotiated" \ |
| 2248 | -s "server hello, adding CID extension" \ |
| 2249 | -c "found CID extension" \ |
| 2250 | -c "Use of CID extension negotiated" \ |
| 2251 | -s "Copy CIDs into SSL transform" \ |
| 2252 | -c "Copy CIDs into SSL transform" \ |
| 2253 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2254 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2255 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2256 | -c "Use of Connection ID has been negotiated" \ |
| 2257 | -c "ignoring unexpected CID" \ |
| 2258 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2259 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2260 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2261 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2262 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 2263 | -p "$P_PXY mtu=800" \ |
| 2264 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2265 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2266 | 0 \ |
| 2267 | -c "Enable use of CID extension." \ |
| 2268 | -s "Enable use of CID extension." \ |
| 2269 | -c "client hello, adding CID extension" \ |
| 2270 | -s "found CID extension" \ |
| 2271 | -s "Use of CID extension negotiated" \ |
| 2272 | -s "server hello, adding CID extension" \ |
| 2273 | -c "found CID extension" \ |
| 2274 | -c "Use of CID extension negotiated" \ |
| 2275 | -s "Copy CIDs into SSL transform" \ |
| 2276 | -c "Copy CIDs into SSL transform" \ |
| 2277 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2278 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2279 | -s "Use of Connection ID has been negotiated" \ |
| 2280 | -c "Use of Connection ID has been negotiated" |
| 2281 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2282 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2283 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2284 | 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] | 2285 | -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] | 2286 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2287 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2288 | 0 \ |
| 2289 | -c "Enable use of CID extension." \ |
| 2290 | -s "Enable use of CID extension." \ |
| 2291 | -c "client hello, adding CID extension" \ |
| 2292 | -s "found CID extension" \ |
| 2293 | -s "Use of CID extension negotiated" \ |
| 2294 | -s "server hello, adding CID extension" \ |
| 2295 | -c "found CID extension" \ |
| 2296 | -c "Use of CID extension negotiated" \ |
| 2297 | -s "Copy CIDs into SSL transform" \ |
| 2298 | -c "Copy CIDs into SSL transform" \ |
| 2299 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2300 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2301 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2302 | -c "Use of Connection ID has been negotiated" \ |
| 2303 | -c "ignoring unexpected CID" \ |
| 2304 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2305 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2306 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2307 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2308 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2309 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2310 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2311 | 0 \ |
| 2312 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2313 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2314 | -c "client hello, adding CID extension" \ |
| 2315 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2316 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2317 | -s "server hello, adding CID extension" \ |
| 2318 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2319 | -c "Use of CID extension negotiated" \ |
| 2320 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2321 | -c "Copy CIDs into SSL transform" \ |
| 2322 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2323 | -s "Peer CID (length 0 Bytes):" \ |
| 2324 | -s "Use of Connection ID has been negotiated" \ |
| 2325 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2326 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2327 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2328 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2329 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2330 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2331 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2332 | 0 \ |
| 2333 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2334 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2335 | -c "client hello, adding CID extension" \ |
| 2336 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2337 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2338 | -s "server hello, adding CID extension" \ |
| 2339 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2340 | -c "Use of CID extension negotiated" \ |
| 2341 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2342 | -c "Copy CIDs into SSL transform" \ |
| 2343 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2344 | -c "Peer CID (length 0 Bytes):" \ |
| 2345 | -s "Use of Connection ID has been negotiated" \ |
| 2346 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2347 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2348 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2349 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2350 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2351 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2352 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2353 | 0 \ |
| 2354 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2355 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2356 | -c "client hello, adding CID extension" \ |
| 2357 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2358 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2359 | -s "server hello, adding CID extension" \ |
| 2360 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2361 | -c "Use of CID extension negotiated" \ |
| 2362 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2363 | -c "Copy CIDs into SSL transform" \ |
| 2364 | -S "Use of Connection ID has been negotiated" \ |
| 2365 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2366 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2367 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2368 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2369 | 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] | 2370 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2371 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2372 | 0 \ |
| 2373 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2374 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2375 | -c "client hello, adding CID extension" \ |
| 2376 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2377 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2378 | -s "server hello, adding CID extension" \ |
| 2379 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2380 | -c "Use of CID extension negotiated" \ |
| 2381 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2382 | -c "Copy CIDs into SSL transform" \ |
| 2383 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2384 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2385 | -s "Use of Connection ID has been negotiated" \ |
| 2386 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2387 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2388 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2389 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2390 | 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] | 2391 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2392 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2393 | 0 \ |
| 2394 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2395 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2396 | -c "client hello, adding CID extension" \ |
| 2397 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2398 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2399 | -s "server hello, adding CID extension" \ |
| 2400 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2401 | -c "Use of CID extension negotiated" \ |
| 2402 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2403 | -c "Copy CIDs into SSL transform" \ |
| 2404 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2405 | -s "Peer CID (length 0 Bytes):" \ |
| 2406 | -s "Use of Connection ID has been negotiated" \ |
| 2407 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2408 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2409 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2410 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2411 | 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] | 2412 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2413 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2414 | 0 \ |
| 2415 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2416 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2417 | -c "client hello, adding CID extension" \ |
| 2418 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2419 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2420 | -s "server hello, adding CID extension" \ |
| 2421 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2422 | -c "Use of CID extension negotiated" \ |
| 2423 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2424 | -c "Copy CIDs into SSL transform" \ |
| 2425 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2426 | -c "Peer CID (length 0 Bytes):" \ |
| 2427 | -s "Use of Connection ID has been negotiated" \ |
| 2428 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2429 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2430 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2431 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2432 | 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] | 2433 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2434 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2435 | 0 \ |
| 2436 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2437 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2438 | -c "client hello, adding CID extension" \ |
| 2439 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2440 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2441 | -s "server hello, adding CID extension" \ |
| 2442 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2443 | -c "Use of CID extension negotiated" \ |
| 2444 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2445 | -c "Copy CIDs into SSL transform" \ |
| 2446 | -S "Use of Connection ID has been negotiated" \ |
| 2447 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2448 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2449 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2450 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2451 | 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] | 2452 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2453 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2454 | 0 \ |
| 2455 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2456 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2457 | -c "client hello, adding CID extension" \ |
| 2458 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2459 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2460 | -s "server hello, adding CID extension" \ |
| 2461 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2462 | -c "Use of CID extension negotiated" \ |
| 2463 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2464 | -c "Copy CIDs into SSL transform" \ |
| 2465 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2466 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2467 | -s "Use of Connection ID has been negotiated" \ |
| 2468 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2469 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2470 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2471 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2472 | 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] | 2473 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2474 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2475 | 0 \ |
| 2476 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2477 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2478 | -c "client hello, adding CID extension" \ |
| 2479 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2480 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2481 | -s "server hello, adding CID extension" \ |
| 2482 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2483 | -c "Use of CID extension negotiated" \ |
| 2484 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2485 | -c "Copy CIDs into SSL transform" \ |
| 2486 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2487 | -s "Peer CID (length 0 Bytes):" \ |
| 2488 | -s "Use of Connection ID has been negotiated" \ |
| 2489 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2490 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2491 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2492 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2493 | 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] | 2494 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2495 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2496 | 0 \ |
| 2497 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2498 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2499 | -c "client hello, adding CID extension" \ |
| 2500 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2501 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2502 | -s "server hello, adding CID extension" \ |
| 2503 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2504 | -c "Use of CID extension negotiated" \ |
| 2505 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2506 | -c "Copy CIDs into SSL transform" \ |
| 2507 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2508 | -c "Peer CID (length 0 Bytes):" \ |
| 2509 | -s "Use of Connection ID has been negotiated" \ |
| 2510 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2511 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2512 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2513 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2514 | 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] | 2515 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2516 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2517 | 0 \ |
| 2518 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2519 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2520 | -c "client hello, adding CID extension" \ |
| 2521 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2522 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2523 | -s "server hello, adding CID extension" \ |
| 2524 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2525 | -c "Use of CID extension negotiated" \ |
| 2526 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2527 | -c "Copy CIDs into SSL transform" \ |
| 2528 | -S "Use of Connection ID has been negotiated" \ |
| 2529 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2530 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2531 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2532 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 2533 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2534 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2535 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2536 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2537 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2538 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2539 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2540 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2541 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2542 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2543 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2544 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2545 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2546 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2547 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2548 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2549 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2550 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2551 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2552 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2553 | 0 \ |
| 2554 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2555 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2556 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2557 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2558 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2559 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2560 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2561 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2562 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2563 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2564 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2565 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2566 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 2567 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2568 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2569 | 0 \ |
| 2570 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2571 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2572 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2573 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2574 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2575 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2576 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2577 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2578 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2579 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2580 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2581 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2582 | 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] | 2583 | -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] | 2584 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2585 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2586 | 0 \ |
| 2587 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2588 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2589 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2590 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2591 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2592 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2593 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2594 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2595 | -c "ignoring unexpected CID" \ |
| 2596 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2597 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2598 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2599 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2600 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2601 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2602 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2603 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2604 | 0 \ |
| 2605 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2606 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2607 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2608 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2609 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2610 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2611 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2612 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2613 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2614 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2615 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2616 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2617 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 2618 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2619 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2620 | 0 \ |
| 2621 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2622 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2623 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2624 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2625 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2626 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2627 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2628 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 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 | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2632 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2633 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2634 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2635 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2636 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2637 | 0 \ |
| 2638 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2639 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2640 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2641 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2642 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2643 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2644 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2645 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2646 | -c "ignoring unexpected CID" \ |
| 2647 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2648 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2649 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2650 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2651 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2652 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2653 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2654 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2655 | 0 \ |
| 2656 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2657 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2658 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2659 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2660 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2661 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2662 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2663 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2664 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2665 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2666 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 2667 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2668 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2669 | 0 \ |
| 2670 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2671 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2672 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2673 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2674 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2675 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2676 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2677 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2678 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2679 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2680 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2681 | -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] | 2682 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2683 | "$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" \ |
| 2684 | 0 \ |
| 2685 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2686 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2687 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2688 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2689 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2690 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2691 | -c "ignoring unexpected CID" \ |
| 2692 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2693 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2694 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2695 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2696 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2697 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2698 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2699 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2700 | 0 \ |
| 2701 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2702 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2703 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2704 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2705 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2706 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2707 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2708 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2709 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 2710 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2711 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2712 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2713 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2714 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2715 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2716 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2717 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2718 | 0 \ |
| 2719 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2720 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2721 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2722 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2723 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2724 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2725 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2726 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2727 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2728 | -c "ignoring unexpected CID" \ |
| 2729 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2730 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2731 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2732 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2733 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2734 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 2735 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2736 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2737 | 0 \ |
| 2738 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2739 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2740 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2741 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2742 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2743 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2744 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2745 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2746 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2747 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2748 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2749 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2750 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2751 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2752 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2753 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2754 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2755 | 0 \ |
| 2756 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2757 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2758 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2759 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2760 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2761 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2762 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2763 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2764 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2765 | -c "ignoring unexpected CID" \ |
| 2766 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2767 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 2768 | # 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] | 2769 | # tests check that the buffer contents are reallocated when the message is |
| 2770 | # larger than the buffer. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2771 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2772 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2773 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2774 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2775 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 2776 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2777 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 2778 | 0 \ |
| 2779 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2780 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2781 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2782 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2783 | -s "Reallocating in_buf" \ |
| 2784 | -s "Reallocating out_buf" |
| 2785 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2786 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2787 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2788 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2789 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2790 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 2791 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2792 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 2793 | 0 \ |
| 2794 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2795 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2796 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2797 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2798 | -s "Reallocating in_buf" \ |
| 2799 | -s "Reallocating out_buf" |
| 2800 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2801 | # Tests for Encrypt-then-MAC extension |
| 2802 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2803 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2804 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2805 | "$P_SRV debug_level=3 \ |
| 2806 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2807 | "$P_CLI debug_level=3" \ |
| 2808 | 0 \ |
| 2809 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2810 | -s "found encrypt then mac extension" \ |
| 2811 | -s "server hello, adding encrypt then mac extension" \ |
| 2812 | -c "found encrypt_then_mac extension" \ |
| 2813 | -c "using encrypt then mac" \ |
| 2814 | -s "using encrypt then mac" |
| 2815 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2816 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2817 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2818 | "$P_SRV debug_level=3 etm=0 \ |
| 2819 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2820 | "$P_CLI debug_level=3 etm=1" \ |
| 2821 | 0 \ |
| 2822 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2823 | -s "found encrypt then mac extension" \ |
| 2824 | -S "server hello, adding encrypt then mac extension" \ |
| 2825 | -C "found encrypt_then_mac extension" \ |
| 2826 | -C "using encrypt then mac" \ |
| 2827 | -S "using encrypt then mac" |
| 2828 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2829 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2830 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 2831 | "$P_SRV debug_level=3 etm=1 \ |
| 2832 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 2833 | "$P_CLI debug_level=3 etm=1" \ |
| 2834 | 0 \ |
| 2835 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2836 | -s "found encrypt then mac extension" \ |
| 2837 | -S "server hello, adding encrypt then mac extension" \ |
| 2838 | -C "found encrypt_then_mac extension" \ |
| 2839 | -C "using encrypt then mac" \ |
| 2840 | -S "using encrypt then mac" |
| 2841 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2842 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2843 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2844 | "$P_SRV debug_level=3 etm=1 \ |
| 2845 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2846 | "$P_CLI debug_level=3 etm=0" \ |
| 2847 | 0 \ |
| 2848 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2849 | -S "found encrypt then mac extension" \ |
| 2850 | -S "server hello, adding encrypt then mac extension" \ |
| 2851 | -C "found encrypt_then_mac extension" \ |
| 2852 | -C "using encrypt then mac" \ |
| 2853 | -S "using encrypt then mac" |
| 2854 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2855 | # Tests for Extended Master Secret extension |
| 2856 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2857 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 2858 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2859 | run_test "Extended Master Secret: default" \ |
| 2860 | "$P_SRV debug_level=3" \ |
| 2861 | "$P_CLI debug_level=3" \ |
| 2862 | 0 \ |
| 2863 | -c "client hello, adding extended_master_secret extension" \ |
| 2864 | -s "found extended master secret extension" \ |
| 2865 | -s "server hello, adding extended master secret extension" \ |
| 2866 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2867 | -c "session hash for extended master secret" \ |
| 2868 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2869 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2870 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 2871 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2872 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 2873 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 2874 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 2875 | 0 \ |
| 2876 | -c "client hello, adding extended_master_secret extension" \ |
| 2877 | -s "found extended master secret extension" \ |
| 2878 | -S "server hello, adding extended master secret extension" \ |
| 2879 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2880 | -C "session hash for extended master secret" \ |
| 2881 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2882 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2883 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 2884 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2885 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 2886 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 2887 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 2888 | 0 \ |
| 2889 | -C "client hello, adding extended_master_secret extension" \ |
| 2890 | -S "found extended master secret extension" \ |
| 2891 | -S "server hello, adding extended master secret extension" \ |
| 2892 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2893 | -C "session hash for extended master secret" \ |
| 2894 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2895 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2896 | # Test sending and receiving empty application data records |
| 2897 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2898 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2899 | run_test "Encrypt then MAC: empty application data record" \ |
| 2900 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 2901 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 2902 | 0 \ |
| 2903 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2904 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2905 | -c "0 bytes written in 1 fragments" |
| 2906 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2907 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2908 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2909 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 2910 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 2911 | 0 \ |
| 2912 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2913 | -c "0 bytes written in 1 fragments" |
| 2914 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2915 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2916 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 2917 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 2918 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 2919 | 0 \ |
| 2920 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2921 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2922 | -c "0 bytes written in 1 fragments" |
| 2923 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2924 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2925 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2926 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 2927 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 2928 | 0 \ |
| 2929 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2930 | -c "0 bytes written in 1 fragments" |
| 2931 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2932 | # Tests for CBC 1/n-1 record splitting |
| 2933 | |
| 2934 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 2935 | "$P_SRV" \ |
| 2936 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 2937 | request_size=123 force_version=tls12" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2938 | 0 \ |
| 2939 | -s "Read from client: 123 bytes read" \ |
| 2940 | -S "Read from client: 1 bytes read" \ |
| 2941 | -S "122 bytes read" |
| 2942 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2943 | # Tests for Session Tickets |
| 2944 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2945 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2946 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2947 | "$P_SRV debug_level=3 tickets=1" \ |
| 2948 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2949 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2950 | -c "client hello, adding session ticket extension" \ |
| 2951 | -s "found session ticket extension" \ |
| 2952 | -s "server hello, adding session ticket extension" \ |
| 2953 | -c "found session_ticket extension" \ |
| 2954 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2955 | -S "session successfully restored from cache" \ |
| 2956 | -s "session successfully restored from ticket" \ |
| 2957 | -s "a session has been resumed" \ |
| 2958 | -c "a session has been resumed" |
| 2959 | |
Jerry Yu | baa4934 | 2022-02-15 10:26:40 +0800 | [diff] [blame] | 2960 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 2961 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 2962 | run_test "Session resume using tickets: manual rotation" \ |
| 2963 | "$P_SRV debug_level=3 tickets=1 ticket_rotate=1" \ |
| 2964 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2965 | 0 \ |
| 2966 | -c "client hello, adding session ticket extension" \ |
| 2967 | -s "found session ticket extension" \ |
| 2968 | -s "server hello, adding session ticket extension" \ |
| 2969 | -c "found session_ticket extension" \ |
| 2970 | -c "parse new session ticket" \ |
| 2971 | -S "session successfully restored from cache" \ |
| 2972 | -s "session successfully restored from ticket" \ |
| 2973 | -s "a session has been resumed" \ |
| 2974 | -c "a session has been resumed" |
| 2975 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2976 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2977 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2978 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2979 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2980 | 0 \ |
| 2981 | -c "client hello, adding session ticket extension" \ |
| 2982 | -s "found session ticket extension" \ |
| 2983 | -s "server hello, adding session ticket extension" \ |
| 2984 | -c "found session_ticket extension" \ |
| 2985 | -c "parse new session ticket" \ |
| 2986 | -S "session successfully restored from cache" \ |
| 2987 | -s "session successfully restored from ticket" \ |
| 2988 | -s "a session has been resumed" \ |
| 2989 | -c "a session has been resumed" |
| 2990 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2991 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2992 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2993 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2994 | "$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] | 2995 | 0 \ |
| 2996 | -c "client hello, adding session ticket extension" \ |
| 2997 | -s "found session ticket extension" \ |
| 2998 | -s "server hello, adding session ticket extension" \ |
| 2999 | -c "found session_ticket extension" \ |
| 3000 | -c "parse new session ticket" \ |
| 3001 | -S "session successfully restored from cache" \ |
| 3002 | -S "session successfully restored from ticket" \ |
| 3003 | -S "a session has been resumed" \ |
| 3004 | -C "a session has been resumed" |
| 3005 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3006 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3007 | run_test "Session resume using tickets: session copy" \ |
| 3008 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 3009 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 3010 | 0 \ |
| 3011 | -c "client hello, adding session ticket extension" \ |
| 3012 | -s "found session ticket extension" \ |
| 3013 | -s "server hello, adding session ticket extension" \ |
| 3014 | -c "found session_ticket extension" \ |
| 3015 | -c "parse new session ticket" \ |
| 3016 | -S "session successfully restored from cache" \ |
| 3017 | -s "session successfully restored from ticket" \ |
| 3018 | -s "a session has been resumed" \ |
| 3019 | -c "a session has been resumed" |
| 3020 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3021 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3022 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 3023 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3024 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3025 | 0 \ |
| 3026 | -c "client hello, adding session ticket extension" \ |
| 3027 | -c "found session_ticket extension" \ |
| 3028 | -c "parse new session ticket" \ |
| 3029 | -c "a session has been resumed" |
| 3030 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3031 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3032 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3033 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3034 | "( $O_CLI -sess_out $SESSION; \ |
| 3035 | $O_CLI -sess_in $SESSION; \ |
| 3036 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3037 | 0 \ |
| 3038 | -s "found session ticket extension" \ |
| 3039 | -s "server hello, adding session ticket extension" \ |
| 3040 | -S "session successfully restored from cache" \ |
| 3041 | -s "session successfully restored from ticket" \ |
| 3042 | -s "a session has been resumed" |
| 3043 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3044 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3045 | run_test "Session resume using tickets: AES-128-GCM" \ |
| 3046 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-GCM" \ |
| 3047 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3048 | 0 \ |
| 3049 | -c "client hello, adding session ticket extension" \ |
| 3050 | -s "found session ticket extension" \ |
| 3051 | -s "server hello, adding session ticket extension" \ |
| 3052 | -c "found session_ticket extension" \ |
| 3053 | -c "parse new session ticket" \ |
| 3054 | -S "session successfully restored from cache" \ |
| 3055 | -s "session successfully restored from ticket" \ |
| 3056 | -s "a session has been resumed" \ |
| 3057 | -c "a session has been resumed" |
| 3058 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3059 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3060 | run_test "Session resume using tickets: AES-192-GCM" \ |
| 3061 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-GCM" \ |
| 3062 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3063 | 0 \ |
| 3064 | -c "client hello, adding session ticket extension" \ |
| 3065 | -s "found session ticket extension" \ |
| 3066 | -s "server hello, adding session ticket extension" \ |
| 3067 | -c "found session_ticket extension" \ |
| 3068 | -c "parse new session ticket" \ |
| 3069 | -S "session successfully restored from cache" \ |
| 3070 | -s "session successfully restored from ticket" \ |
| 3071 | -s "a session has been resumed" \ |
| 3072 | -c "a session has been resumed" |
| 3073 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3074 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3075 | run_test "Session resume using tickets: AES-128-CCM" \ |
| 3076 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-CCM" \ |
| 3077 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3078 | 0 \ |
| 3079 | -c "client hello, adding session ticket extension" \ |
| 3080 | -s "found session ticket extension" \ |
| 3081 | -s "server hello, adding session ticket extension" \ |
| 3082 | -c "found session_ticket extension" \ |
| 3083 | -c "parse new session ticket" \ |
| 3084 | -S "session successfully restored from cache" \ |
| 3085 | -s "session successfully restored from ticket" \ |
| 3086 | -s "a session has been resumed" \ |
| 3087 | -c "a session has been resumed" |
| 3088 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3089 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3090 | run_test "Session resume using tickets: AES-192-CCM" \ |
| 3091 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-CCM" \ |
| 3092 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3093 | 0 \ |
| 3094 | -c "client hello, adding session ticket extension" \ |
| 3095 | -s "found session ticket extension" \ |
| 3096 | -s "server hello, adding session ticket extension" \ |
| 3097 | -c "found session_ticket extension" \ |
| 3098 | -c "parse new session ticket" \ |
| 3099 | -S "session successfully restored from cache" \ |
| 3100 | -s "session successfully restored from ticket" \ |
| 3101 | -s "a session has been resumed" \ |
| 3102 | -c "a session has been resumed" |
| 3103 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3104 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3105 | run_test "Session resume using tickets: AES-256-CCM" \ |
| 3106 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-256-CCM" \ |
| 3107 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3108 | 0 \ |
| 3109 | -c "client hello, adding session ticket extension" \ |
| 3110 | -s "found session ticket extension" \ |
| 3111 | -s "server hello, adding session ticket extension" \ |
| 3112 | -c "found session_ticket extension" \ |
| 3113 | -c "parse new session ticket" \ |
| 3114 | -S "session successfully restored from cache" \ |
| 3115 | -s "session successfully restored from ticket" \ |
| 3116 | -s "a session has been resumed" \ |
| 3117 | -c "a session has been resumed" |
| 3118 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3119 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3120 | run_test "Session resume using tickets: CAMELLIA-128-CCM" \ |
| 3121 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-128-CCM" \ |
| 3122 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3123 | 0 \ |
| 3124 | -c "client hello, adding session ticket extension" \ |
| 3125 | -s "found session ticket extension" \ |
| 3126 | -s "server hello, adding session ticket extension" \ |
| 3127 | -c "found session_ticket extension" \ |
| 3128 | -c "parse new session ticket" \ |
| 3129 | -S "session successfully restored from cache" \ |
| 3130 | -s "session successfully restored from ticket" \ |
| 3131 | -s "a session has been resumed" \ |
| 3132 | -c "a session has been resumed" |
| 3133 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3134 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3135 | run_test "Session resume using tickets: CAMELLIA-192-CCM" \ |
| 3136 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-192-CCM" \ |
| 3137 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3138 | 0 \ |
| 3139 | -c "client hello, adding session ticket extension" \ |
| 3140 | -s "found session ticket extension" \ |
| 3141 | -s "server hello, adding session ticket extension" \ |
| 3142 | -c "found session_ticket extension" \ |
| 3143 | -c "parse new session ticket" \ |
| 3144 | -S "session successfully restored from cache" \ |
| 3145 | -s "session successfully restored from ticket" \ |
| 3146 | -s "a session has been resumed" \ |
| 3147 | -c "a session has been resumed" |
| 3148 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3149 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3150 | run_test "Session resume using tickets: CAMELLIA-256-CCM" \ |
| 3151 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-256-CCM" \ |
| 3152 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3153 | 0 \ |
| 3154 | -c "client hello, adding session ticket extension" \ |
| 3155 | -s "found session ticket extension" \ |
| 3156 | -s "server hello, adding session ticket extension" \ |
| 3157 | -c "found session_ticket extension" \ |
| 3158 | -c "parse new session ticket" \ |
| 3159 | -S "session successfully restored from cache" \ |
| 3160 | -s "session successfully restored from ticket" \ |
| 3161 | -s "a session has been resumed" \ |
| 3162 | -c "a session has been resumed" |
| 3163 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3164 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3165 | run_test "Session resume using tickets: ARIA-128-GCM" \ |
| 3166 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-GCM" \ |
| 3167 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3168 | 0 \ |
| 3169 | -c "client hello, adding session ticket extension" \ |
| 3170 | -s "found session ticket extension" \ |
| 3171 | -s "server hello, adding session ticket extension" \ |
| 3172 | -c "found session_ticket extension" \ |
| 3173 | -c "parse new session ticket" \ |
| 3174 | -S "session successfully restored from cache" \ |
| 3175 | -s "session successfully restored from ticket" \ |
| 3176 | -s "a session has been resumed" \ |
| 3177 | -c "a session has been resumed" |
| 3178 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3179 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3180 | run_test "Session resume using tickets: ARIA-192-GCM" \ |
| 3181 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-GCM" \ |
| 3182 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3183 | 0 \ |
| 3184 | -c "client hello, adding session ticket extension" \ |
| 3185 | -s "found session ticket extension" \ |
| 3186 | -s "server hello, adding session ticket extension" \ |
| 3187 | -c "found session_ticket extension" \ |
| 3188 | -c "parse new session ticket" \ |
| 3189 | -S "session successfully restored from cache" \ |
| 3190 | -s "session successfully restored from ticket" \ |
| 3191 | -s "a session has been resumed" \ |
| 3192 | -c "a session has been resumed" |
| 3193 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3194 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3195 | run_test "Session resume using tickets: ARIA-256-GCM" \ |
| 3196 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-GCM" \ |
| 3197 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3198 | 0 \ |
| 3199 | -c "client hello, adding session ticket extension" \ |
| 3200 | -s "found session ticket extension" \ |
| 3201 | -s "server hello, adding session ticket extension" \ |
| 3202 | -c "found session_ticket extension" \ |
| 3203 | -c "parse new session ticket" \ |
| 3204 | -S "session successfully restored from cache" \ |
| 3205 | -s "session successfully restored from ticket" \ |
| 3206 | -s "a session has been resumed" \ |
| 3207 | -c "a session has been resumed" |
| 3208 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3209 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3210 | run_test "Session resume using tickets: ARIA-128-CCM" \ |
| 3211 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-CCM" \ |
| 3212 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3213 | 0 \ |
| 3214 | -c "client hello, adding session ticket extension" \ |
| 3215 | -s "found session ticket extension" \ |
| 3216 | -s "server hello, adding session ticket extension" \ |
| 3217 | -c "found session_ticket extension" \ |
| 3218 | -c "parse new session ticket" \ |
| 3219 | -S "session successfully restored from cache" \ |
| 3220 | -s "session successfully restored from ticket" \ |
| 3221 | -s "a session has been resumed" \ |
| 3222 | -c "a session has been resumed" |
| 3223 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3224 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3225 | run_test "Session resume using tickets: ARIA-192-CCM" \ |
| 3226 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-CCM" \ |
| 3227 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3228 | 0 \ |
| 3229 | -c "client hello, adding session ticket extension" \ |
| 3230 | -s "found session ticket extension" \ |
| 3231 | -s "server hello, adding session ticket extension" \ |
| 3232 | -c "found session_ticket extension" \ |
| 3233 | -c "parse new session ticket" \ |
| 3234 | -S "session successfully restored from cache" \ |
| 3235 | -s "session successfully restored from ticket" \ |
| 3236 | -s "a session has been resumed" \ |
| 3237 | -c "a session has been resumed" |
| 3238 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3239 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3240 | run_test "Session resume using tickets: ARIA-256-CCM" \ |
| 3241 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-CCM" \ |
| 3242 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3243 | 0 \ |
| 3244 | -c "client hello, adding session ticket extension" \ |
| 3245 | -s "found session ticket extension" \ |
| 3246 | -s "server hello, adding session ticket extension" \ |
| 3247 | -c "found session_ticket extension" \ |
| 3248 | -c "parse new session ticket" \ |
| 3249 | -S "session successfully restored from cache" \ |
| 3250 | -s "session successfully restored from ticket" \ |
| 3251 | -s "a session has been resumed" \ |
| 3252 | -c "a session has been resumed" |
| 3253 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3254 | # Tests for Session Tickets with DTLS |
| 3255 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3256 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3257 | run_test "Session resume using tickets, DTLS: basic" \ |
| 3258 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3259 | "$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] | 3260 | 0 \ |
| 3261 | -c "client hello, adding session ticket extension" \ |
| 3262 | -s "found session ticket extension" \ |
| 3263 | -s "server hello, adding session ticket extension" \ |
| 3264 | -c "found session_ticket extension" \ |
| 3265 | -c "parse new session ticket" \ |
| 3266 | -S "session successfully restored from cache" \ |
| 3267 | -s "session successfully restored from ticket" \ |
| 3268 | -s "a session has been resumed" \ |
| 3269 | -c "a session has been resumed" |
| 3270 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3271 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3272 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 3273 | "$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] | 3274 | "$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] | 3275 | 0 \ |
| 3276 | -c "client hello, adding session ticket extension" \ |
| 3277 | -s "found session ticket extension" \ |
| 3278 | -s "server hello, adding session ticket extension" \ |
| 3279 | -c "found session_ticket extension" \ |
| 3280 | -c "parse new session ticket" \ |
| 3281 | -S "session successfully restored from cache" \ |
| 3282 | -s "session successfully restored from ticket" \ |
| 3283 | -s "a session has been resumed" \ |
| 3284 | -c "a session has been resumed" |
| 3285 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3286 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3287 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 3288 | "$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] | 3289 | "$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] | 3290 | 0 \ |
| 3291 | -c "client hello, adding session ticket extension" \ |
| 3292 | -s "found session ticket extension" \ |
| 3293 | -s "server hello, adding session ticket extension" \ |
| 3294 | -c "found session_ticket extension" \ |
| 3295 | -c "parse new session ticket" \ |
| 3296 | -S "session successfully restored from cache" \ |
| 3297 | -S "session successfully restored from ticket" \ |
| 3298 | -S "a session has been resumed" \ |
| 3299 | -C "a session has been resumed" |
| 3300 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3301 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3302 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 3303 | "$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] | 3304 | "$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] | 3305 | 0 \ |
| 3306 | -c "client hello, adding session ticket extension" \ |
| 3307 | -s "found session ticket extension" \ |
| 3308 | -s "server hello, adding session ticket extension" \ |
| 3309 | -c "found session_ticket extension" \ |
| 3310 | -c "parse new session ticket" \ |
| 3311 | -S "session successfully restored from cache" \ |
| 3312 | -s "session successfully restored from ticket" \ |
| 3313 | -s "a session has been resumed" \ |
| 3314 | -c "a session has been resumed" |
| 3315 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3316 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3317 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 3318 | "$O_SRV -dtls" \ |
| 3319 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 3320 | 0 \ |
| 3321 | -c "client hello, adding session ticket extension" \ |
| 3322 | -c "found session_ticket extension" \ |
| 3323 | -c "parse new session ticket" \ |
| 3324 | -c "a session has been resumed" |
| 3325 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3326 | # 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] | 3327 | # 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] | 3328 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3329 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3330 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 3331 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3332 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 3333 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3334 | rm -f $SESSION )" \ |
| 3335 | 0 \ |
| 3336 | -s "found session ticket extension" \ |
| 3337 | -s "server hello, adding session ticket extension" \ |
| 3338 | -S "session successfully restored from cache" \ |
| 3339 | -s "session successfully restored from ticket" \ |
| 3340 | -s "a session has been resumed" |
| 3341 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3342 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3343 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3344 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3345 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3346 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3347 | "$P_SRV debug_level=3 tickets=0" \ |
| 3348 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3349 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3350 | -c "client hello, adding session ticket extension" \ |
| 3351 | -s "found session ticket extension" \ |
| 3352 | -S "server hello, adding session ticket extension" \ |
| 3353 | -C "found session_ticket extension" \ |
| 3354 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3355 | -s "session successfully restored from cache" \ |
| 3356 | -S "session successfully restored from ticket" \ |
| 3357 | -s "a session has been resumed" \ |
| 3358 | -c "a session has been resumed" |
| 3359 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3360 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3361 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3362 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3363 | "$P_SRV debug_level=3 tickets=1" \ |
| 3364 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3365 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3366 | -C "client hello, adding session ticket extension" \ |
| 3367 | -S "found session ticket extension" \ |
| 3368 | -S "server hello, adding session ticket extension" \ |
| 3369 | -C "found session_ticket extension" \ |
| 3370 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3371 | -s "session successfully restored from cache" \ |
| 3372 | -S "session successfully restored from ticket" \ |
| 3373 | -s "a session has been resumed" \ |
| 3374 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3375 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3376 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3377 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3378 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3379 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 3380 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3381 | 0 \ |
| 3382 | -S "session successfully restored from cache" \ |
| 3383 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3384 | -S "a session has been resumed" \ |
| 3385 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3386 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3387 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3388 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3389 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3390 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 3391 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3392 | 0 \ |
| 3393 | -s "session successfully restored from cache" \ |
| 3394 | -S "session successfully restored from ticket" \ |
| 3395 | -s "a session has been resumed" \ |
| 3396 | -c "a session has been resumed" |
| 3397 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3398 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3399 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 3400 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3401 | "$P_SRV debug_level=3 tickets=0" \ |
| 3402 | "$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] | 3403 | 0 \ |
| 3404 | -s "session successfully restored from cache" \ |
| 3405 | -S "session successfully restored from ticket" \ |
| 3406 | -s "a session has been resumed" \ |
| 3407 | -c "a session has been resumed" |
| 3408 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3409 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3410 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3411 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3412 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 3413 | "$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] | 3414 | 0 \ |
| 3415 | -S "session successfully restored from cache" \ |
| 3416 | -S "session successfully restored from ticket" \ |
| 3417 | -S "a session has been resumed" \ |
| 3418 | -C "a session has been resumed" |
| 3419 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3420 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3421 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3422 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3423 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 3424 | "$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] | 3425 | 0 \ |
| 3426 | -s "session successfully restored from cache" \ |
| 3427 | -S "session successfully restored from ticket" \ |
| 3428 | -s "a session has been resumed" \ |
| 3429 | -c "a session has been resumed" |
| 3430 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3431 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3432 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3433 | run_test "Session resume using cache: session copy" \ |
| 3434 | "$P_SRV debug_level=3 tickets=0" \ |
| 3435 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 3436 | 0 \ |
| 3437 | -s "session successfully restored from cache" \ |
| 3438 | -S "session successfully restored from ticket" \ |
| 3439 | -s "a session has been resumed" \ |
| 3440 | -c "a session has been resumed" |
| 3441 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3442 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3443 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3444 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3445 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3446 | "( $O_CLI -sess_out $SESSION; \ |
| 3447 | $O_CLI -sess_in $SESSION; \ |
| 3448 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 3449 | 0 \ |
| 3450 | -s "found session ticket extension" \ |
| 3451 | -S "server hello, adding session ticket extension" \ |
| 3452 | -s "session successfully restored from cache" \ |
| 3453 | -S "session successfully restored from ticket" \ |
| 3454 | -s "a session has been resumed" |
| 3455 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3456 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3457 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3458 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 3459 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3460 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 3461 | 0 \ |
| 3462 | -C "found session_ticket extension" \ |
| 3463 | -C "parse new session ticket" \ |
| 3464 | -c "a session has been resumed" |
| 3465 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3466 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 3467 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3468 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3469 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3470 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 3471 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3472 | "$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] | 3473 | 0 \ |
| 3474 | -c "client hello, adding session ticket extension" \ |
| 3475 | -s "found session ticket extension" \ |
| 3476 | -S "server hello, adding session ticket extension" \ |
| 3477 | -C "found session_ticket extension" \ |
| 3478 | -C "parse new session ticket" \ |
| 3479 | -s "session successfully restored from cache" \ |
| 3480 | -S "session successfully restored from ticket" \ |
| 3481 | -s "a session has been resumed" \ |
| 3482 | -c "a session has been resumed" |
| 3483 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3484 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3485 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3486 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 3487 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3488 | "$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] | 3489 | 0 \ |
| 3490 | -C "client hello, adding session ticket extension" \ |
| 3491 | -S "found session ticket extension" \ |
| 3492 | -S "server hello, adding session ticket extension" \ |
| 3493 | -C "found session_ticket extension" \ |
| 3494 | -C "parse new session ticket" \ |
| 3495 | -s "session successfully restored from cache" \ |
| 3496 | -S "session successfully restored from ticket" \ |
| 3497 | -s "a session has been resumed" \ |
| 3498 | -c "a session has been resumed" |
| 3499 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3500 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3501 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3502 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 3503 | "$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] | 3504 | "$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] | 3505 | 0 \ |
| 3506 | -S "session successfully restored from cache" \ |
| 3507 | -S "session successfully restored from ticket" \ |
| 3508 | -S "a session has been resumed" \ |
| 3509 | -C "a session has been resumed" |
| 3510 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3511 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3512 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3513 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 3514 | "$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] | 3515 | "$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] | 3516 | 0 \ |
| 3517 | -s "session successfully restored from cache" \ |
| 3518 | -S "session successfully restored from ticket" \ |
| 3519 | -s "a session has been resumed" \ |
| 3520 | -c "a session has been resumed" |
| 3521 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3522 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3523 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3524 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 3525 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3526 | "$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] | 3527 | 0 \ |
| 3528 | -s "session successfully restored from cache" \ |
| 3529 | -S "session successfully restored from ticket" \ |
| 3530 | -s "a session has been resumed" \ |
| 3531 | -c "a session has been resumed" |
| 3532 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3533 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3534 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3535 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 3536 | "$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] | 3537 | "$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] | 3538 | 0 \ |
| 3539 | -S "session successfully restored from cache" \ |
| 3540 | -S "session successfully restored from ticket" \ |
| 3541 | -S "a session has been resumed" \ |
| 3542 | -C "a session has been resumed" |
| 3543 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3544 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3545 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3546 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 3547 | "$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] | 3548 | "$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] | 3549 | 0 \ |
| 3550 | -s "session successfully restored from cache" \ |
| 3551 | -S "session successfully restored from ticket" \ |
| 3552 | -s "a session has been resumed" \ |
| 3553 | -c "a session has been resumed" |
| 3554 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3555 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3556 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3557 | run_test "Session resume using cache, DTLS: session copy" \ |
| 3558 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3559 | "$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] | 3560 | 0 \ |
| 3561 | -s "session successfully restored from cache" \ |
| 3562 | -S "session successfully restored from ticket" \ |
| 3563 | -s "a session has been resumed" \ |
| 3564 | -c "a session has been resumed" |
| 3565 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3566 | # 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] | 3567 | # 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] | 3568 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3569 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3570 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3571 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 3572 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3573 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 3574 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3575 | rm -f $SESSION )" \ |
| 3576 | 0 \ |
| 3577 | -s "found session ticket extension" \ |
| 3578 | -S "server hello, adding session ticket extension" \ |
| 3579 | -s "session successfully restored from cache" \ |
| 3580 | -S "session successfully restored from ticket" \ |
| 3581 | -s "a session has been resumed" |
| 3582 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3583 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3584 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3585 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 3586 | "$O_SRV -dtls" \ |
| 3587 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 3588 | 0 \ |
| 3589 | -C "found session_ticket extension" \ |
| 3590 | -C "parse new session ticket" \ |
| 3591 | -c "a session has been resumed" |
| 3592 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3593 | # Tests for Max Fragment Length extension |
| 3594 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3595 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3596 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3597 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3598 | "$P_SRV debug_level=3" \ |
| 3599 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3600 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3601 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3602 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3603 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3604 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3605 | -C "client hello, adding max_fragment_length extension" \ |
| 3606 | -S "found max fragment length extension" \ |
| 3607 | -S "server hello, max_fragment_length extension" \ |
| 3608 | -C "found max_fragment_length extension" |
| 3609 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3610 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3611 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3612 | run_test "Max fragment length: enabled, default, larger message" \ |
| 3613 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3614 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3615 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3616 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3617 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3618 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3619 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3620 | -C "client hello, adding max_fragment_length extension" \ |
| 3621 | -S "found max fragment length extension" \ |
| 3622 | -S "server hello, max_fragment_length extension" \ |
| 3623 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3624 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3625 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3626 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3627 | |
| 3628 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3629 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3630 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 3631 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3632 | "$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] | 3633 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3634 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3635 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3636 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3637 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3638 | -C "client hello, adding max_fragment_length extension" \ |
| 3639 | -S "found max fragment length extension" \ |
| 3640 | -S "server hello, max_fragment_length extension" \ |
| 3641 | -C "found max_fragment_length extension" \ |
| 3642 | -c "fragment larger than.*maximum " |
| 3643 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3644 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 3645 | # (session fragment length will be 16384 regardless of mbedtls |
| 3646 | # content length configuration.) |
| 3647 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3648 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3649 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3650 | run_test "Max fragment length: disabled, larger message" \ |
| 3651 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3652 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3653 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3654 | -C "Maximum incoming record payload length is 16384" \ |
| 3655 | -C "Maximum outgoing record payload length is 16384" \ |
| 3656 | -S "Maximum incoming record payload length is 16384" \ |
| 3657 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3658 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3659 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3660 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3661 | |
| 3662 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3663 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 3664 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3665 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3666 | "$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] | 3667 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3668 | -C "Maximum incoming record payload length is 16384" \ |
| 3669 | -C "Maximum outgoing record payload length is 16384" \ |
| 3670 | -S "Maximum incoming record payload length is 16384" \ |
| 3671 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3672 | -c "fragment larger than.*maximum " |
| 3673 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3674 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3675 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3676 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3677 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3678 | "$P_SRV debug_level=3" \ |
| 3679 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3680 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3681 | -c "Maximum incoming record payload length is 4096" \ |
| 3682 | -c "Maximum outgoing record payload length is 4096" \ |
| 3683 | -s "Maximum incoming record payload length is 4096" \ |
| 3684 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3685 | -c "client hello, adding max_fragment_length extension" \ |
| 3686 | -s "found max fragment length extension" \ |
| 3687 | -s "server hello, max_fragment_length extension" \ |
| 3688 | -c "found max_fragment_length extension" |
| 3689 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3690 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3691 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3692 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3693 | run_test "Max fragment length: client 512, server 1024" \ |
| 3694 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3695 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3696 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3697 | -c "Maximum incoming record payload length is 512" \ |
| 3698 | -c "Maximum outgoing record payload length is 512" \ |
| 3699 | -s "Maximum incoming record payload length is 512" \ |
| 3700 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3701 | -c "client hello, adding max_fragment_length extension" \ |
| 3702 | -s "found max fragment length extension" \ |
| 3703 | -s "server hello, max_fragment_length extension" \ |
| 3704 | -c "found max_fragment_length extension" |
| 3705 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3706 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3707 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3708 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3709 | run_test "Max fragment length: client 512, server 2048" \ |
| 3710 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3711 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3712 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3713 | -c "Maximum incoming record payload length is 512" \ |
| 3714 | -c "Maximum outgoing record payload length is 512" \ |
| 3715 | -s "Maximum incoming record payload length is 512" \ |
| 3716 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3717 | -c "client hello, adding max_fragment_length extension" \ |
| 3718 | -s "found max fragment length extension" \ |
| 3719 | -s "server hello, max_fragment_length extension" \ |
| 3720 | -c "found max_fragment_length extension" |
| 3721 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3722 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3723 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3724 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3725 | run_test "Max fragment length: client 512, server 4096" \ |
| 3726 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3727 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3728 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3729 | -c "Maximum incoming record payload length is 512" \ |
| 3730 | -c "Maximum outgoing record payload length is 512" \ |
| 3731 | -s "Maximum incoming record payload length is 512" \ |
| 3732 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3733 | -c "client hello, adding max_fragment_length extension" \ |
| 3734 | -s "found max fragment length extension" \ |
| 3735 | -s "server hello, max_fragment_length extension" \ |
| 3736 | -c "found max_fragment_length extension" |
| 3737 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3738 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3739 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3740 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3741 | run_test "Max fragment length: client 1024, server 512" \ |
| 3742 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3743 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3744 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3745 | -c "Maximum incoming record payload length is 1024" \ |
| 3746 | -c "Maximum outgoing record payload length is 1024" \ |
| 3747 | -s "Maximum incoming record payload length is 1024" \ |
| 3748 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3749 | -c "client hello, adding max_fragment_length extension" \ |
| 3750 | -s "found max fragment length extension" \ |
| 3751 | -s "server hello, max_fragment_length extension" \ |
| 3752 | -c "found max_fragment_length extension" |
| 3753 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3754 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3755 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3756 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3757 | run_test "Max fragment length: client 1024, server 2048" \ |
| 3758 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3759 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3760 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3761 | -c "Maximum incoming record payload length is 1024" \ |
| 3762 | -c "Maximum outgoing record payload length is 1024" \ |
| 3763 | -s "Maximum incoming record payload length is 1024" \ |
| 3764 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3765 | -c "client hello, adding max_fragment_length extension" \ |
| 3766 | -s "found max fragment length extension" \ |
| 3767 | -s "server hello, max_fragment_length extension" \ |
| 3768 | -c "found max_fragment_length extension" |
| 3769 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3770 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3771 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3772 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3773 | run_test "Max fragment length: client 1024, server 4096" \ |
| 3774 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3775 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3776 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3777 | -c "Maximum incoming record payload length is 1024" \ |
| 3778 | -c "Maximum outgoing record payload length is 1024" \ |
| 3779 | -s "Maximum incoming record payload length is 1024" \ |
| 3780 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3781 | -c "client hello, adding max_fragment_length extension" \ |
| 3782 | -s "found max fragment length extension" \ |
| 3783 | -s "server hello, max_fragment_length extension" \ |
| 3784 | -c "found max_fragment_length extension" |
| 3785 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3786 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3787 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3788 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3789 | run_test "Max fragment length: client 2048, server 512" \ |
| 3790 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3791 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3792 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3793 | -c "Maximum incoming record payload length is 2048" \ |
| 3794 | -c "Maximum outgoing record payload length is 2048" \ |
| 3795 | -s "Maximum incoming record payload length is 2048" \ |
| 3796 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3797 | -c "client hello, adding max_fragment_length extension" \ |
| 3798 | -s "found max fragment length extension" \ |
| 3799 | -s "server hello, max_fragment_length extension" \ |
| 3800 | -c "found max_fragment_length extension" |
| 3801 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3802 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3803 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3804 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3805 | run_test "Max fragment length: client 2048, server 1024" \ |
| 3806 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3807 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3808 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3809 | -c "Maximum incoming record payload length is 2048" \ |
| 3810 | -c "Maximum outgoing record payload length is 2048" \ |
| 3811 | -s "Maximum incoming record payload length is 2048" \ |
| 3812 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3813 | -c "client hello, adding max_fragment_length extension" \ |
| 3814 | -s "found max fragment length extension" \ |
| 3815 | -s "server hello, max_fragment_length extension" \ |
| 3816 | -c "found max_fragment_length extension" |
| 3817 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3818 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3819 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3820 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3821 | run_test "Max fragment length: client 2048, server 4096" \ |
| 3822 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3823 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3824 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3825 | -c "Maximum incoming record payload length is 2048" \ |
| 3826 | -c "Maximum outgoing record payload length is 2048" \ |
| 3827 | -s "Maximum incoming record payload length is 2048" \ |
| 3828 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3829 | -c "client hello, adding max_fragment_length extension" \ |
| 3830 | -s "found max fragment length extension" \ |
| 3831 | -s "server hello, max_fragment_length extension" \ |
| 3832 | -c "found max_fragment_length extension" |
| 3833 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3834 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3835 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3836 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3837 | run_test "Max fragment length: client 4096, server 512" \ |
| 3838 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3839 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3840 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3841 | -c "Maximum incoming record payload length is 4096" \ |
| 3842 | -c "Maximum outgoing record payload length is 4096" \ |
| 3843 | -s "Maximum incoming record payload length is 4096" \ |
| 3844 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3845 | -c "client hello, adding max_fragment_length extension" \ |
| 3846 | -s "found max fragment length extension" \ |
| 3847 | -s "server hello, max_fragment_length extension" \ |
| 3848 | -c "found max_fragment_length extension" |
| 3849 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3850 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3851 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3852 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3853 | run_test "Max fragment length: client 4096, server 1024" \ |
| 3854 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3855 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3856 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3857 | -c "Maximum incoming record payload length is 4096" \ |
| 3858 | -c "Maximum outgoing record payload length is 4096" \ |
| 3859 | -s "Maximum incoming record payload length is 4096" \ |
| 3860 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3861 | -c "client hello, adding max_fragment_length extension" \ |
| 3862 | -s "found max fragment length extension" \ |
| 3863 | -s "server hello, max_fragment_length extension" \ |
| 3864 | -c "found max_fragment_length extension" |
| 3865 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3866 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3867 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3868 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3869 | run_test "Max fragment length: client 4096, server 2048" \ |
| 3870 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3871 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3872 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3873 | -c "Maximum incoming record payload length is 4096" \ |
| 3874 | -c "Maximum outgoing record payload length is 4096" \ |
| 3875 | -s "Maximum incoming record payload length is 4096" \ |
| 3876 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3877 | -c "client hello, adding max_fragment_length extension" \ |
| 3878 | -s "found max fragment length extension" \ |
| 3879 | -s "server hello, max_fragment_length extension" \ |
| 3880 | -c "found max_fragment_length extension" |
| 3881 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3882 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3883 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3884 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3885 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3886 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3887 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3888 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3889 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3890 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3891 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3892 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3893 | -C "client hello, adding max_fragment_length extension" \ |
| 3894 | -S "found max fragment length extension" \ |
| 3895 | -S "server hello, max_fragment_length extension" \ |
| 3896 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3897 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3898 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3899 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3900 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3901 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3902 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3903 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3904 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3905 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3906 | -c "Maximum incoming record payload length is 4096" \ |
| 3907 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3908 | -c "client hello, adding max_fragment_length extension" \ |
| 3909 | -c "found max_fragment_length extension" |
| 3910 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3911 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3912 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3913 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3914 | run_test "Max fragment length: client, message just fits" \ |
| 3915 | "$P_SRV debug_level=3" \ |
| 3916 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 3917 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3918 | -c "Maximum incoming record payload length is 2048" \ |
| 3919 | -c "Maximum outgoing record payload length is 2048" \ |
| 3920 | -s "Maximum incoming record payload length is 2048" \ |
| 3921 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3922 | -c "client hello, adding max_fragment_length extension" \ |
| 3923 | -s "found max fragment length extension" \ |
| 3924 | -s "server hello, max_fragment_length extension" \ |
| 3925 | -c "found max_fragment_length extension" \ |
| 3926 | -c "2048 bytes written in 1 fragments" \ |
| 3927 | -s "2048 bytes read" |
| 3928 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3929 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3930 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3931 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3932 | run_test "Max fragment length: client, larger message" \ |
| 3933 | "$P_SRV debug_level=3" \ |
| 3934 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 3935 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3936 | -c "Maximum incoming record payload length is 2048" \ |
| 3937 | -c "Maximum outgoing record payload length is 2048" \ |
| 3938 | -s "Maximum incoming record payload length is 2048" \ |
| 3939 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3940 | -c "client hello, adding max_fragment_length extension" \ |
| 3941 | -s "found max fragment length extension" \ |
| 3942 | -s "server hello, max_fragment_length extension" \ |
| 3943 | -c "found max_fragment_length extension" \ |
| 3944 | -c "2345 bytes written in 2 fragments" \ |
| 3945 | -s "2048 bytes read" \ |
| 3946 | -s "297 bytes read" |
| 3947 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3948 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3949 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3950 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 3951 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3952 | "$P_SRV debug_level=3 dtls=1" \ |
| 3953 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 3954 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3955 | -c "Maximum incoming record payload length is 2048" \ |
| 3956 | -c "Maximum outgoing record payload length is 2048" \ |
| 3957 | -s "Maximum incoming record payload length is 2048" \ |
| 3958 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3959 | -c "client hello, adding max_fragment_length extension" \ |
| 3960 | -s "found max fragment length extension" \ |
| 3961 | -s "server hello, max_fragment_length extension" \ |
| 3962 | -c "found max_fragment_length extension" \ |
| 3963 | -c "fragment larger than.*maximum" |
| 3964 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3965 | # Tests for renegotiation |
| 3966 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3967 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3968 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3969 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3970 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3971 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3972 | 0 \ |
| 3973 | -C "client hello, adding renegotiation extension" \ |
| 3974 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3975 | -S "found renegotiation extension" \ |
| 3976 | -s "server hello, secure renegotiation extension" \ |
| 3977 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3978 | -C "=> renegotiate" \ |
| 3979 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3980 | -S "write hello request" |
| 3981 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3982 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3983 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3984 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3985 | "$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] | 3986 | "$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] | 3987 | 0 \ |
| 3988 | -c "client hello, adding renegotiation extension" \ |
| 3989 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3990 | -s "found renegotiation extension" \ |
| 3991 | -s "server hello, secure renegotiation extension" \ |
| 3992 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3993 | -c "=> renegotiate" \ |
| 3994 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3995 | -S "write hello request" |
| 3996 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3997 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3998 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3999 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4000 | "$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] | 4001 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4002 | 0 \ |
| 4003 | -c "client hello, adding renegotiation extension" \ |
| 4004 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4005 | -s "found renegotiation extension" \ |
| 4006 | -s "server hello, secure renegotiation extension" \ |
| 4007 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4008 | -c "=> renegotiate" \ |
| 4009 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4010 | -s "write hello request" |
| 4011 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4012 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 4013 | # 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] | 4014 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4015 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4016 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4017 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 4018 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 4019 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4020 | 0 \ |
| 4021 | -c "client hello, adding renegotiation extension" \ |
| 4022 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4023 | -s "found renegotiation extension" \ |
| 4024 | -s "server hello, secure renegotiation extension" \ |
| 4025 | -c "found renegotiation extension" \ |
| 4026 | -c "=> renegotiate" \ |
| 4027 | -s "=> renegotiate" \ |
| 4028 | -S "write hello request" \ |
| 4029 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 4030 | |
| 4031 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 4032 | # 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] | 4033 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4034 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4035 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4036 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 4037 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 4038 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 4039 | 0 \ |
| 4040 | -c "client hello, adding renegotiation extension" \ |
| 4041 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4042 | -s "found renegotiation extension" \ |
| 4043 | -s "server hello, secure renegotiation extension" \ |
| 4044 | -c "found renegotiation extension" \ |
| 4045 | -c "=> renegotiate" \ |
| 4046 | -s "=> renegotiate" \ |
| 4047 | -s "write hello request" \ |
| 4048 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 4049 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4050 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4051 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4052 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4053 | "$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] | 4054 | "$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] | 4055 | 0 \ |
| 4056 | -c "client hello, adding renegotiation extension" \ |
| 4057 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4058 | -s "found renegotiation extension" \ |
| 4059 | -s "server hello, secure renegotiation extension" \ |
| 4060 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4061 | -c "=> renegotiate" \ |
| 4062 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4063 | -s "write hello request" |
| 4064 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4065 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4066 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4067 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4068 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4069 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 4070 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 4071 | "$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" \ |
| 4072 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4073 | -c "Maximum incoming record payload length is 2048" \ |
| 4074 | -c "Maximum outgoing record payload length is 2048" \ |
| 4075 | -s "Maximum incoming record payload length is 2048" \ |
| 4076 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4077 | -c "client hello, adding max_fragment_length extension" \ |
| 4078 | -s "found max fragment length extension" \ |
| 4079 | -s "server hello, max_fragment_length extension" \ |
| 4080 | -c "found max_fragment_length extension" \ |
| 4081 | -c "client hello, adding renegotiation extension" \ |
| 4082 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4083 | -s "found renegotiation extension" \ |
| 4084 | -s "server hello, secure renegotiation extension" \ |
| 4085 | -c "found renegotiation extension" \ |
| 4086 | -c "=> renegotiate" \ |
| 4087 | -s "=> renegotiate" \ |
| 4088 | -s "write hello request" |
| 4089 | |
| 4090 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4091 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4092 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4093 | "$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] | 4094 | "$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] | 4095 | 1 \ |
| 4096 | -c "client hello, adding renegotiation extension" \ |
| 4097 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4098 | -S "found renegotiation extension" \ |
| 4099 | -s "server hello, secure renegotiation extension" \ |
| 4100 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4101 | -c "=> renegotiate" \ |
| 4102 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4103 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 4104 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4105 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4106 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4107 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4108 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4109 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4110 | "$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] | 4111 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4112 | 0 \ |
| 4113 | -C "client hello, adding renegotiation extension" \ |
| 4114 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4115 | -S "found renegotiation extension" \ |
| 4116 | -s "server hello, secure renegotiation extension" \ |
| 4117 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4118 | -C "=> renegotiate" \ |
| 4119 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4120 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 4121 | -S "SSL - An unexpected message was received from our peer" \ |
| 4122 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 4123 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4124 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4125 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4126 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4127 | "$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] | 4128 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4129 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4130 | 0 \ |
| 4131 | -C "client hello, adding renegotiation extension" \ |
| 4132 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4133 | -S "found renegotiation extension" \ |
| 4134 | -s "server hello, secure renegotiation extension" \ |
| 4135 | -c "found renegotiation extension" \ |
| 4136 | -C "=> renegotiate" \ |
| 4137 | -S "=> renegotiate" \ |
| 4138 | -s "write hello request" \ |
| 4139 | -S "SSL - An unexpected message was received from our peer" \ |
| 4140 | -S "failed" |
| 4141 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 4142 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4143 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4144 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4145 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4146 | "$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] | 4147 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4148 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4149 | 0 \ |
| 4150 | -C "client hello, adding renegotiation extension" \ |
| 4151 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4152 | -S "found renegotiation extension" \ |
| 4153 | -s "server hello, secure renegotiation extension" \ |
| 4154 | -c "found renegotiation extension" \ |
| 4155 | -C "=> renegotiate" \ |
| 4156 | -S "=> renegotiate" \ |
| 4157 | -s "write hello request" \ |
| 4158 | -S "SSL - An unexpected message was received from our peer" \ |
| 4159 | -S "failed" |
| 4160 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4161 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4162 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4163 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4164 | "$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] | 4165 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4166 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4167 | 0 \ |
| 4168 | -C "client hello, adding renegotiation extension" \ |
| 4169 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4170 | -S "found renegotiation extension" \ |
| 4171 | -s "server hello, secure renegotiation extension" \ |
| 4172 | -c "found renegotiation extension" \ |
| 4173 | -C "=> renegotiate" \ |
| 4174 | -S "=> renegotiate" \ |
| 4175 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 4176 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4177 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4178 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4179 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4180 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4181 | "$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] | 4182 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4183 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4184 | 0 \ |
| 4185 | -c "client hello, adding renegotiation extension" \ |
| 4186 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4187 | -s "found renegotiation extension" \ |
| 4188 | -s "server hello, secure renegotiation extension" \ |
| 4189 | -c "found renegotiation extension" \ |
| 4190 | -c "=> renegotiate" \ |
| 4191 | -s "=> renegotiate" \ |
| 4192 | -s "write hello request" \ |
| 4193 | -S "SSL - An unexpected message was received from our peer" \ |
| 4194 | -S "failed" |
| 4195 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4196 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4197 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4198 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4199 | "$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] | 4200 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 4201 | 0 \ |
| 4202 | -C "client hello, adding renegotiation extension" \ |
| 4203 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4204 | -S "found renegotiation extension" \ |
| 4205 | -s "server hello, secure renegotiation extension" \ |
| 4206 | -c "found renegotiation extension" \ |
| 4207 | -S "record counter limit reached: renegotiate" \ |
| 4208 | -C "=> renegotiate" \ |
| 4209 | -S "=> renegotiate" \ |
| 4210 | -S "write hello request" \ |
| 4211 | -S "SSL - An unexpected message was received from our peer" \ |
| 4212 | -S "failed" |
| 4213 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 4214 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4215 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4216 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4217 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4218 | "$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] | 4219 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4220 | 0 \ |
| 4221 | -c "client hello, adding renegotiation extension" \ |
| 4222 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4223 | -s "found renegotiation extension" \ |
| 4224 | -s "server hello, secure renegotiation extension" \ |
| 4225 | -c "found renegotiation extension" \ |
| 4226 | -s "record counter limit reached: renegotiate" \ |
| 4227 | -c "=> renegotiate" \ |
| 4228 | -s "=> renegotiate" \ |
| 4229 | -s "write hello request" \ |
| 4230 | -S "SSL - An unexpected message was received from our peer" \ |
| 4231 | -S "failed" |
| 4232 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4233 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4234 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4235 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4236 | "$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] | 4237 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4238 | 0 \ |
| 4239 | -c "client hello, adding renegotiation extension" \ |
| 4240 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4241 | -s "found renegotiation extension" \ |
| 4242 | -s "server hello, secure renegotiation extension" \ |
| 4243 | -c "found renegotiation extension" \ |
| 4244 | -s "record counter limit reached: renegotiate" \ |
| 4245 | -c "=> renegotiate" \ |
| 4246 | -s "=> renegotiate" \ |
| 4247 | -s "write hello request" \ |
| 4248 | -S "SSL - An unexpected message was received from our peer" \ |
| 4249 | -S "failed" |
| 4250 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4251 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4252 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4253 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4254 | "$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] | 4255 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 4256 | 0 \ |
| 4257 | -C "client hello, adding renegotiation extension" \ |
| 4258 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4259 | -S "found renegotiation extension" \ |
| 4260 | -s "server hello, secure renegotiation extension" \ |
| 4261 | -c "found renegotiation extension" \ |
| 4262 | -S "record counter limit reached: renegotiate" \ |
| 4263 | -C "=> renegotiate" \ |
| 4264 | -S "=> renegotiate" \ |
| 4265 | -S "write hello request" \ |
| 4266 | -S "SSL - An unexpected message was received from our peer" \ |
| 4267 | -S "failed" |
| 4268 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4269 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4270 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4271 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4272 | "$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] | 4273 | "$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] | 4274 | 0 \ |
| 4275 | -c "client hello, adding renegotiation extension" \ |
| 4276 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4277 | -s "found renegotiation extension" \ |
| 4278 | -s "server hello, secure renegotiation extension" \ |
| 4279 | -c "found renegotiation extension" \ |
| 4280 | -c "=> renegotiate" \ |
| 4281 | -s "=> renegotiate" \ |
| 4282 | -S "write hello request" |
| 4283 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4284 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4285 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4286 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4287 | "$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] | 4288 | "$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] | 4289 | 0 \ |
| 4290 | -c "client hello, adding renegotiation extension" \ |
| 4291 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4292 | -s "found renegotiation extension" \ |
| 4293 | -s "server hello, secure renegotiation extension" \ |
| 4294 | -c "found renegotiation extension" \ |
| 4295 | -c "=> renegotiate" \ |
| 4296 | -s "=> renegotiate" \ |
| 4297 | -s "write hello request" |
| 4298 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4299 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4300 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4301 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 4302 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4303 | "$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] | 4304 | 0 \ |
| 4305 | -c "client hello, adding renegotiation extension" \ |
| 4306 | -c "found renegotiation extension" \ |
| 4307 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4308 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 4309 | -C "error" \ |
| 4310 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4311 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4312 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4313 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4314 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4315 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 4316 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4317 | "$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] | 4318 | 0 \ |
| 4319 | -c "client hello, adding renegotiation extension" \ |
| 4320 | -c "found renegotiation extension" \ |
| 4321 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4322 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 4323 | -C "error" \ |
| 4324 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4325 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4326 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4327 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4328 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4329 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 4330 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4331 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 4332 | 1 \ |
| 4333 | -c "client hello, adding renegotiation extension" \ |
| 4334 | -C "found renegotiation extension" \ |
| 4335 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4336 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4337 | -c "error" \ |
| 4338 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4339 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4340 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4341 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4342 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4343 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 4344 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4345 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 4346 | allow_legacy=0" \ |
| 4347 | 1 \ |
| 4348 | -c "client hello, adding renegotiation extension" \ |
| 4349 | -C "found renegotiation extension" \ |
| 4350 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4351 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4352 | -c "error" \ |
| 4353 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4354 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4355 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4356 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4357 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4358 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 4359 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4360 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 4361 | allow_legacy=1" \ |
| 4362 | 0 \ |
| 4363 | -c "client hello, adding renegotiation extension" \ |
| 4364 | -C "found renegotiation extension" \ |
| 4365 | -c "=> renegotiate" \ |
| 4366 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4367 | -C "error" \ |
| 4368 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4369 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4370 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4371 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 4372 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 4373 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 4374 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4375 | 0 \ |
| 4376 | -c "client hello, adding renegotiation extension" \ |
| 4377 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4378 | -s "found renegotiation extension" \ |
| 4379 | -s "server hello, secure renegotiation extension" \ |
| 4380 | -c "found renegotiation extension" \ |
| 4381 | -c "=> renegotiate" \ |
| 4382 | -s "=> renegotiate" \ |
| 4383 | -S "write hello request" |
| 4384 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4385 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4386 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 4387 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 4388 | "$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] | 4389 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 4390 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [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 | -c "=> renegotiate" \ |
| 4398 | -s "=> renegotiate" \ |
| 4399 | -s "write hello request" |
| 4400 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4401 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4402 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 4403 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 4404 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 4405 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 4406 | 0 \ |
| 4407 | -c "client hello, adding renegotiation extension" \ |
| 4408 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4409 | -s "found renegotiation extension" \ |
| 4410 | -s "server hello, secure renegotiation extension" \ |
| 4411 | -s "record counter limit reached: renegotiate" \ |
| 4412 | -c "=> renegotiate" \ |
| 4413 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4414 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 4415 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 4416 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4417 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4418 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 4419 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 4420 | "$G_SRV -u --mtu 4096" \ |
| 4421 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 4422 | 0 \ |
| 4423 | -c "client hello, adding renegotiation extension" \ |
| 4424 | -c "found renegotiation extension" \ |
| 4425 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4426 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 4427 | -C "error" \ |
| 4428 | -s "Extra-header:" |
| 4429 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4430 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 4431 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4432 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4433 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4434 | run_test "Renego ext: gnutls server strict, client default" \ |
| 4435 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 4436 | "$P_CLI debug_level=3" \ |
| 4437 | 0 \ |
| 4438 | -c "found renegotiation extension" \ |
| 4439 | -C "error" \ |
| 4440 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4441 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4442 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4443 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4444 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 4445 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4446 | "$P_CLI debug_level=3" \ |
| 4447 | 0 \ |
| 4448 | -C "found renegotiation extension" \ |
| 4449 | -C "error" \ |
| 4450 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4451 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4452 | requires_gnutls |
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 | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4454 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 4455 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4456 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 4457 | 1 \ |
| 4458 | -C "found renegotiation extension" \ |
| 4459 | -c "error" \ |
| 4460 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4461 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4462 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4463 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4464 | run_test "Renego ext: gnutls client strict, server default" \ |
| 4465 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4466 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4467 | 0 \ |
| 4468 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4469 | -s "server hello, secure renegotiation extension" |
| 4470 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4471 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4472 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4473 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 4474 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4475 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4476 | 0 \ |
| 4477 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4478 | -S "server hello, secure renegotiation extension" |
| 4479 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4480 | requires_gnutls |
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 "Renego ext: gnutls client unsafe, server break legacy" \ |
| 4483 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4484 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4485 | 1 \ |
| 4486 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4487 | -S "server hello, secure renegotiation extension" |
| 4488 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4489 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 4490 | |
| 4491 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4492 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4493 | run_test "DER format: no trailing bytes" \ |
| 4494 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 4495 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4496 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4497 | 0 \ |
| 4498 | -c "Handshake was completed" \ |
| 4499 | |
| 4500 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4501 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4502 | run_test "DER format: with a trailing zero byte" \ |
| 4503 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 4504 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4505 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4506 | 0 \ |
| 4507 | -c "Handshake was completed" \ |
| 4508 | |
| 4509 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4510 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4511 | run_test "DER format: with a trailing random byte" \ |
| 4512 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 4513 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4514 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4515 | 0 \ |
| 4516 | -c "Handshake was completed" \ |
| 4517 | |
| 4518 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4519 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4520 | run_test "DER format: with 2 trailing random bytes" \ |
| 4521 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 4522 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4523 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4524 | 0 \ |
| 4525 | -c "Handshake was completed" \ |
| 4526 | |
| 4527 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4528 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4529 | run_test "DER format: with 4 trailing random bytes" \ |
| 4530 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 4531 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4532 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4533 | 0 \ |
| 4534 | -c "Handshake was completed" \ |
| 4535 | |
| 4536 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4537 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4538 | run_test "DER format: with 8 trailing random bytes" \ |
| 4539 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 4540 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4541 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4542 | 0 \ |
| 4543 | -c "Handshake was completed" \ |
| 4544 | |
| 4545 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4546 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4547 | run_test "DER format: with 9 trailing random bytes" \ |
| 4548 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 4549 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4550 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4551 | 0 \ |
| 4552 | -c "Handshake was completed" \ |
| 4553 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4554 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 4555 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4556 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4557 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4558 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4559 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4560 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4561 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4562 | 1 \ |
| 4563 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4564 | -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] | 4565 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4566 | -c "X509 - Certificate verification failed" |
| 4567 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4568 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4569 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4570 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4571 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4572 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4573 | 0 \ |
| 4574 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4575 | -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] | 4576 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4577 | -C "X509 - Certificate verification failed" |
| 4578 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4579 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 4580 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 4581 | "$P_SRV" \ |
| 4582 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 4583 | 0 \ |
| 4584 | -c "x509_verify_cert() returned" \ |
| 4585 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4586 | -c "! Certificate verification flags"\ |
| 4587 | -C "! mbedtls_ssl_handshake returned" \ |
| 4588 | -C "X509 - Certificate verification failed" \ |
| 4589 | -C "SSL - No CA Chain is set, but required to operate" |
| 4590 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4591 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 4592 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 4593 | "$P_SRV" \ |
| 4594 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 4595 | 1 \ |
| 4596 | -c "x509_verify_cert() returned" \ |
| 4597 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4598 | -c "! Certificate verification flags"\ |
| 4599 | -c "! mbedtls_ssl_handshake returned" \ |
| 4600 | -c "SSL - No CA Chain is set, but required to operate" |
| 4601 | |
| 4602 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4603 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4604 | # the client informs the server about the supported curves - it does, though, in the |
| 4605 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4606 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4607 | # different means to have the server ignoring the client's supported curve list. |
| 4608 | |
| 4609 | requires_config_enabled MBEDTLS_ECP_C |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4610 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 4611 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4612 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4613 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4614 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4615 | 1 \ |
| 4616 | -c "bad certificate (EC key curve)"\ |
| 4617 | -c "! Certificate verification flags"\ |
| 4618 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4619 | |
| 4620 | requires_config_enabled MBEDTLS_ECP_C |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4621 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 4622 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4623 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4624 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4625 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4626 | 1 \ |
| 4627 | -c "bad certificate (EC key curve)"\ |
| 4628 | -c "! Certificate verification flags"\ |
| 4629 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4630 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4631 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4632 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 4633 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4634 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4635 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4636 | 0 \ |
| 4637 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4638 | -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] | 4639 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4640 | -C "X509 - Certificate verification failed" |
| 4641 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4642 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 4643 | run_test "Authentication: client SHA256, server required" \ |
| 4644 | "$P_SRV auth_mode=required" \ |
| 4645 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4646 | key_file=data_files/server6.key \ |
| 4647 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4648 | 0 \ |
| 4649 | -c "Supported Signature Algorithm found: 4," \ |
| 4650 | -c "Supported Signature Algorithm found: 5," |
| 4651 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4652 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 4653 | run_test "Authentication: client SHA384, server required" \ |
| 4654 | "$P_SRV auth_mode=required" \ |
| 4655 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4656 | key_file=data_files/server6.key \ |
| 4657 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4658 | 0 \ |
| 4659 | -c "Supported Signature Algorithm found: 4," \ |
| 4660 | -c "Supported Signature Algorithm found: 5," |
| 4661 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4662 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4663 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 4664 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4665 | "$P_CLI debug_level=3 crt_file=none \ |
| 4666 | key_file=data_files/server5.key" \ |
| 4667 | 1 \ |
| 4668 | -S "skip write certificate request" \ |
| 4669 | -C "skip parse certificate request" \ |
| 4670 | -c "got a certificate request" \ |
| 4671 | -c "= write certificate$" \ |
| 4672 | -C "skip write certificate$" \ |
| 4673 | -S "x509_verify_cert() returned" \ |
| 4674 | -s "client has no certificate" \ |
| 4675 | -s "! mbedtls_ssl_handshake returned" \ |
| 4676 | -c "! mbedtls_ssl_handshake returned" \ |
| 4677 | -s "No client certification received from the client, but required by the authentication mode" |
| 4678 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4679 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4680 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4681 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4682 | "$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] | 4683 | key_file=data_files/server5.key" \ |
| 4684 | 1 \ |
| 4685 | -S "skip write certificate request" \ |
| 4686 | -C "skip parse certificate request" \ |
| 4687 | -c "got a certificate request" \ |
| 4688 | -C "skip write certificate" \ |
| 4689 | -C "skip write certificate verify" \ |
| 4690 | -S "skip parse certificate verify" \ |
| 4691 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4692 | -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] | 4693 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4694 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4695 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4696 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4697 | # We don't check that the client receives the alert because it might |
| 4698 | # detect that its write end of the connection is closed and abort |
| 4699 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4700 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4701 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 4702 | run_test "Authentication: client cert self-signed and trusted, server required" \ |
| 4703 | "$P_SRV debug_level=3 auth_mode=required ca_file=data_files/server5-selfsigned.crt" \ |
| 4704 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4705 | key_file=data_files/server5.key" \ |
| 4706 | 0 \ |
| 4707 | -S "skip write certificate request" \ |
| 4708 | -C "skip parse certificate request" \ |
| 4709 | -c "got a certificate request" \ |
| 4710 | -C "skip write certificate" \ |
| 4711 | -C "skip write certificate verify" \ |
| 4712 | -S "skip parse certificate verify" \ |
| 4713 | -S "x509_verify_cert() returned" \ |
| 4714 | -S "! The certificate is not correctly signed" \ |
| 4715 | -S "X509 - Certificate verification failed" |
| 4716 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4717 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4718 | run_test "Authentication: client cert not trusted, server required" \ |
| 4719 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4720 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4721 | key_file=data_files/server5.key" \ |
| 4722 | 1 \ |
| 4723 | -S "skip write certificate request" \ |
| 4724 | -C "skip parse certificate request" \ |
| 4725 | -c "got a certificate request" \ |
| 4726 | -C "skip write certificate" \ |
| 4727 | -C "skip write certificate verify" \ |
| 4728 | -S "skip parse certificate verify" \ |
| 4729 | -s "x509_verify_cert() returned" \ |
| 4730 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4731 | -s "! mbedtls_ssl_handshake returned" \ |
| 4732 | -c "! mbedtls_ssl_handshake returned" \ |
| 4733 | -s "X509 - Certificate verification failed" |
| 4734 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4735 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4736 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4737 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4738 | "$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] | 4739 | key_file=data_files/server5.key" \ |
| 4740 | 0 \ |
| 4741 | -S "skip write certificate request" \ |
| 4742 | -C "skip parse certificate request" \ |
| 4743 | -c "got a certificate request" \ |
| 4744 | -C "skip write certificate" \ |
| 4745 | -C "skip write certificate verify" \ |
| 4746 | -S "skip parse certificate verify" \ |
| 4747 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4748 | -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] | 4749 | -S "! mbedtls_ssl_handshake returned" \ |
| 4750 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4751 | -S "X509 - Certificate verification failed" |
| 4752 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4753 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4754 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4755 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 4756 | "$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] | 4757 | key_file=data_files/server5.key" \ |
| 4758 | 0 \ |
| 4759 | -s "skip write certificate request" \ |
| 4760 | -C "skip parse certificate request" \ |
| 4761 | -c "got no certificate request" \ |
| 4762 | -c "skip write certificate" \ |
| 4763 | -c "skip write certificate verify" \ |
| 4764 | -s "skip parse certificate verify" \ |
| 4765 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4766 | -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] | 4767 | -S "! mbedtls_ssl_handshake returned" \ |
| 4768 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4769 | -S "X509 - Certificate verification failed" |
| 4770 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4771 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4772 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4773 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4774 | "$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] | 4775 | 0 \ |
| 4776 | -S "skip write certificate request" \ |
| 4777 | -C "skip parse certificate request" \ |
| 4778 | -c "got a certificate request" \ |
| 4779 | -C "skip write certificate$" \ |
| 4780 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4781 | -c "skip write certificate verify" \ |
| 4782 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4783 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4784 | -S "! mbedtls_ssl_handshake returned" \ |
| 4785 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4786 | -S "X509 - Certificate verification failed" |
| 4787 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4788 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4789 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4790 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4791 | "$O_CLI" \ |
| 4792 | 0 \ |
| 4793 | -S "skip write certificate request" \ |
| 4794 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4795 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4796 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4797 | -S "X509 - Certificate verification failed" |
| 4798 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4799 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4800 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4801 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4802 | "$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] | 4803 | 0 \ |
| 4804 | -C "skip parse certificate request" \ |
| 4805 | -c "got a certificate request" \ |
| 4806 | -C "skip write certificate$" \ |
| 4807 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4808 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4809 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4810 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4811 | run_test "Authentication: client no cert, openssl server required" \ |
| 4812 | "$O_SRV -Verify 10" \ |
| 4813 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 4814 | 1 \ |
| 4815 | -C "skip parse certificate request" \ |
| 4816 | -c "got a certificate request" \ |
| 4817 | -C "skip write certificate$" \ |
| 4818 | -c "skip write certificate verify" \ |
| 4819 | -c "! mbedtls_ssl_handshake returned" |
| 4820 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4821 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 4822 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 4823 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4824 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4825 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4826 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4827 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 4828 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 4829 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 4830 | # 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] | 4831 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4832 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4833 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4834 | run_test "Authentication: server max_int chain, client default" \ |
| 4835 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4836 | key_file=data_files/dir-maxpath/09.key" \ |
| 4837 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4838 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4839 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4840 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4841 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4842 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4843 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4844 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 4845 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4846 | key_file=data_files/dir-maxpath/10.key" \ |
| 4847 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4848 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4849 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4850 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4851 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4852 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4853 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4854 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 4855 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4856 | key_file=data_files/dir-maxpath/10.key" \ |
| 4857 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4858 | auth_mode=optional" \ |
| 4859 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4860 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4861 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4862 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4863 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4864 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4865 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 4866 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4867 | key_file=data_files/dir-maxpath/10.key" \ |
| 4868 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4869 | auth_mode=none" \ |
| 4870 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4871 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4872 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4873 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4874 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4875 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4876 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 4877 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 4878 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4879 | key_file=data_files/dir-maxpath/10.key" \ |
| 4880 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4881 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4882 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4883 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4884 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4885 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4886 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 4887 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4888 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4889 | key_file=data_files/dir-maxpath/10.key" \ |
| 4890 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4891 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4892 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4893 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4894 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4895 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4896 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 4897 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4898 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4899 | key_file=data_files/dir-maxpath/10.key" \ |
| 4900 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4901 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4902 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4903 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4904 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4905 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4906 | run_test "Authentication: client max_int chain, server required" \ |
| 4907 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4908 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4909 | key_file=data_files/dir-maxpath/09.key" \ |
| 4910 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4911 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4912 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4913 | # Tests for CA list in CertificateRequest messages |
| 4914 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4915 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4916 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 4917 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4918 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4919 | key_file=data_files/server6.key" \ |
| 4920 | 0 \ |
| 4921 | -s "requested DN" |
| 4922 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4923 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4924 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 4925 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4926 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4927 | key_file=data_files/server6.key" \ |
| 4928 | 0 \ |
| 4929 | -S "requested DN" |
| 4930 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4931 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4932 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 4933 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4934 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4935 | key_file=data_files/server5.key" \ |
| 4936 | 1 \ |
| 4937 | -S "requested DN" \ |
| 4938 | -s "x509_verify_cert() returned" \ |
| 4939 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4940 | -s "! mbedtls_ssl_handshake returned" \ |
| 4941 | -c "! mbedtls_ssl_handshake returned" \ |
| 4942 | -s "X509 - Certificate verification failed" |
| 4943 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4944 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 4945 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4946 | |
| 4947 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4948 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4949 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 4950 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4951 | key_file=data_files/server5.key" \ |
| 4952 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4953 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4954 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4955 | -c "x509_verify_cert() returned" \ |
| 4956 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4957 | -c "! mbedtls_ssl_handshake returned" \ |
| 4958 | -c "X509 - Certificate verification failed" |
| 4959 | |
| 4960 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4961 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4962 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 4963 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4964 | key_file=data_files/server5.key" \ |
| 4965 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4966 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4967 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4968 | -c "x509_verify_cert() returned" \ |
| 4969 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4970 | -C "! mbedtls_ssl_handshake returned" \ |
| 4971 | -C "X509 - Certificate verification failed" |
| 4972 | |
| 4973 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4974 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4975 | # the client informs the server about the supported curves - it does, though, in the |
| 4976 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4977 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4978 | # different means to have the server ignoring the client's supported curve list. |
| 4979 | |
| 4980 | requires_config_enabled MBEDTLS_ECP_C |
| 4981 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4982 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4983 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4984 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4985 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4986 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4987 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4988 | -c "use CA callback for X.509 CRT verification" \ |
| 4989 | -c "bad certificate (EC key curve)" \ |
| 4990 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4991 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4992 | |
| 4993 | requires_config_enabled MBEDTLS_ECP_C |
| 4994 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4995 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4996 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4997 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4998 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4999 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 5000 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5001 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5002 | -c "bad certificate (EC key curve)"\ |
| 5003 | -c "! Certificate verification flags"\ |
| 5004 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 5005 | |
| 5006 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5007 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5008 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 5009 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5010 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5011 | key_file=data_files/server6.key \ |
| 5012 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 5013 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5014 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5015 | -c "Supported Signature Algorithm found: 4," \ |
| 5016 | -c "Supported Signature Algorithm found: 5," |
| 5017 | |
| 5018 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5019 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5020 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 5021 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5022 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5023 | key_file=data_files/server6.key \ |
| 5024 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 5025 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5026 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5027 | -c "Supported Signature Algorithm found: 4," \ |
| 5028 | -c "Supported Signature Algorithm found: 5," |
| 5029 | |
| 5030 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5031 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5032 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 5033 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5034 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 5035 | key_file=data_files/server5.key" \ |
| 5036 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5037 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5038 | -S "skip write certificate request" \ |
| 5039 | -C "skip parse certificate request" \ |
| 5040 | -c "got a certificate request" \ |
| 5041 | -C "skip write certificate" \ |
| 5042 | -C "skip write certificate verify" \ |
| 5043 | -S "skip parse certificate verify" \ |
| 5044 | -s "x509_verify_cert() returned" \ |
| 5045 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5046 | -s "! mbedtls_ssl_handshake returned" \ |
| 5047 | -s "send alert level=2 message=48" \ |
| 5048 | -c "! mbedtls_ssl_handshake returned" \ |
| 5049 | -s "X509 - Certificate verification failed" |
| 5050 | # We don't check that the client receives the alert because it might |
| 5051 | # detect that its write end of the connection is closed and abort |
| 5052 | # before reading the alert message. |
| 5053 | |
| 5054 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5055 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5056 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 5057 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5058 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5059 | key_file=data_files/server5.key" \ |
| 5060 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5061 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5062 | -S "skip write certificate request" \ |
| 5063 | -C "skip parse certificate request" \ |
| 5064 | -c "got a certificate request" \ |
| 5065 | -C "skip write certificate" \ |
| 5066 | -C "skip write certificate verify" \ |
| 5067 | -S "skip parse certificate verify" \ |
| 5068 | -s "x509_verify_cert() returned" \ |
| 5069 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5070 | -s "! mbedtls_ssl_handshake returned" \ |
| 5071 | -c "! mbedtls_ssl_handshake returned" \ |
| 5072 | -s "X509 - Certificate verification failed" |
| 5073 | |
| 5074 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5075 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5076 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 5077 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 5078 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 5079 | key_file=data_files/server5.key" \ |
| 5080 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5081 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5082 | -S "skip write certificate request" \ |
| 5083 | -C "skip parse certificate request" \ |
| 5084 | -c "got a certificate request" \ |
| 5085 | -C "skip write certificate" \ |
| 5086 | -C "skip write certificate verify" \ |
| 5087 | -S "skip parse certificate verify" \ |
| 5088 | -s "x509_verify_cert() returned" \ |
| 5089 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5090 | -S "! mbedtls_ssl_handshake returned" \ |
| 5091 | -C "! mbedtls_ssl_handshake returned" \ |
| 5092 | -S "X509 - Certificate verification failed" |
| 5093 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5094 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5095 | requires_full_size_output_buffer |
| 5096 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5097 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5098 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 5099 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 5100 | key_file=data_files/dir-maxpath/09.key" \ |
| 5101 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5102 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5103 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5104 | -C "X509 - A fatal error occurred" |
| 5105 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5106 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5107 | requires_full_size_output_buffer |
| 5108 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5109 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5110 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 5111 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5112 | key_file=data_files/dir-maxpath/10.key" \ |
| 5113 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5114 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5115 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5116 | -c "X509 - A fatal error occurred" |
| 5117 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5118 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5119 | requires_full_size_output_buffer |
| 5120 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5121 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5122 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 5123 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5124 | key_file=data_files/dir-maxpath/10.key" \ |
| 5125 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 5126 | debug_level=3 auth_mode=optional" \ |
| 5127 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5128 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5129 | -c "X509 - A fatal error occurred" |
| 5130 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5131 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5132 | requires_full_size_output_buffer |
| 5133 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5134 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5135 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 5136 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 5137 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5138 | key_file=data_files/dir-maxpath/10.key" \ |
| 5139 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5140 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5141 | -s "X509 - A fatal error occurred" |
| 5142 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5143 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5144 | requires_full_size_output_buffer |
| 5145 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5146 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5147 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 5148 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5149 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5150 | key_file=data_files/dir-maxpath/10.key" \ |
| 5151 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5152 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5153 | -s "X509 - A fatal error occurred" |
| 5154 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5155 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5156 | requires_full_size_output_buffer |
| 5157 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5158 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5159 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 5160 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5161 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 5162 | key_file=data_files/dir-maxpath/09.key" \ |
| 5163 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5164 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5165 | -S "X509 - A fatal error occurred" |
| 5166 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5167 | # Tests for certificate selection based on SHA verson |
| 5168 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5169 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5170 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 5171 | "$P_SRV crt_file=data_files/server5.crt \ |
| 5172 | key_file=data_files/server5.key \ |
| 5173 | crt_file2=data_files/server5-sha1.crt \ |
| 5174 | key_file2=data_files/server5.key" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5175 | "$P_CLI force_version=tls12" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5176 | 0 \ |
| 5177 | -c "signed using.*ECDSA with SHA256" \ |
| 5178 | -C "signed using.*ECDSA with SHA1" |
| 5179 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5180 | # tests for SNI |
| 5181 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5182 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5183 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5184 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5185 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5186 | 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] | 5187 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5188 | 0 \ |
| 5189 | -S "parse ServerName extension" \ |
| 5190 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 5191 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5192 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5193 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5194 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5195 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5196 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5197 | 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] | 5198 | 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] | 5199 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5200 | 0 \ |
| 5201 | -s "parse ServerName extension" \ |
| 5202 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5203 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5204 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5205 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5206 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5207 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5208 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5209 | 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] | 5210 | 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] | 5211 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5212 | 0 \ |
| 5213 | -s "parse ServerName extension" \ |
| 5214 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5215 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5216 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5217 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5218 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5219 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5220 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5221 | 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] | 5222 | 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] | 5223 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5224 | 1 \ |
| 5225 | -s "parse ServerName extension" \ |
| 5226 | -s "ssl_sni_wrapper() returned" \ |
| 5227 | -s "mbedtls_ssl_handshake returned" \ |
| 5228 | -c "mbedtls_ssl_handshake returned" \ |
| 5229 | -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] | 5230 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5231 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5232 | run_test "SNI: client auth no override: optional" \ |
| 5233 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5234 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5235 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 5236 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5237 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5238 | -S "skip write certificate request" \ |
| 5239 | -C "skip parse certificate request" \ |
| 5240 | -c "got a certificate request" \ |
| 5241 | -C "skip write certificate" \ |
| 5242 | -C "skip write certificate verify" \ |
| 5243 | -S "skip parse certificate verify" |
| 5244 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5245 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5246 | run_test "SNI: client auth override: none -> optional" \ |
| 5247 | "$P_SRV debug_level=3 auth_mode=none \ |
| 5248 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5249 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 5250 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5251 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5252 | -S "skip write certificate request" \ |
| 5253 | -C "skip parse certificate request" \ |
| 5254 | -c "got a certificate request" \ |
| 5255 | -C "skip write certificate" \ |
| 5256 | -C "skip write certificate verify" \ |
| 5257 | -S "skip parse certificate verify" |
| 5258 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5259 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5260 | run_test "SNI: client auth override: optional -> none" \ |
| 5261 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5262 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5263 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 5264 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5265 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5266 | -s "skip write certificate request" \ |
| 5267 | -C "skip parse certificate request" \ |
| 5268 | -c "got no certificate request" \ |
| 5269 | -c "skip write certificate" \ |
| 5270 | -c "skip write certificate verify" \ |
| 5271 | -s "skip parse certificate verify" |
| 5272 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5273 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5274 | run_test "SNI: CA no override" \ |
| 5275 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5276 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5277 | ca_file=data_files/test-ca.crt \ |
| 5278 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 5279 | "$P_CLI debug_level=3 server_name=localhost \ |
| 5280 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5281 | 1 \ |
| 5282 | -S "skip write certificate request" \ |
| 5283 | -C "skip parse certificate request" \ |
| 5284 | -c "got a certificate request" \ |
| 5285 | -C "skip write certificate" \ |
| 5286 | -C "skip write certificate verify" \ |
| 5287 | -S "skip parse certificate verify" \ |
| 5288 | -s "x509_verify_cert() returned" \ |
| 5289 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5290 | -S "The certificate has been revoked (is on a CRL)" |
| 5291 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5292 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5293 | run_test "SNI: CA override" \ |
| 5294 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5295 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5296 | ca_file=data_files/test-ca.crt \ |
| 5297 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 5298 | "$P_CLI debug_level=3 server_name=localhost \ |
| 5299 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5300 | 0 \ |
| 5301 | -S "skip write certificate request" \ |
| 5302 | -C "skip parse certificate request" \ |
| 5303 | -c "got a certificate request" \ |
| 5304 | -C "skip write certificate" \ |
| 5305 | -C "skip write certificate verify" \ |
| 5306 | -S "skip parse certificate verify" \ |
| 5307 | -S "x509_verify_cert() returned" \ |
| 5308 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5309 | -S "The certificate has been revoked (is on a CRL)" |
| 5310 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5311 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5312 | run_test "SNI: CA override with CRL" \ |
| 5313 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5314 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5315 | ca_file=data_files/test-ca.crt \ |
| 5316 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 5317 | "$P_CLI debug_level=3 server_name=localhost \ |
| 5318 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5319 | 1 \ |
| 5320 | -S "skip write certificate request" \ |
| 5321 | -C "skip parse certificate request" \ |
| 5322 | -c "got a certificate request" \ |
| 5323 | -C "skip write certificate" \ |
| 5324 | -C "skip write certificate verify" \ |
| 5325 | -S "skip parse certificate verify" \ |
| 5326 | -s "x509_verify_cert() returned" \ |
| 5327 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5328 | -s "The certificate has been revoked (is on a CRL)" |
| 5329 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5330 | # Tests for SNI and DTLS |
| 5331 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5332 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5333 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5334 | run_test "SNI: DTLS, no SNI callback" \ |
| 5335 | "$P_SRV debug_level=3 dtls=1 \ |
| 5336 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 5337 | "$P_CLI server_name=localhost dtls=1" \ |
| 5338 | 0 \ |
| 5339 | -S "parse ServerName extension" \ |
| 5340 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 5341 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 5342 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5343 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5344 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5345 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5346 | "$P_SRV debug_level=3 dtls=1 \ |
| 5347 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5348 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5349 | "$P_CLI server_name=localhost dtls=1" \ |
| 5350 | 0 \ |
| 5351 | -s "parse ServerName extension" \ |
| 5352 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5353 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 5354 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5355 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5356 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5357 | run_test "SNI: DTLS, matching cert 2" \ |
| 5358 | "$P_SRV debug_level=3 dtls=1 \ |
| 5359 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5360 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5361 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 5362 | 0 \ |
| 5363 | -s "parse ServerName extension" \ |
| 5364 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5365 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 5366 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5367 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5368 | run_test "SNI: DTLS, no matching cert" \ |
| 5369 | "$P_SRV debug_level=3 dtls=1 \ |
| 5370 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5371 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5372 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 5373 | 1 \ |
| 5374 | -s "parse ServerName extension" \ |
| 5375 | -s "ssl_sni_wrapper() returned" \ |
| 5376 | -s "mbedtls_ssl_handshake returned" \ |
| 5377 | -c "mbedtls_ssl_handshake returned" \ |
| 5378 | -c "SSL - A fatal alert message was received from our peer" |
| 5379 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5380 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5381 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 5382 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5383 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5384 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 5385 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5386 | 0 \ |
| 5387 | -S "skip write certificate request" \ |
| 5388 | -C "skip parse certificate request" \ |
| 5389 | -c "got a certificate request" \ |
| 5390 | -C "skip write certificate" \ |
| 5391 | -C "skip write certificate verify" \ |
| 5392 | -S "skip parse certificate verify" |
| 5393 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5394 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5395 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 5396 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 5397 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5398 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 5399 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5400 | 0 \ |
| 5401 | -S "skip write certificate request" \ |
| 5402 | -C "skip parse certificate request" \ |
| 5403 | -c "got a certificate request" \ |
| 5404 | -C "skip write certificate" \ |
| 5405 | -C "skip write certificate verify" \ |
| 5406 | -S "skip parse certificate verify" |
| 5407 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5408 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5409 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 5410 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5411 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5412 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 5413 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5414 | 0 \ |
| 5415 | -s "skip write certificate request" \ |
| 5416 | -C "skip parse certificate request" \ |
| 5417 | -c "got no certificate request" \ |
| 5418 | -c "skip write certificate" \ |
| 5419 | -c "skip write certificate verify" \ |
| 5420 | -s "skip parse certificate verify" |
| 5421 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5422 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5423 | run_test "SNI: DTLS, CA no override" \ |
| 5424 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5425 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5426 | ca_file=data_files/test-ca.crt \ |
| 5427 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 5428 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5429 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5430 | 1 \ |
| 5431 | -S "skip write certificate request" \ |
| 5432 | -C "skip parse certificate request" \ |
| 5433 | -c "got a certificate request" \ |
| 5434 | -C "skip write certificate" \ |
| 5435 | -C "skip write certificate verify" \ |
| 5436 | -S "skip parse certificate verify" \ |
| 5437 | -s "x509_verify_cert() returned" \ |
| 5438 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5439 | -S "The certificate has been revoked (is on a CRL)" |
| 5440 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5441 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5442 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5443 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5444 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5445 | ca_file=data_files/test-ca.crt \ |
| 5446 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 5447 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5448 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5449 | 0 \ |
| 5450 | -S "skip write certificate request" \ |
| 5451 | -C "skip parse certificate request" \ |
| 5452 | -c "got a certificate request" \ |
| 5453 | -C "skip write certificate" \ |
| 5454 | -C "skip write certificate verify" \ |
| 5455 | -S "skip parse certificate verify" \ |
| 5456 | -S "x509_verify_cert() returned" \ |
| 5457 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5458 | -S "The certificate has been revoked (is on a CRL)" |
| 5459 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5460 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5461 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5462 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5463 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 5464 | ca_file=data_files/test-ca.crt \ |
| 5465 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 5466 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5467 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5468 | 1 \ |
| 5469 | -S "skip write certificate request" \ |
| 5470 | -C "skip parse certificate request" \ |
| 5471 | -c "got a certificate request" \ |
| 5472 | -C "skip write certificate" \ |
| 5473 | -C "skip write certificate verify" \ |
| 5474 | -S "skip parse certificate verify" \ |
| 5475 | -s "x509_verify_cert() returned" \ |
| 5476 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5477 | -s "The certificate has been revoked (is on a CRL)" |
| 5478 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5479 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 5480 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5481 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5482 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5483 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 5484 | "$P_CLI nbio=2 tickets=0" \ |
| 5485 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5486 | -S "mbedtls_ssl_handshake returned" \ |
| 5487 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5488 | -c "Read from server: .* bytes read" |
| 5489 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5490 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5491 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5492 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 5493 | "$P_CLI nbio=2 tickets=0" \ |
| 5494 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5495 | -S "mbedtls_ssl_handshake returned" \ |
| 5496 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5497 | -c "Read from server: .* bytes read" |
| 5498 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5499 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5500 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5501 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 5502 | "$P_CLI nbio=2 tickets=1" \ |
| 5503 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5504 | -S "mbedtls_ssl_handshake returned" \ |
| 5505 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5506 | -c "Read from server: .* bytes read" |
| 5507 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5508 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5509 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5510 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 5511 | "$P_CLI nbio=2 tickets=1" \ |
| 5512 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5513 | -S "mbedtls_ssl_handshake returned" \ |
| 5514 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5515 | -c "Read from server: .* bytes read" |
| 5516 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5517 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5518 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5519 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 5520 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 5521 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5522 | -S "mbedtls_ssl_handshake returned" \ |
| 5523 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5524 | -c "Read from server: .* bytes read" |
| 5525 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5526 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5527 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5528 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 5529 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 5530 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5531 | -S "mbedtls_ssl_handshake returned" \ |
| 5532 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5533 | -c "Read from server: .* bytes read" |
| 5534 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5535 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5536 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5537 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 5538 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 5539 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5540 | -S "mbedtls_ssl_handshake returned" \ |
| 5541 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5542 | -c "Read from server: .* bytes read" |
| 5543 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5544 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 5545 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5546 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5547 | run_test "Event-driven I/O: basic handshake" \ |
| 5548 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 5549 | "$P_CLI event=1 tickets=0" \ |
| 5550 | 0 \ |
| 5551 | -S "mbedtls_ssl_handshake returned" \ |
| 5552 | -C "mbedtls_ssl_handshake returned" \ |
| 5553 | -c "Read from server: .* bytes read" |
| 5554 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5555 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5556 | run_test "Event-driven I/O: client auth" \ |
| 5557 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 5558 | "$P_CLI event=1 tickets=0" \ |
| 5559 | 0 \ |
| 5560 | -S "mbedtls_ssl_handshake returned" \ |
| 5561 | -C "mbedtls_ssl_handshake returned" \ |
| 5562 | -c "Read from server: .* bytes read" |
| 5563 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5564 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5565 | run_test "Event-driven I/O: ticket" \ |
| 5566 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 5567 | "$P_CLI event=1 tickets=1" \ |
| 5568 | 0 \ |
| 5569 | -S "mbedtls_ssl_handshake returned" \ |
| 5570 | -C "mbedtls_ssl_handshake returned" \ |
| 5571 | -c "Read from server: .* bytes read" |
| 5572 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5573 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5574 | run_test "Event-driven I/O: ticket + client auth" \ |
| 5575 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 5576 | "$P_CLI event=1 tickets=1" \ |
| 5577 | 0 \ |
| 5578 | -S "mbedtls_ssl_handshake returned" \ |
| 5579 | -C "mbedtls_ssl_handshake returned" \ |
| 5580 | -c "Read from server: .* bytes read" |
| 5581 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5582 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5583 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 5584 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 5585 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 5586 | 0 \ |
| 5587 | -S "mbedtls_ssl_handshake returned" \ |
| 5588 | -C "mbedtls_ssl_handshake returned" \ |
| 5589 | -c "Read from server: .* bytes read" |
| 5590 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5591 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5592 | run_test "Event-driven I/O: ticket + resume" \ |
| 5593 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 5594 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 5595 | 0 \ |
| 5596 | -S "mbedtls_ssl_handshake returned" \ |
| 5597 | -C "mbedtls_ssl_handshake returned" \ |
| 5598 | -c "Read from server: .* bytes read" |
| 5599 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5600 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5601 | run_test "Event-driven I/O: session-id resume" \ |
| 5602 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 5603 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 5604 | 0 \ |
| 5605 | -S "mbedtls_ssl_handshake returned" \ |
| 5606 | -C "mbedtls_ssl_handshake returned" \ |
| 5607 | -c "Read from server: .* bytes read" |
| 5608 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5609 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5610 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 5611 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 5612 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 5613 | 0 \ |
| 5614 | -c "Read from server: .* bytes read" |
| 5615 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5616 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5617 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 5618 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 5619 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 5620 | 0 \ |
| 5621 | -c "Read from server: .* bytes read" |
| 5622 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5623 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5624 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 5625 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 5626 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 5627 | 0 \ |
| 5628 | -c "Read from server: .* bytes read" |
| 5629 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5630 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5631 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 5632 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 5633 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 5634 | 0 \ |
| 5635 | -c "Read from server: .* bytes read" |
| 5636 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5637 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5638 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 5639 | "$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] | 5640 | "$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] | 5641 | 0 \ |
| 5642 | -c "Read from server: .* bytes read" |
| 5643 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5644 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5645 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 5646 | "$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] | 5647 | "$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] | 5648 | 0 \ |
| 5649 | -c "Read from server: .* bytes read" |
| 5650 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5651 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5652 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 5653 | "$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] | 5654 | "$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] | 5655 | 0 \ |
| 5656 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5657 | |
| 5658 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 5659 | # During session resumption, the client will send its ApplicationData record |
| 5660 | # within the same datagram as the Finished messages. In this situation, the |
| 5661 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 5662 | # because the ApplicationData request has already been queued internally. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5663 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5664 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 5665 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5666 | "$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] | 5667 | "$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] | 5668 | 0 \ |
| 5669 | -c "Read from server: .* bytes read" |
| 5670 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5671 | # Tests for version negotiation |
| 5672 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5673 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5674 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5675 | "$P_SRV" \ |
| 5676 | "$P_CLI" \ |
| 5677 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5678 | -S "mbedtls_ssl_handshake returned" \ |
| 5679 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5680 | -s "Protocol is TLSv1.2" \ |
| 5681 | -c "Protocol is TLSv1.2" |
| 5682 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5683 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 5684 | run_test "Not supported version check: cli TLS 1.0" \ |
| 5685 | "$P_SRV" \ |
| 5686 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 5687 | 1 \ |
| 5688 | -s "Handshake protocol not within min/max boundaries" \ |
| 5689 | -c "Error in protocol version" \ |
| 5690 | -S "Protocol is TLSv1.0" \ |
| 5691 | -C "Handshake was completed" |
| 5692 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5693 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 5694 | run_test "Not supported version check: cli TLS 1.1" \ |
| 5695 | "$P_SRV" \ |
| 5696 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 5697 | 1 \ |
| 5698 | -s "Handshake protocol not within min/max boundaries" \ |
| 5699 | -c "Error in protocol version" \ |
| 5700 | -S "Protocol is TLSv1.1" \ |
| 5701 | -C "Handshake was completed" |
| 5702 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5703 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 5704 | run_test "Not supported version check: srv max TLS 1.0" \ |
| 5705 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 5706 | "$P_CLI" \ |
| 5707 | 1 \ |
| 5708 | -s "Error in protocol version" \ |
| 5709 | -c "Handshake protocol not within min/max boundaries" \ |
| 5710 | -S "Version: TLS1.0" \ |
| 5711 | -C "Protocol is TLSv1.0" |
| 5712 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5713 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 5714 | run_test "Not supported version check: srv max TLS 1.1" \ |
| 5715 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 5716 | "$P_CLI" \ |
| 5717 | 1 \ |
| 5718 | -s "Error in protocol version" \ |
| 5719 | -c "Handshake protocol not within min/max boundaries" \ |
| 5720 | -S "Version: TLS1.1" \ |
| 5721 | -C "Protocol is TLSv1.1" |
| 5722 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5723 | # Tests for ALPN extension |
| 5724 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5725 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5726 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5727 | "$P_SRV debug_level=3" \ |
| 5728 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5729 | 0 \ |
| 5730 | -C "client hello, adding alpn extension" \ |
| 5731 | -S "found alpn extension" \ |
| 5732 | -C "got an alert message, type: \\[2:120]" \ |
| 5733 | -S "server hello, adding alpn extension" \ |
| 5734 | -C "found alpn extension " \ |
| 5735 | -C "Application Layer Protocol is" \ |
| 5736 | -S "Application Layer Protocol is" |
| 5737 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5738 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5739 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5740 | "$P_SRV debug_level=3" \ |
| 5741 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5742 | 0 \ |
| 5743 | -c "client hello, adding alpn extension" \ |
| 5744 | -s "found alpn extension" \ |
| 5745 | -C "got an alert message, type: \\[2:120]" \ |
| 5746 | -S "server hello, adding alpn extension" \ |
| 5747 | -C "found alpn extension " \ |
| 5748 | -c "Application Layer Protocol is (none)" \ |
| 5749 | -S "Application Layer Protocol is" |
| 5750 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5751 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5752 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5753 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5754 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5755 | 0 \ |
| 5756 | -C "client hello, adding alpn extension" \ |
| 5757 | -S "found alpn extension" \ |
| 5758 | -C "got an alert message, type: \\[2:120]" \ |
| 5759 | -S "server hello, adding alpn extension" \ |
| 5760 | -C "found alpn extension " \ |
| 5761 | -C "Application Layer Protocol is" \ |
| 5762 | -s "Application Layer Protocol is (none)" |
| 5763 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5764 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5765 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5766 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5767 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5768 | 0 \ |
| 5769 | -c "client hello, adding alpn extension" \ |
| 5770 | -s "found alpn extension" \ |
| 5771 | -C "got an alert message, type: \\[2:120]" \ |
| 5772 | -s "server hello, adding alpn extension" \ |
| 5773 | -c "found alpn extension" \ |
| 5774 | -c "Application Layer Protocol is abc" \ |
| 5775 | -s "Application Layer Protocol is abc" |
| 5776 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5777 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5778 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5779 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5780 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5781 | 0 \ |
| 5782 | -c "client hello, adding alpn extension" \ |
| 5783 | -s "found alpn extension" \ |
| 5784 | -C "got an alert message, type: \\[2:120]" \ |
| 5785 | -s "server hello, adding alpn extension" \ |
| 5786 | -c "found alpn extension" \ |
| 5787 | -c "Application Layer Protocol is abc" \ |
| 5788 | -s "Application Layer Protocol is abc" |
| 5789 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5790 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5791 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5792 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5793 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5794 | 0 \ |
| 5795 | -c "client hello, adding alpn extension" \ |
| 5796 | -s "found alpn extension" \ |
| 5797 | -C "got an alert message, type: \\[2:120]" \ |
| 5798 | -s "server hello, adding alpn extension" \ |
| 5799 | -c "found alpn extension" \ |
| 5800 | -c "Application Layer Protocol is 1234" \ |
| 5801 | -s "Application Layer Protocol is 1234" |
| 5802 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5803 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5804 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5805 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 5806 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5807 | 1 \ |
| 5808 | -c "client hello, adding alpn extension" \ |
| 5809 | -s "found alpn extension" \ |
| 5810 | -c "got an alert message, type: \\[2:120]" \ |
| 5811 | -S "server hello, adding alpn extension" \ |
| 5812 | -C "found alpn extension" \ |
| 5813 | -C "Application Layer Protocol is 1234" \ |
| 5814 | -S "Application Layer Protocol is 1234" |
| 5815 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 5816 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5817 | # Tests for keyUsage in leaf certificates, part 1: |
| 5818 | # server-side certificate/suite selection |
| 5819 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5820 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5821 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5822 | "$P_SRV key_file=data_files/server2.key \ |
| 5823 | crt_file=data_files/server2.ku-ds.crt" \ |
| 5824 | "$P_CLI" \ |
| 5825 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 5826 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5827 | |
| 5828 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5829 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5830 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5831 | "$P_SRV key_file=data_files/server2.key \ |
| 5832 | crt_file=data_files/server2.ku-ke.crt" \ |
| 5833 | "$P_CLI" \ |
| 5834 | 0 \ |
| 5835 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 5836 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5837 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5838 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5839 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5840 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5841 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5842 | 1 \ |
| 5843 | -C "Ciphersuite is " |
| 5844 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5845 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5846 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5847 | "$P_SRV key_file=data_files/server5.key \ |
| 5848 | crt_file=data_files/server5.ku-ds.crt" \ |
| 5849 | "$P_CLI" \ |
| 5850 | 0 \ |
| 5851 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 5852 | |
| 5853 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5854 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5855 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5856 | "$P_SRV key_file=data_files/server5.key \ |
| 5857 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5858 | "$P_CLI" \ |
| 5859 | 0 \ |
| 5860 | -c "Ciphersuite is TLS-ECDH-" |
| 5861 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5862 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5863 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5864 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5865 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5866 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5867 | 1 \ |
| 5868 | -C "Ciphersuite is " |
| 5869 | |
| 5870 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5871 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5872 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5873 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5874 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5875 | "$O_SRV -key data_files/server2.key \ |
| 5876 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5877 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5878 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5879 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5880 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5881 | -C "Processing of the Certificate handshake message failed" \ |
| 5882 | -c "Ciphersuite is TLS-" |
| 5883 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5884 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5885 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5886 | "$O_SRV -key data_files/server2.key \ |
| 5887 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5888 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5889 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5890 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5891 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5892 | -C "Processing of the Certificate handshake message failed" \ |
| 5893 | -c "Ciphersuite is TLS-" |
| 5894 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5895 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5896 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5897 | "$O_SRV -key data_files/server2.key \ |
| 5898 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5899 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5900 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5901 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5902 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5903 | -C "Processing of the Certificate handshake message failed" \ |
| 5904 | -c "Ciphersuite is TLS-" |
| 5905 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5906 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5907 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5908 | "$O_SRV -key data_files/server2.key \ |
| 5909 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5910 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5911 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5912 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5913 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5914 | -c "Processing of the Certificate handshake message failed" \ |
| 5915 | -C "Ciphersuite is TLS-" |
| 5916 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5917 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5918 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 5919 | "$O_SRV -key data_files/server2.key \ |
| 5920 | -cert data_files/server2.ku-ke.crt" \ |
| 5921 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5922 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5923 | 0 \ |
| 5924 | -c "bad certificate (usage extensions)" \ |
| 5925 | -C "Processing of the Certificate handshake message failed" \ |
| 5926 | -c "Ciphersuite is TLS-" \ |
| 5927 | -c "! Usage does not match the keyUsage extension" |
| 5928 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5929 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5930 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5931 | "$O_SRV -key data_files/server2.key \ |
| 5932 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5933 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5934 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5935 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5936 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5937 | -C "Processing of the Certificate handshake message failed" \ |
| 5938 | -c "Ciphersuite is TLS-" |
| 5939 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5940 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5941 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5942 | "$O_SRV -key data_files/server2.key \ |
| 5943 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5944 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5945 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5946 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5947 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5948 | -c "Processing of the Certificate handshake message failed" \ |
| 5949 | -C "Ciphersuite is TLS-" |
| 5950 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5951 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5952 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 5953 | "$O_SRV -key data_files/server2.key \ |
| 5954 | -cert data_files/server2.ku-ds.crt" \ |
| 5955 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5956 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5957 | 0 \ |
| 5958 | -c "bad certificate (usage extensions)" \ |
| 5959 | -C "Processing of the Certificate handshake message failed" \ |
| 5960 | -c "Ciphersuite is TLS-" \ |
| 5961 | -c "! Usage does not match the keyUsage extension" |
| 5962 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5963 | # Tests for keyUsage in leaf certificates, part 3: |
| 5964 | # server-side checking of client cert |
| 5965 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5966 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5967 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5968 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5969 | "$O_CLI -key data_files/server2.key \ |
| 5970 | -cert data_files/server2.ku-ds.crt" \ |
| 5971 | 0 \ |
| 5972 | -S "bad certificate (usage extensions)" \ |
| 5973 | -S "Processing of the Certificate handshake message failed" |
| 5974 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5975 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5976 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5977 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5978 | "$O_CLI -key data_files/server2.key \ |
| 5979 | -cert data_files/server2.ku-ke.crt" \ |
| 5980 | 0 \ |
| 5981 | -s "bad certificate (usage extensions)" \ |
| 5982 | -S "Processing of the Certificate handshake message failed" |
| 5983 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5984 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5985 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5986 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5987 | "$O_CLI -key data_files/server2.key \ |
| 5988 | -cert data_files/server2.ku-ke.crt" \ |
| 5989 | 1 \ |
| 5990 | -s "bad certificate (usage extensions)" \ |
| 5991 | -s "Processing of the Certificate handshake message failed" |
| 5992 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5993 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5994 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5995 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5996 | "$O_CLI -key data_files/server5.key \ |
| 5997 | -cert data_files/server5.ku-ds.crt" \ |
| 5998 | 0 \ |
| 5999 | -S "bad certificate (usage extensions)" \ |
| 6000 | -S "Processing of the Certificate handshake message failed" |
| 6001 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6002 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6003 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6004 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6005 | "$O_CLI -key data_files/server5.key \ |
| 6006 | -cert data_files/server5.ku-ka.crt" \ |
| 6007 | 0 \ |
| 6008 | -s "bad certificate (usage extensions)" \ |
| 6009 | -S "Processing of the Certificate handshake message failed" |
| 6010 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6011 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 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 "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6015 | "$P_SRV key_file=data_files/server5.key \ |
| 6016 | crt_file=data_files/server5.eku-srv.crt" \ |
| 6017 | "$P_CLI" \ |
| 6018 | 0 |
| 6019 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6020 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6021 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6022 | "$P_SRV key_file=data_files/server5.key \ |
| 6023 | crt_file=data_files/server5.eku-srv.crt" \ |
| 6024 | "$P_CLI" \ |
| 6025 | 0 |
| 6026 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6027 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6028 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6029 | "$P_SRV key_file=data_files/server5.key \ |
| 6030 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 6031 | "$P_CLI" \ |
| 6032 | 0 |
| 6033 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6034 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6035 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 6036 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6037 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 6038 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6039 | 1 |
| 6040 | |
| 6041 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 6042 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6043 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6044 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6045 | "$O_SRV -key data_files/server5.key \ |
| 6046 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6047 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6048 | 0 \ |
| 6049 | -C "bad certificate (usage extensions)" \ |
| 6050 | -C "Processing of the Certificate handshake message failed" \ |
| 6051 | -c "Ciphersuite is TLS-" |
| 6052 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6053 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6054 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6055 | "$O_SRV -key data_files/server5.key \ |
| 6056 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6057 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6058 | 0 \ |
| 6059 | -C "bad certificate (usage extensions)" \ |
| 6060 | -C "Processing of the Certificate handshake message failed" \ |
| 6061 | -c "Ciphersuite is TLS-" |
| 6062 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6063 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6064 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6065 | "$O_SRV -key data_files/server5.key \ |
| 6066 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6067 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6068 | 0 \ |
| 6069 | -C "bad certificate (usage extensions)" \ |
| 6070 | -C "Processing of the Certificate handshake message failed" \ |
| 6071 | -c "Ciphersuite is TLS-" |
| 6072 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6073 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6074 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6075 | "$O_SRV -key data_files/server5.key \ |
| 6076 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6077 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6078 | 1 \ |
| 6079 | -c "bad certificate (usage extensions)" \ |
| 6080 | -c "Processing of the Certificate handshake message failed" \ |
| 6081 | -C "Ciphersuite is TLS-" |
| 6082 | |
| 6083 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 6084 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6085 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6086 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6087 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6088 | "$O_CLI -key data_files/server5.key \ |
| 6089 | -cert data_files/server5.eku-cli.crt" \ |
| 6090 | 0 \ |
| 6091 | -S "bad certificate (usage extensions)" \ |
| 6092 | -S "Processing of the Certificate handshake message failed" |
| 6093 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6094 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6095 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6096 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6097 | "$O_CLI -key data_files/server5.key \ |
| 6098 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 6099 | 0 \ |
| 6100 | -S "bad certificate (usage extensions)" \ |
| 6101 | -S "Processing of the Certificate handshake message failed" |
| 6102 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6103 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6104 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6105 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6106 | "$O_CLI -key data_files/server5.key \ |
| 6107 | -cert data_files/server5.eku-cs_any.crt" \ |
| 6108 | 0 \ |
| 6109 | -S "bad certificate (usage extensions)" \ |
| 6110 | -S "Processing of the Certificate handshake message failed" |
| 6111 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6112 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6113 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6114 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6115 | "$O_CLI -key data_files/server5.key \ |
| 6116 | -cert data_files/server5.eku-cs.crt" \ |
| 6117 | 0 \ |
| 6118 | -s "bad certificate (usage extensions)" \ |
| 6119 | -S "Processing of the Certificate handshake message failed" |
| 6120 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6121 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6122 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6123 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6124 | "$O_CLI -key data_files/server5.key \ |
| 6125 | -cert data_files/server5.eku-cs.crt" \ |
| 6126 | 1 \ |
| 6127 | -s "bad certificate (usage extensions)" \ |
| 6128 | -s "Processing of the Certificate handshake message failed" |
| 6129 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6130 | # Tests for DHM parameters loading |
| 6131 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6132 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6133 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6134 | "$P_SRV" \ |
| 6135 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6136 | debug_level=3" \ |
| 6137 | 0 \ |
| 6138 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 6139 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6140 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6141 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6142 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6143 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 6144 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6145 | debug_level=3" \ |
| 6146 | 0 \ |
| 6147 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 6148 | -c "value of 'DHM: G ' (2 bits)" |
| 6149 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6150 | # Tests for DHM client-side size checking |
| 6151 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6152 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6153 | run_test "DHM size: server default, client default, OK" \ |
| 6154 | "$P_SRV" \ |
| 6155 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6156 | debug_level=1" \ |
| 6157 | 0 \ |
| 6158 | -C "DHM prime too short:" |
| 6159 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6160 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6161 | run_test "DHM size: server default, client 2048, OK" \ |
| 6162 | "$P_SRV" \ |
| 6163 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6164 | debug_level=1 dhmlen=2048" \ |
| 6165 | 0 \ |
| 6166 | -C "DHM prime too short:" |
| 6167 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6168 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6169 | run_test "DHM size: server 1024, client default, OK" \ |
| 6170 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 6171 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6172 | debug_level=1" \ |
| 6173 | 0 \ |
| 6174 | -C "DHM prime too short:" |
| 6175 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6176 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6177 | run_test "DHM size: server 999, client 999, OK" \ |
| 6178 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 6179 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6180 | debug_level=1 dhmlen=999" \ |
| 6181 | 0 \ |
| 6182 | -C "DHM prime too short:" |
| 6183 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6184 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6185 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 6186 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 6187 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6188 | debug_level=1 dhmlen=1000" \ |
| 6189 | 0 \ |
| 6190 | -C "DHM prime too short:" |
| 6191 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6192 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6193 | run_test "DHM size: server 1000, client default, rejected" \ |
| 6194 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 6195 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6196 | debug_level=1" \ |
| 6197 | 1 \ |
| 6198 | -c "DHM prime too short:" |
| 6199 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6200 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6201 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 6202 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 6203 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6204 | debug_level=1 dhmlen=1001" \ |
| 6205 | 1 \ |
| 6206 | -c "DHM prime too short:" |
| 6207 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6208 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6209 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 6210 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 6211 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6212 | debug_level=1 dhmlen=1000" \ |
| 6213 | 1 \ |
| 6214 | -c "DHM prime too short:" |
| 6215 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6216 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6217 | run_test "DHM size: server 998, client 999, rejected" \ |
| 6218 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 6219 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6220 | debug_level=1 dhmlen=999" \ |
| 6221 | 1 \ |
| 6222 | -c "DHM prime too short:" |
| 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 | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6225 | run_test "DHM size: server default, client 2049, rejected" \ |
| 6226 | "$P_SRV" \ |
| 6227 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6228 | debug_level=1 dhmlen=2049" \ |
| 6229 | 1 \ |
| 6230 | -c "DHM prime too short:" |
| 6231 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6232 | # Tests for PSK callback |
| 6233 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6234 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6235 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6236 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 6237 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6238 | psk_identity=foo psk=abc123" \ |
| 6239 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6240 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 6241 | -S "SSL - Unknown identity received" \ |
| 6242 | -S "SSL - Verification of the message MAC failed" |
| 6243 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6244 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6245 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6246 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 6247 | "$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] | 6248 | "$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] | 6249 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6250 | 0 \ |
| 6251 | -c "skip PMS generation for opaque PSK"\ |
| 6252 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6253 | -C "session hash for extended master secret"\ |
| 6254 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6255 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6256 | -S "SSL - Unknown identity received" \ |
| 6257 | -S "SSL - Verification of the message MAC failed" |
| 6258 | |
| 6259 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6260 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6261 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 6262 | "$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] | 6263 | "$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] | 6264 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6265 | 0 \ |
| 6266 | -c "skip PMS generation for opaque PSK"\ |
| 6267 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6268 | -C "session hash for extended master secret"\ |
| 6269 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6270 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6271 | -S "SSL - Unknown identity received" \ |
| 6272 | -S "SSL - Verification of the message MAC failed" |
| 6273 | |
| 6274 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6275 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6276 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 6277 | "$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] | 6278 | "$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] | 6279 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6280 | 0 \ |
| 6281 | -c "skip PMS generation for opaque PSK"\ |
| 6282 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6283 | -c "session hash for extended master secret"\ |
| 6284 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6285 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6286 | -S "SSL - Unknown identity received" \ |
| 6287 | -S "SSL - Verification of the message MAC failed" |
| 6288 | |
| 6289 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6290 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6291 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 6292 | "$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] | 6293 | "$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] | 6294 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6295 | 0 \ |
| 6296 | -c "skip PMS generation for opaque PSK"\ |
| 6297 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6298 | -c "session hash for extended master secret"\ |
| 6299 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6300 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6301 | -S "SSL - Unknown identity received" \ |
| 6302 | -S "SSL - Verification of the message MAC failed" |
| 6303 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6304 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6305 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6306 | 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] | 6307 | "$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" \ |
| 6308 | "$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] | 6309 | psk_identity=foo psk=abc123" \ |
| 6310 | 0 \ |
| 6311 | -C "skip PMS generation for opaque PSK"\ |
| 6312 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6313 | -C "session hash for extended master secret"\ |
| 6314 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6315 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6316 | -S "SSL - Unknown identity received" \ |
| 6317 | -S "SSL - Verification of the message MAC failed" |
| 6318 | |
| 6319 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6320 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6321 | 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] | 6322 | "$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" \ |
| 6323 | "$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] | 6324 | psk_identity=foo psk=abc123" \ |
| 6325 | 0 \ |
| 6326 | -C "skip PMS generation for opaque PSK"\ |
| 6327 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6328 | -C "session hash for extended master secret"\ |
| 6329 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6330 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6331 | -S "SSL - Unknown identity received" \ |
| 6332 | -S "SSL - Verification of the message MAC failed" |
| 6333 | |
| 6334 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6335 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6336 | 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] | 6337 | "$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] | 6338 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6339 | "$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] | 6340 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 6341 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6342 | -c "session hash for extended master secret"\ |
| 6343 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6344 | -C "skip PMS generation for opaque PSK"\ |
| 6345 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6346 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6347 | -S "SSL - Unknown identity received" \ |
| 6348 | -S "SSL - Verification of the message MAC failed" |
| 6349 | |
| 6350 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6351 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6352 | 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] | 6353 | "$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] | 6354 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6355 | "$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] | 6356 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 6357 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6358 | -c "session hash for extended master secret"\ |
| 6359 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6360 | -C "skip PMS generation for opaque PSK"\ |
| 6361 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6362 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6363 | -S "SSL - Unknown identity received" \ |
| 6364 | -S "SSL - Verification of the message MAC failed" |
| 6365 | |
| 6366 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6367 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6368 | 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] | 6369 | "$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" \ |
| 6370 | "$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] | 6371 | psk_identity=def psk=beef" \ |
| 6372 | 0 \ |
| 6373 | -C "skip PMS generation for opaque PSK"\ |
| 6374 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6375 | -C "session hash for extended master secret"\ |
| 6376 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6377 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6378 | -S "SSL - Unknown identity received" \ |
| 6379 | -S "SSL - Verification of the message MAC failed" |
| 6380 | |
| 6381 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6382 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6383 | 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] | 6384 | "$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" \ |
| 6385 | "$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] | 6386 | psk_identity=def psk=beef" \ |
| 6387 | 0 \ |
| 6388 | -C "skip PMS generation for opaque PSK"\ |
| 6389 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6390 | -C "session hash for extended master secret"\ |
| 6391 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6392 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6393 | -S "SSL - Unknown identity received" \ |
| 6394 | -S "SSL - Verification of the message MAC failed" |
| 6395 | |
| 6396 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6397 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6398 | 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] | 6399 | "$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] | 6400 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6401 | "$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] | 6402 | psk_identity=abc psk=dead extended_ms=1" \ |
| 6403 | 0 \ |
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"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6406 | -C "skip PMS generation for opaque PSK"\ |
| 6407 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6408 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6409 | -S "SSL - Unknown identity received" \ |
| 6410 | -S "SSL - Verification of the message MAC failed" |
| 6411 | |
| 6412 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6413 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6414 | 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] | 6415 | "$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] | 6416 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6417 | "$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] | 6418 | psk_identity=abc psk=dead extended_ms=1" \ |
| 6419 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6420 | -c "session hash for extended master secret"\ |
| 6421 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6422 | -C "skip PMS generation for opaque PSK"\ |
| 6423 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6424 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6425 | -S "SSL - Unknown identity received" \ |
| 6426 | -S "SSL - Verification of the message MAC failed" |
| 6427 | |
| 6428 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6429 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6430 | 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] | 6431 | "$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" \ |
| 6432 | "$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] | 6433 | psk_identity=def psk=beef" \ |
| 6434 | 0 \ |
| 6435 | -C "skip PMS generation for opaque PSK"\ |
| 6436 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6437 | -C "session hash for extended master secret"\ |
| 6438 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6439 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6440 | -S "SSL - Unknown identity received" \ |
| 6441 | -S "SSL - Verification of the message MAC failed" |
| 6442 | |
| 6443 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6444 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6445 | 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] | 6446 | "$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" \ |
| 6447 | "$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] | 6448 | psk_identity=def psk=beef" \ |
| 6449 | 0 \ |
| 6450 | -C "skip PMS generation for opaque PSK"\ |
| 6451 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6452 | -C "session hash for extended master secret"\ |
| 6453 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6454 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6455 | -S "SSL - Unknown identity received" \ |
| 6456 | -S "SSL - Verification of the message MAC failed" |
| 6457 | |
| 6458 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6459 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6460 | 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] | 6461 | "$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" \ |
| 6462 | "$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] | 6463 | psk_identity=def psk=beef" \ |
| 6464 | 0 \ |
| 6465 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6466 | -C "session hash for extended master secret"\ |
| 6467 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6468 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6469 | -S "SSL - Unknown identity received" \ |
| 6470 | -S "SSL - Verification of the message MAC failed" |
| 6471 | |
| 6472 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6473 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6474 | 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] | 6475 | "$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" \ |
| 6476 | "$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] | 6477 | psk_identity=def psk=beef" \ |
| 6478 | 0 \ |
| 6479 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6480 | -C "session hash for extended master secret"\ |
| 6481 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6482 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6483 | -S "SSL - Unknown identity received" \ |
| 6484 | -S "SSL - Verification of the message MAC failed" |
| 6485 | |
| 6486 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6487 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6488 | 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] | 6489 | "$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" \ |
| 6490 | "$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] | 6491 | psk_identity=def psk=beef" \ |
| 6492 | 1 \ |
| 6493 | -s "SSL - Verification of the message MAC failed" |
| 6494 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6495 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6496 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 6497 | "$P_SRV" \ |
| 6498 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6499 | psk_identity=foo psk=abc123" \ |
| 6500 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 6501 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6502 | -S "SSL - Unknown identity received" \ |
| 6503 | -S "SSL - Verification of the message MAC failed" |
| 6504 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6505 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6506 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6507 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 6508 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6509 | psk_identity=foo psk=abc123" \ |
| 6510 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6511 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6512 | -s "SSL - Unknown identity received" \ |
| 6513 | -S "SSL - Verification of the message MAC failed" |
| 6514 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6515 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6516 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6517 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6518 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6519 | psk_identity=abc psk=dead" \ |
| 6520 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6521 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6522 | -S "SSL - Unknown identity received" \ |
| 6523 | -S "SSL - Verification of the message MAC failed" |
| 6524 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6525 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6526 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6527 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6528 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6529 | psk_identity=def psk=beef" \ |
| 6530 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6531 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6532 | -S "SSL - Unknown identity received" \ |
| 6533 | -S "SSL - Verification of the message MAC failed" |
| 6534 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6535 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6536 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6537 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6538 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6539 | psk_identity=ghi psk=beef" \ |
| 6540 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6541 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6542 | -s "SSL - Unknown identity received" \ |
| 6543 | -S "SSL - Verification of the message MAC failed" |
| 6544 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6545 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6546 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6547 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6548 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6549 | psk_identity=abc psk=beef" \ |
| 6550 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6551 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6552 | -S "SSL - Unknown identity received" \ |
| 6553 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6554 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6555 | # Tests for EC J-PAKE |
| 6556 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6557 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6558 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6559 | run_test "ECJPAKE: client not configured" \ |
| 6560 | "$P_SRV debug_level=3" \ |
| 6561 | "$P_CLI debug_level=3" \ |
| 6562 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6563 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6564 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6565 | -S "found ecjpake kkpp extension" \ |
| 6566 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6567 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6568 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6569 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 6570 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6571 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6572 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6573 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6574 | run_test "ECJPAKE: server not configured" \ |
| 6575 | "$P_SRV debug_level=3" \ |
| 6576 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 6577 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6578 | 1 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6579 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6580 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6581 | -s "found ecjpake kkpp extension" \ |
| 6582 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6583 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6584 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6585 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 6586 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6587 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6588 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6589 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6590 | run_test "ECJPAKE: working, TLS" \ |
| 6591 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 6592 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 6593 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 6594 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6595 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6596 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6597 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6598 | -s "found ecjpake kkpp extension" \ |
| 6599 | -S "skip ecjpake kkpp extension" \ |
| 6600 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6601 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6602 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 6603 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6604 | -S "SSL - Verification of the message MAC failed" |
| 6605 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6606 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6607 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6608 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6609 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 6610 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 6611 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 6612 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6613 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6614 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6615 | -s "SSL - Verification of the message MAC failed" |
| 6616 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6617 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6618 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6619 | run_test "ECJPAKE: working, DTLS" \ |
| 6620 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 6621 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 6622 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6623 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6624 | -c "re-using cached ecjpake parameters" \ |
| 6625 | -S "SSL - Verification of the message MAC failed" |
| 6626 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6627 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6628 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6629 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 6630 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 6631 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 6632 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6633 | 0 \ |
| 6634 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6635 | -S "SSL - Verification of the message MAC failed" |
| 6636 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6637 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6638 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6639 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6640 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 6641 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 6642 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 6643 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6644 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6645 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6646 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6647 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 6648 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6649 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6650 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 6651 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 6652 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 6653 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 6654 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6655 | 0 |
| 6656 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 6657 | # Test for ClientHello without extensions |
| 6658 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 6659 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6660 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 6661 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 6662 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6663 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 6664 | 0 \ |
| 6665 | -s "dumping 'client hello extensions' (0 bytes)" |
| 6666 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6667 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6668 | |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 6669 | # The server first reads buffer_size-1 bytes, then reads the remainder. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6670 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6671 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 6672 | "$P_SRV buffer_size=100" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6673 | "$P_CLI request_size=100" \ |
| 6674 | 0 \ |
| 6675 | -s "Read from client: 100 bytes read$" |
| 6676 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6677 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 6678 | run_test "mbedtls_ssl_get_bytes_avail: extra data (+1)" \ |
| 6679 | "$P_SRV buffer_size=100" \ |
| 6680 | "$P_CLI request_size=101" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6681 | 0 \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 6682 | -s "Read from client: 101 bytes read (100 + 1)" |
| 6683 | |
| 6684 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6685 | requires_max_content_len 200 |
| 6686 | run_test "mbedtls_ssl_get_bytes_avail: extra data (*2)" \ |
| 6687 | "$P_SRV buffer_size=100" \ |
| 6688 | "$P_CLI request_size=200" \ |
| 6689 | 0 \ |
| 6690 | -s "Read from client: 200 bytes read (100 + 100)" |
| 6691 | |
| 6692 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6693 | run_test "mbedtls_ssl_get_bytes_avail: extra data (max)" \ |
| 6694 | "$P_SRV buffer_size=100" \ |
| 6695 | "$P_CLI request_size=$MAX_CONTENT_LEN" \ |
| 6696 | 0 \ |
| 6697 | -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] | 6698 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6699 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6700 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6701 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6702 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6703 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6704 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6705 | 0 \ |
| 6706 | -s "Read from client: 1 bytes read" |
| 6707 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6708 | run_test "Small client packet TLS 1.2 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 6709 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6710 | "$P_CLI request_size=1 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6711 | 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] | 6712 | 0 \ |
| 6713 | -s "Read from client: 1 bytes read" |
| 6714 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6715 | run_test "Small client packet TLS 1.2 BlockCipher larger MAC" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6716 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6717 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6718 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6719 | 0 \ |
| 6720 | -s "Read from client: 1 bytes read" |
| 6721 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6722 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6723 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6724 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6725 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6726 | 0 \ |
| 6727 | -s "Read from client: 1 bytes read" |
| 6728 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6729 | run_test "Small client packet TLS 1.2 AEAD shorter tag" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6730 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6731 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6732 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6733 | 0 \ |
| 6734 | -s "Read from client: 1 bytes read" |
| 6735 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6736 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6737 | |
| 6738 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6739 | run_test "Small client packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6740 | "$P_SRV dtls=1 force_version=dtls12" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6741 | "$P_CLI dtls=1 request_size=1 \ |
| 6742 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6743 | 0 \ |
| 6744 | -s "Read from client: 1 bytes read" |
| 6745 | |
| 6746 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6747 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6748 | "$P_SRV dtls=1 force_version=dtls12 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6749 | "$P_CLI dtls=1 request_size=1 \ |
| 6750 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6751 | 0 \ |
| 6752 | -s "Read from client: 1 bytes read" |
| 6753 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6754 | # Tests for small server packets |
| 6755 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6756 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 6757 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6758 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6759 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6760 | 0 \ |
| 6761 | -c "Read from server: 1 bytes read" |
| 6762 | |
| 6763 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6764 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6765 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6766 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 6767 | 0 \ |
| 6768 | -c "Read from server: 1 bytes read" |
| 6769 | |
| 6770 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6771 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6772 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6773 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6774 | 0 \ |
| 6775 | -c "Read from server: 1 bytes read" |
| 6776 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6777 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 6778 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6779 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6780 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6781 | 0 \ |
| 6782 | -c "Read from server: 1 bytes read" |
| 6783 | |
| 6784 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 6785 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6786 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6787 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6788 | 0 \ |
| 6789 | -c "Read from server: 1 bytes read" |
| 6790 | |
| 6791 | # Tests for small server packets in DTLS |
| 6792 | |
| 6793 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6794 | run_test "Small server packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6795 | "$P_SRV dtls=1 response_size=1 force_version=dtls12" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6796 | "$P_CLI dtls=1 \ |
| 6797 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6798 | 0 \ |
| 6799 | -c "Read from server: 1 bytes read" |
| 6800 | |
| 6801 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6802 | run_test "Small server packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6803 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6804 | "$P_CLI dtls=1 \ |
| 6805 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6806 | 0 \ |
| 6807 | -c "Read from server: 1 bytes read" |
| 6808 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6809 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6810 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6811 | # How many fragments do we expect to write $1 bytes? |
| 6812 | fragments_for_write() { |
| 6813 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 6814 | } |
| 6815 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6816 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6817 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6818 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6819 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6820 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6821 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6822 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6823 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6824 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6825 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6826 | "$P_CLI request_size=16384 force_version=tls12 etm=0 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6827 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6828 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6829 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6830 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6831 | run_test "Large client packet TLS 1.2 BlockCipher larger MAC" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6832 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6833 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6834 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6835 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6836 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6837 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6838 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6839 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6840 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6841 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6842 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6843 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6844 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6845 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6846 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6847 | run_test "Large client packet TLS 1.2 AEAD shorter tag" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6848 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6849 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6850 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6851 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6852 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6853 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6854 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6855 | # 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] | 6856 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 6857 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6858 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6859 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6860 | 0 \ |
| 6861 | -c "Read from server: 16384 bytes read" |
| 6862 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6863 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6864 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6865 | "$P_CLI force_version=tls12 etm=0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6866 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6867 | 0 \ |
| 6868 | -s "16384 bytes written in 1 fragments" \ |
| 6869 | -c "Read from server: 16384 bytes read" |
| 6870 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6871 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6872 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6873 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6874 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6875 | 0 \ |
| 6876 | -c "Read from server: 16384 bytes read" |
| 6877 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6878 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 6879 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6880 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6881 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6882 | 0 \ |
| 6883 | -s "16384 bytes written in 1 fragments" \ |
| 6884 | -c "Read from server: 16384 bytes read" |
| 6885 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6886 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 6887 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6888 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6889 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6890 | 0 \ |
| 6891 | -c "Read from server: 16384 bytes read" |
| 6892 | |
| 6893 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 6894 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6895 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6896 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6897 | 0 \ |
| 6898 | -c "Read from server: 16384 bytes read" |
| 6899 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6900 | # Tests for restartable ECC |
| 6901 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6902 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 6903 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6904 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6905 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6906 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6907 | run_test "EC restart: TLS, default" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6908 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6909 | "$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] | 6910 | 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] | 6911 | debug_level=1" \ |
| 6912 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6913 | -C "x509_verify_cert.*4b00" \ |
| 6914 | -C "mbedtls_pk_verify.*4b00" \ |
| 6915 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6916 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6917 | |
| 6918 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6919 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6920 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6921 | run_test "EC restart: TLS, max_ops=0" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6922 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6923 | "$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] | 6924 | 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] | 6925 | debug_level=1 ec_max_ops=0" \ |
| 6926 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6927 | -C "x509_verify_cert.*4b00" \ |
| 6928 | -C "mbedtls_pk_verify.*4b00" \ |
| 6929 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6930 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6931 | |
| 6932 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6933 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6934 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6935 | run_test "EC restart: TLS, max_ops=65535" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6936 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6937 | "$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] | 6938 | 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] | 6939 | debug_level=1 ec_max_ops=65535" \ |
| 6940 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6941 | -C "x509_verify_cert.*4b00" \ |
| 6942 | -C "mbedtls_pk_verify.*4b00" \ |
| 6943 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6944 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6945 | |
| 6946 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6947 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6948 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6949 | run_test "EC restart: TLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6950 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6951 | "$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] | 6952 | 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] | 6953 | debug_level=1 ec_max_ops=1000" \ |
| 6954 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6955 | -c "x509_verify_cert.*4b00" \ |
| 6956 | -c "mbedtls_pk_verify.*4b00" \ |
| 6957 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6958 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6959 | |
| 6960 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6961 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6962 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6963 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6964 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6965 | crt_file=data_files/server5-badsign.crt \ |
| 6966 | key_file=data_files/server5.key" \ |
| 6967 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6968 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6969 | debug_level=1 ec_max_ops=1000" \ |
| 6970 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6971 | -c "x509_verify_cert.*4b00" \ |
| 6972 | -C "mbedtls_pk_verify.*4b00" \ |
| 6973 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6974 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6975 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6976 | -c "! mbedtls_ssl_handshake returned" \ |
| 6977 | -c "X509 - Certificate verification failed" |
| 6978 | |
| 6979 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6980 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6981 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6982 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6983 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6984 | crt_file=data_files/server5-badsign.crt \ |
| 6985 | key_file=data_files/server5.key" \ |
| 6986 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6987 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6988 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 6989 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6990 | -c "x509_verify_cert.*4b00" \ |
| 6991 | -c "mbedtls_pk_verify.*4b00" \ |
| 6992 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6993 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6994 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6995 | -C "! mbedtls_ssl_handshake returned" \ |
| 6996 | -C "X509 - Certificate verification failed" |
| 6997 | |
| 6998 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6999 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7000 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7001 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7002 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7003 | crt_file=data_files/server5-badsign.crt \ |
| 7004 | key_file=data_files/server5.key" \ |
| 7005 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7006 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7007 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 7008 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7009 | -C "x509_verify_cert.*4b00" \ |
| 7010 | -c "mbedtls_pk_verify.*4b00" \ |
| 7011 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7012 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7013 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 7014 | -C "! mbedtls_ssl_handshake returned" \ |
| 7015 | -C "X509 - Certificate verification failed" |
| 7016 | |
| 7017 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7018 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7019 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7020 | run_test "EC restart: DTLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7021 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7022 | "$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] | 7023 | 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] | 7024 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 7025 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7026 | -c "x509_verify_cert.*4b00" \ |
| 7027 | -c "mbedtls_pk_verify.*4b00" \ |
| 7028 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7029 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7030 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7031 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7032 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7033 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7034 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7035 | "$P_SRV curves=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7036 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7037 | debug_level=1 ec_max_ops=1000" \ |
| 7038 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7039 | -c "x509_verify_cert.*4b00" \ |
| 7040 | -c "mbedtls_pk_verify.*4b00" \ |
| 7041 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7042 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7043 | |
| 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 | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7047 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7048 | "$P_SRV curves=secp256r1 psk=abc123" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7049 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7050 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 7051 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7052 | -C "x509_verify_cert.*4b00" \ |
| 7053 | -C "mbedtls_pk_verify.*4b00" \ |
| 7054 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7055 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7056 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7057 | # Tests of asynchronous private key support in SSL |
| 7058 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7059 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7060 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7061 | run_test "SSL async private: sign, delay=0" \ |
| 7062 | "$P_SRV \ |
| 7063 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7064 | "$P_CLI" \ |
| 7065 | 0 \ |
| 7066 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7067 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7068 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7069 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7070 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7071 | run_test "SSL async private: sign, delay=1" \ |
| 7072 | "$P_SRV \ |
| 7073 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7074 | "$P_CLI" \ |
| 7075 | 0 \ |
| 7076 | -s "Async sign callback: using key slot " \ |
| 7077 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7078 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7079 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 7080 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7081 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 7082 | run_test "SSL async private: sign, delay=2" \ |
| 7083 | "$P_SRV \ |
| 7084 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 7085 | "$P_CLI" \ |
| 7086 | 0 \ |
| 7087 | -s "Async sign callback: using key slot " \ |
| 7088 | -U "Async sign callback: using key slot " \ |
| 7089 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 7090 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7091 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7092 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7093 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 7094 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7095 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 7096 | run_test "SSL async private: sign, SNI" \ |
| 7097 | "$P_SRV debug_level=3 \ |
| 7098 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 7099 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 7100 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 7101 | "$P_CLI server_name=polarssl.example" \ |
| 7102 | 0 \ |
| 7103 | -s "Async sign callback: using key slot " \ |
| 7104 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 7105 | -s "parse ServerName extension" \ |
| 7106 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 7107 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 7108 | |
| 7109 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7110 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7111 | run_test "SSL async private: decrypt, delay=0" \ |
| 7112 | "$P_SRV \ |
| 7113 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 7114 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7115 | 0 \ |
| 7116 | -s "Async decrypt callback: using key slot " \ |
| 7117 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7118 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7119 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7120 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7121 | run_test "SSL async private: decrypt, delay=1" \ |
| 7122 | "$P_SRV \ |
| 7123 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7124 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7125 | 0 \ |
| 7126 | -s "Async decrypt callback: using key slot " \ |
| 7127 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7128 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7129 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7130 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7131 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7132 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 7133 | "$P_SRV psk=abc123 \ |
| 7134 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 7135 | "$P_CLI psk=abc123 \ |
| 7136 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 7137 | 0 \ |
| 7138 | -s "Async decrypt callback: using key slot " \ |
| 7139 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7140 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7141 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7142 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7143 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 7144 | "$P_SRV psk=abc123 \ |
| 7145 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7146 | "$P_CLI psk=abc123 \ |
| 7147 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 7148 | 0 \ |
| 7149 | -s "Async decrypt callback: using key slot " \ |
| 7150 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7151 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7152 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7153 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7154 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7155 | run_test "SSL async private: sign callback not present" \ |
| 7156 | "$P_SRV \ |
| 7157 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7158 | "$P_CLI; [ \$? -eq 1 ] && |
| 7159 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7160 | 0 \ |
| 7161 | -S "Async sign callback" \ |
| 7162 | -s "! mbedtls_ssl_handshake returned" \ |
| 7163 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 7164 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 7165 | -s "Successful connection" |
| 7166 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7167 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7168 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7169 | run_test "SSL async private: decrypt callback not present" \ |
| 7170 | "$P_SRV debug_level=1 \ |
| 7171 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 7172 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 7173 | [ \$? -eq 1 ] && $P_CLI" \ |
| 7174 | 0 \ |
| 7175 | -S "Async decrypt callback" \ |
| 7176 | -s "! mbedtls_ssl_handshake returned" \ |
| 7177 | -s "got no RSA private key" \ |
| 7178 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 7179 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7180 | |
| 7181 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7182 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7183 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7184 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7185 | "$P_SRV \ |
| 7186 | async_operations=s async_private_delay1=1 \ |
| 7187 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7188 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7189 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7190 | 0 \ |
| 7191 | -s "Async sign callback: using key slot 0," \ |
| 7192 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7193 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7194 | |
| 7195 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7196 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7197 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7198 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7199 | "$P_SRV \ |
| 7200 | async_operations=s async_private_delay2=1 \ |
| 7201 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7202 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7203 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7204 | 0 \ |
| 7205 | -s "Async sign callback: using key slot 0," \ |
| 7206 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7207 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7208 | |
| 7209 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7210 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7211 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 7212 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7213 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 7214 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7215 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7216 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7217 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7218 | 0 \ |
| 7219 | -s "Async sign callback: using key slot 1," \ |
| 7220 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7221 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7222 | |
| 7223 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7224 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7225 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7226 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7227 | "$P_SRV \ |
| 7228 | async_operations=s async_private_delay1=1 \ |
| 7229 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7230 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7231 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7232 | 0 \ |
| 7233 | -s "Async sign callback: no key matches this certificate." |
| 7234 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7235 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7236 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7237 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7238 | "$P_SRV \ |
| 7239 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7240 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7241 | "$P_CLI" \ |
| 7242 | 1 \ |
| 7243 | -s "Async sign callback: injected error" \ |
| 7244 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 7245 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7246 | -s "! mbedtls_ssl_handshake returned" |
| 7247 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7248 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7249 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7250 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7251 | "$P_SRV \ |
| 7252 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7253 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7254 | "$P_CLI" \ |
| 7255 | 1 \ |
| 7256 | -s "Async sign callback: using key slot " \ |
| 7257 | -S "Async resume" \ |
| 7258 | -s "Async cancel" |
| 7259 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7260 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7261 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7262 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7263 | "$P_SRV \ |
| 7264 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7265 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7266 | "$P_CLI" \ |
| 7267 | 1 \ |
| 7268 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7269 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 7270 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7271 | -s "! mbedtls_ssl_handshake returned" |
| 7272 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7273 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7274 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7275 | run_test "SSL async private: decrypt, error in start" \ |
| 7276 | "$P_SRV \ |
| 7277 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7278 | async_private_error=1" \ |
| 7279 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7280 | 1 \ |
| 7281 | -s "Async decrypt callback: injected error" \ |
| 7282 | -S "Async resume" \ |
| 7283 | -S "Async cancel" \ |
| 7284 | -s "! mbedtls_ssl_handshake returned" |
| 7285 | |
| 7286 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7287 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7288 | run_test "SSL async private: decrypt, cancel after start" \ |
| 7289 | "$P_SRV \ |
| 7290 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7291 | async_private_error=2" \ |
| 7292 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7293 | 1 \ |
| 7294 | -s "Async decrypt callback: using key slot " \ |
| 7295 | -S "Async resume" \ |
| 7296 | -s "Async cancel" |
| 7297 | |
| 7298 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7299 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7300 | run_test "SSL async private: decrypt, error in resume" \ |
| 7301 | "$P_SRV \ |
| 7302 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7303 | async_private_error=3" \ |
| 7304 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7305 | 1 \ |
| 7306 | -s "Async decrypt callback: using key slot " \ |
| 7307 | -s "Async resume callback: decrypt done but injected error" \ |
| 7308 | -S "Async cancel" \ |
| 7309 | -s "! mbedtls_ssl_handshake returned" |
| 7310 | |
| 7311 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7312 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7313 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7314 | "$P_SRV \ |
| 7315 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7316 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7317 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 7318 | 0 \ |
| 7319 | -s "Async cancel" \ |
| 7320 | -s "! mbedtls_ssl_handshake returned" \ |
| 7321 | -s "Async resume" \ |
| 7322 | -s "Successful connection" |
| 7323 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7324 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7325 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7326 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7327 | "$P_SRV \ |
| 7328 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7329 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7330 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 7331 | 0 \ |
| 7332 | -s "! mbedtls_ssl_handshake returned" \ |
| 7333 | -s "Async resume" \ |
| 7334 | -s "Successful connection" |
| 7335 | |
| 7336 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7337 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7338 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7339 | 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] | 7340 | "$P_SRV \ |
| 7341 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 7342 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7343 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7344 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 7345 | [ \$? -eq 1 ] && |
| 7346 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7347 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 7348 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7349 | -S "Async resume" \ |
| 7350 | -s "Async cancel" \ |
| 7351 | -s "! mbedtls_ssl_handshake returned" \ |
| 7352 | -s "Async sign callback: no key matches this certificate." \ |
| 7353 | -s "Successful connection" |
| 7354 | |
| 7355 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7356 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7357 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7358 | 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] | 7359 | "$P_SRV \ |
| 7360 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 7361 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7362 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7363 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 7364 | [ \$? -eq 1 ] && |
| 7365 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7366 | 0 \ |
| 7367 | -s "Async resume" \ |
| 7368 | -s "! mbedtls_ssl_handshake returned" \ |
| 7369 | -s "Async sign callback: no key matches this certificate." \ |
| 7370 | -s "Successful connection" |
| 7371 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7372 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7373 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7374 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7375 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7376 | "$P_SRV \ |
| 7377 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7378 | exchanges=2 renegotiation=1" \ |
| 7379 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7380 | 0 \ |
| 7381 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7382 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7383 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7384 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7385 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7386 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7387 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7388 | "$P_SRV \ |
| 7389 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7390 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7391 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 7392 | 0 \ |
| 7393 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7394 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7395 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7396 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7397 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7398 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7399 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7400 | "$P_SRV \ |
| 7401 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7402 | exchanges=2 renegotiation=1" \ |
| 7403 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 7404 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7405 | 0 \ |
| 7406 | -s "Async decrypt callback: using key slot " \ |
| 7407 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7408 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7409 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7410 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7411 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7412 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7413 | "$P_SRV \ |
| 7414 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7415 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7416 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 7417 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7418 | 0 \ |
| 7419 | -s "Async decrypt callback: using key slot " \ |
| 7420 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7421 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7422 | # Tests for ECC extensions (rfc 4492) |
| 7423 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7424 | requires_config_enabled MBEDTLS_AES_C |
| 7425 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7426 | requires_config_enabled MBEDTLS_SHA256_C |
| 7427 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7428 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7429 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 7430 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7431 | "$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] | 7432 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 7433 | -C "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7434 | -C "client hello, adding supported_point_formats extension" \ |
| 7435 | -S "found supported elliptic curves extension" \ |
| 7436 | -S "found supported point formats extension" |
| 7437 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7438 | requires_config_enabled MBEDTLS_AES_C |
| 7439 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7440 | requires_config_enabled MBEDTLS_SHA256_C |
| 7441 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7442 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7443 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7444 | "$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] | 7445 | "$P_CLI debug_level=3" \ |
| 7446 | 0 \ |
| 7447 | -C "found supported_point_formats extension" \ |
| 7448 | -S "server hello, supported_point_formats extension" |
| 7449 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7450 | requires_config_enabled MBEDTLS_AES_C |
| 7451 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7452 | requires_config_enabled MBEDTLS_SHA256_C |
| 7453 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7454 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7455 | run_test "Force an ECC ciphersuite in the client side" \ |
| 7456 | "$P_SRV debug_level=3" \ |
| 7457 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7458 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 7459 | -c "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7460 | -c "client hello, adding supported_point_formats extension" \ |
| 7461 | -s "found supported elliptic curves extension" \ |
| 7462 | -s "found supported point formats extension" |
| 7463 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7464 | requires_config_enabled MBEDTLS_AES_C |
| 7465 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7466 | requires_config_enabled MBEDTLS_SHA256_C |
| 7467 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7468 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7469 | run_test "Force an ECC ciphersuite in the server side" \ |
| 7470 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7471 | "$P_CLI debug_level=3" \ |
| 7472 | 0 \ |
| 7473 | -c "found supported_point_formats extension" \ |
| 7474 | -s "server hello, supported_point_formats extension" |
| 7475 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7476 | # Tests for DTLS HelloVerifyRequest |
| 7477 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7478 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7479 | run_test "DTLS cookie: enabled" \ |
| 7480 | "$P_SRV dtls=1 debug_level=2" \ |
| 7481 | "$P_CLI dtls=1 debug_level=2" \ |
| 7482 | 0 \ |
| 7483 | -s "cookie verification failed" \ |
| 7484 | -s "cookie verification passed" \ |
| 7485 | -S "cookie verification skipped" \ |
| 7486 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7487 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7488 | -S "SSL - The requested feature is not available" |
| 7489 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7490 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7491 | run_test "DTLS cookie: disabled" \ |
| 7492 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 7493 | "$P_CLI dtls=1 debug_level=2" \ |
| 7494 | 0 \ |
| 7495 | -S "cookie verification failed" \ |
| 7496 | -S "cookie verification passed" \ |
| 7497 | -s "cookie verification skipped" \ |
| 7498 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7499 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7500 | -S "SSL - The requested feature is not available" |
| 7501 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7502 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7503 | run_test "DTLS cookie: default (failing)" \ |
| 7504 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 7505 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 7506 | 1 \ |
| 7507 | -s "cookie verification failed" \ |
| 7508 | -S "cookie verification passed" \ |
| 7509 | -S "cookie verification skipped" \ |
| 7510 | -C "received hello verify request" \ |
| 7511 | -S "hello verification requested" \ |
| 7512 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7513 | |
| 7514 | requires_ipv6 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7515 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7516 | run_test "DTLS cookie: enabled, IPv6" \ |
| 7517 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 7518 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 7519 | 0 \ |
| 7520 | -s "cookie verification failed" \ |
| 7521 | -s "cookie verification passed" \ |
| 7522 | -S "cookie verification skipped" \ |
| 7523 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7524 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7525 | -S "SSL - The requested feature is not available" |
| 7526 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7527 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7528 | run_test "DTLS cookie: enabled, nbio" \ |
| 7529 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 7530 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7531 | 0 \ |
| 7532 | -s "cookie verification failed" \ |
| 7533 | -s "cookie verification passed" \ |
| 7534 | -S "cookie verification skipped" \ |
| 7535 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7536 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7537 | -S "SSL - The requested feature is not available" |
| 7538 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7539 | # Tests for client reconnecting from the same port with DTLS |
| 7540 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7541 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7542 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7543 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7544 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 7545 | "$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] | 7546 | 0 \ |
| 7547 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7548 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7549 | -S "Client initiated reconnection from same port" |
| 7550 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7551 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7552 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7553 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7554 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 7555 | "$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] | 7556 | 0 \ |
| 7557 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7558 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7559 | -s "Client initiated reconnection from same port" |
| 7560 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7561 | 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] | 7562 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7563 | 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] | 7564 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 7565 | "$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] | 7566 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7567 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7568 | -s "Client initiated reconnection from same port" |
| 7569 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7570 | 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] | 7571 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7572 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 7573 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 7574 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 7575 | 0 \ |
| 7576 | -S "The operation timed out" \ |
| 7577 | -s "Client initiated reconnection from same port" |
| 7578 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7579 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7580 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 7581 | "$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] | 7582 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 7583 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7584 | -s "The operation timed out" \ |
| 7585 | -S "Client initiated reconnection from same port" |
| 7586 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7587 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 7588 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 7589 | -p "$P_PXY inject_clihlo=1" \ |
| 7590 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 7591 | "$P_CLI dtls=1 exchanges=2" \ |
| 7592 | 0 \ |
| 7593 | -s "possible client reconnect from the same port" \ |
| 7594 | -S "Client initiated reconnection from same port" |
| 7595 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7596 | # Tests for various cases of client authentication with DTLS |
| 7597 | # (focused on handshake flows and message parsing) |
| 7598 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7599 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7600 | run_test "DTLS client auth: required" \ |
| 7601 | "$P_SRV dtls=1 auth_mode=required" \ |
| 7602 | "$P_CLI dtls=1" \ |
| 7603 | 0 \ |
| 7604 | -s "Verifying peer X.509 certificate... ok" |
| 7605 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7606 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7607 | run_test "DTLS client auth: optional, client has no cert" \ |
| 7608 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 7609 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 7610 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7611 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7612 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7613 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7614 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7615 | "$P_SRV dtls=1 auth_mode=none" \ |
| 7616 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 7617 | 0 \ |
| 7618 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7619 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7620 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7621 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 7622 | run_test "DTLS wrong PSK: badmac alert" \ |
| 7623 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 7624 | "$P_CLI dtls=1 psk=abc124" \ |
| 7625 | 1 \ |
| 7626 | -s "SSL - Verification of the message MAC failed" \ |
| 7627 | -c "SSL - A fatal alert message was received from our peer" |
| 7628 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7629 | # Tests for receiving fragmented handshake messages with DTLS |
| 7630 | |
| 7631 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7632 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7633 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 7634 | "$G_SRV -u --mtu 2048 -a" \ |
| 7635 | "$P_CLI dtls=1 debug_level=2" \ |
| 7636 | 0 \ |
| 7637 | -C "found fragmented DTLS handshake message" \ |
| 7638 | -C "error" |
| 7639 | |
| 7640 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7641 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7642 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 7643 | "$G_SRV -u --mtu 512" \ |
| 7644 | "$P_CLI dtls=1 debug_level=2" \ |
| 7645 | 0 \ |
| 7646 | -c "found fragmented DTLS handshake message" \ |
| 7647 | -C "error" |
| 7648 | |
| 7649 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7650 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7651 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 7652 | "$G_SRV -u --mtu 128" \ |
| 7653 | "$P_CLI dtls=1 debug_level=2" \ |
| 7654 | 0 \ |
| 7655 | -c "found fragmented DTLS handshake message" \ |
| 7656 | -C "error" |
| 7657 | |
| 7658 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7659 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7660 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 7661 | "$G_SRV -u --mtu 128" \ |
| 7662 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7663 | 0 \ |
| 7664 | -c "found fragmented DTLS handshake message" \ |
| 7665 | -C "error" |
| 7666 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7667 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7668 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7669 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7670 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 7671 | "$G_SRV -u --mtu 256" \ |
| 7672 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 7673 | 0 \ |
| 7674 | -c "found fragmented DTLS handshake message" \ |
| 7675 | -c "client hello, adding renegotiation extension" \ |
| 7676 | -c "found renegotiation extension" \ |
| 7677 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7678 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7679 | -C "error" \ |
| 7680 | -s "Extra-header:" |
| 7681 | |
| 7682 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7683 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7684 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7685 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 7686 | "$G_SRV -u --mtu 256" \ |
| 7687 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 7688 | 0 \ |
| 7689 | -c "found fragmented DTLS handshake message" \ |
| 7690 | -c "client hello, adding renegotiation extension" \ |
| 7691 | -c "found renegotiation extension" \ |
| 7692 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7693 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7694 | -C "error" \ |
| 7695 | -s "Extra-header:" |
| 7696 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7697 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 7698 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 7699 | "$O_SRV -dtls -mtu 2048" \ |
| 7700 | "$P_CLI dtls=1 debug_level=2" \ |
| 7701 | 0 \ |
| 7702 | -C "found fragmented DTLS handshake message" \ |
| 7703 | -C "error" |
| 7704 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7705 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 7706 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 7707 | "$O_SRV -dtls -mtu 768" \ |
| 7708 | "$P_CLI dtls=1 debug_level=2" \ |
| 7709 | 0 \ |
| 7710 | -c "found fragmented DTLS handshake message" \ |
| 7711 | -C "error" |
| 7712 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7713 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 7714 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 7715 | "$O_SRV -dtls -mtu 256" \ |
| 7716 | "$P_CLI dtls=1 debug_level=2" \ |
| 7717 | 0 \ |
| 7718 | -c "found fragmented DTLS handshake message" \ |
| 7719 | -C "error" |
| 7720 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7721 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 7722 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 7723 | "$O_SRV -dtls -mtu 256" \ |
| 7724 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7725 | 0 \ |
| 7726 | -c "found fragmented DTLS handshake message" \ |
| 7727 | -C "error" |
| 7728 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7729 | # Tests for sending fragmented handshake messages with DTLS |
| 7730 | # |
| 7731 | # Use client auth when we need the client to send large messages, |
| 7732 | # and use large cert chains on both sides too (the long chains we have all use |
| 7733 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 7734 | # Sizes reached (UDP payload): |
| 7735 | # - 2037B for server certificate |
| 7736 | # - 1542B for client certificate |
| 7737 | # - 1013B for newsessionticket |
| 7738 | # - all others below 512B |
| 7739 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 7740 | |
| 7741 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7742 | requires_config_enabled MBEDTLS_RSA_C |
| 7743 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7744 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7745 | requires_max_content_len 4096 |
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 | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7747 | run_test "DTLS fragmenting: none (for reference)" \ |
| 7748 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7749 | crt_file=data_files/server7_int-ca.crt \ |
| 7750 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7751 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7752 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7753 | "$P_CLI dtls=1 debug_level=2 \ |
| 7754 | crt_file=data_files/server8_int-ca2.crt \ |
| 7755 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7756 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7757 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7758 | 0 \ |
| 7759 | -S "found fragmented DTLS handshake message" \ |
| 7760 | -C "found fragmented DTLS handshake message" \ |
| 7761 | -C "error" |
| 7762 | |
| 7763 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7764 | requires_config_enabled MBEDTLS_RSA_C |
| 7765 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7766 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7767 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7768 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7769 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7770 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7771 | crt_file=data_files/server7_int-ca.crt \ |
| 7772 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7773 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7774 | max_frag_len=1024" \ |
| 7775 | "$P_CLI dtls=1 debug_level=2 \ |
| 7776 | crt_file=data_files/server8_int-ca2.crt \ |
| 7777 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7778 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7779 | max_frag_len=2048" \ |
| 7780 | 0 \ |
| 7781 | -S "found fragmented DTLS handshake message" \ |
| 7782 | -c "found fragmented DTLS handshake message" \ |
| 7783 | -C "error" |
| 7784 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7785 | # With the MFL extension, the server has no way of forcing |
| 7786 | # the client to not exceed a certain MTU; hence, the following |
| 7787 | # test can't be replicated with an MTU proxy such as the one |
| 7788 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7789 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7790 | requires_config_enabled MBEDTLS_RSA_C |
| 7791 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7792 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7793 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7794 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7795 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7796 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7797 | crt_file=data_files/server7_int-ca.crt \ |
| 7798 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7799 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7800 | max_frag_len=512" \ |
| 7801 | "$P_CLI dtls=1 debug_level=2 \ |
| 7802 | crt_file=data_files/server8_int-ca2.crt \ |
| 7803 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7804 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7805 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7806 | 0 \ |
| 7807 | -S "found fragmented DTLS handshake message" \ |
| 7808 | -c "found fragmented DTLS handshake message" \ |
| 7809 | -C "error" |
| 7810 | |
| 7811 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7812 | requires_config_enabled MBEDTLS_RSA_C |
| 7813 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7814 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7815 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7816 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7817 | 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] | 7818 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 7819 | crt_file=data_files/server7_int-ca.crt \ |
| 7820 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7821 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7822 | max_frag_len=2048" \ |
| 7823 | "$P_CLI dtls=1 debug_level=2 \ |
| 7824 | crt_file=data_files/server8_int-ca2.crt \ |
| 7825 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7826 | hs_timeout=2500-60000 \ |
| 7827 | max_frag_len=1024" \ |
| 7828 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7829 | -S "found fragmented DTLS handshake message" \ |
| 7830 | -c "found fragmented DTLS handshake message" \ |
| 7831 | -C "error" |
| 7832 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7833 | # While not required by the standard defining the MFL extension |
| 7834 | # (according to which it only applies to records, not to datagrams), |
| 7835 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7836 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7837 | # to the peer. |
| 7838 | # The next test checks that no datagrams significantly larger than the |
| 7839 | # negotiated MFL are sent. |
| 7840 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7841 | requires_config_enabled MBEDTLS_RSA_C |
| 7842 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7843 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7844 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7845 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7846 | 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] | 7847 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7848 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 7849 | crt_file=data_files/server7_int-ca.crt \ |
| 7850 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7851 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7852 | max_frag_len=2048" \ |
| 7853 | "$P_CLI dtls=1 debug_level=2 \ |
| 7854 | crt_file=data_files/server8_int-ca2.crt \ |
| 7855 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7856 | hs_timeout=2500-60000 \ |
| 7857 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7858 | 0 \ |
| 7859 | -S "found fragmented DTLS handshake message" \ |
| 7860 | -c "found fragmented DTLS handshake message" \ |
| 7861 | -C "error" |
| 7862 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7863 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7864 | requires_config_enabled MBEDTLS_RSA_C |
| 7865 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7866 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7867 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7868 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7869 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7870 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7871 | crt_file=data_files/server7_int-ca.crt \ |
| 7872 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7873 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7874 | max_frag_len=2048" \ |
| 7875 | "$P_CLI dtls=1 debug_level=2 \ |
| 7876 | crt_file=data_files/server8_int-ca2.crt \ |
| 7877 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7878 | hs_timeout=2500-60000 \ |
| 7879 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7880 | 0 \ |
| 7881 | -s "found fragmented DTLS handshake message" \ |
| 7882 | -c "found fragmented DTLS handshake message" \ |
| 7883 | -C "error" |
| 7884 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7885 | # While not required by the standard defining the MFL extension |
| 7886 | # (according to which it only applies to records, not to datagrams), |
| 7887 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7888 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7889 | # to the peer. |
| 7890 | # The next test checks that no datagrams significantly larger than the |
| 7891 | # negotiated MFL are sent. |
| 7892 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7893 | requires_config_enabled MBEDTLS_RSA_C |
| 7894 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7895 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7896 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7897 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7898 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 7899 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7900 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7901 | crt_file=data_files/server7_int-ca.crt \ |
| 7902 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7903 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7904 | max_frag_len=2048" \ |
| 7905 | "$P_CLI dtls=1 debug_level=2 \ |
| 7906 | crt_file=data_files/server8_int-ca2.crt \ |
| 7907 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7908 | hs_timeout=2500-60000 \ |
| 7909 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7910 | 0 \ |
| 7911 | -s "found fragmented DTLS handshake message" \ |
| 7912 | -c "found fragmented DTLS handshake message" \ |
| 7913 | -C "error" |
| 7914 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7915 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7916 | requires_config_enabled MBEDTLS_RSA_C |
| 7917 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7918 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7919 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7920 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 7921 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7922 | crt_file=data_files/server7_int-ca.crt \ |
| 7923 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7924 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7925 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7926 | "$P_CLI dtls=1 debug_level=2 \ |
| 7927 | crt_file=data_files/server8_int-ca2.crt \ |
| 7928 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7929 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7930 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7931 | 0 \ |
| 7932 | -S "found fragmented DTLS handshake message" \ |
| 7933 | -C "found fragmented DTLS handshake message" \ |
| 7934 | -C "error" |
| 7935 | |
| 7936 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7937 | requires_config_enabled MBEDTLS_RSA_C |
| 7938 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7939 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7940 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7941 | run_test "DTLS fragmenting: client (MTU)" \ |
| 7942 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7943 | crt_file=data_files/server7_int-ca.crt \ |
| 7944 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7945 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7946 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7947 | "$P_CLI dtls=1 debug_level=2 \ |
| 7948 | crt_file=data_files/server8_int-ca2.crt \ |
| 7949 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7950 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7951 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7952 | 0 \ |
| 7953 | -s "found fragmented DTLS handshake message" \ |
| 7954 | -C "found fragmented DTLS handshake message" \ |
| 7955 | -C "error" |
| 7956 | |
| 7957 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7958 | requires_config_enabled MBEDTLS_RSA_C |
| 7959 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7960 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7961 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7962 | run_test "DTLS fragmenting: server (MTU)" \ |
| 7963 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7964 | crt_file=data_files/server7_int-ca.crt \ |
| 7965 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7966 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7967 | mtu=512" \ |
| 7968 | "$P_CLI dtls=1 debug_level=2 \ |
| 7969 | crt_file=data_files/server8_int-ca2.crt \ |
| 7970 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7971 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7972 | mtu=2048" \ |
| 7973 | 0 \ |
| 7974 | -S "found fragmented DTLS handshake message" \ |
| 7975 | -c "found fragmented DTLS handshake message" \ |
| 7976 | -C "error" |
| 7977 | |
| 7978 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7979 | requires_config_enabled MBEDTLS_RSA_C |
| 7980 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7981 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7982 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7983 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7984 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7985 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7986 | crt_file=data_files/server7_int-ca.crt \ |
| 7987 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7988 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 7989 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7990 | "$P_CLI dtls=1 debug_level=2 \ |
| 7991 | crt_file=data_files/server8_int-ca2.crt \ |
| 7992 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7993 | hs_timeout=2500-60000 \ |
| 7994 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7995 | 0 \ |
| 7996 | -s "found fragmented DTLS handshake message" \ |
| 7997 | -c "found fragmented DTLS handshake message" \ |
| 7998 | -C "error" |
| 7999 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8000 | # 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] | 8001 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8002 | requires_config_enabled MBEDTLS_RSA_C |
| 8003 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8004 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8005 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8006 | requires_config_enabled MBEDTLS_AES_C |
| 8007 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8008 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8009 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8010 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 8011 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 8012 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8013 | crt_file=data_files/server7_int-ca.crt \ |
| 8014 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8015 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 8016 | mtu=512" \ |
| 8017 | "$P_CLI dtls=1 debug_level=2 \ |
| 8018 | crt_file=data_files/server8_int-ca2.crt \ |
| 8019 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8020 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8021 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8022 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8023 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8024 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8025 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8026 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8027 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8028 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8029 | # 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] | 8030 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 8031 | # retransmissions, but in some cases (like both the server and client using |
| 8032 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 8033 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 8034 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8035 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8036 | requires_config_enabled MBEDTLS_RSA_C |
| 8037 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8038 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8039 | requires_config_enabled MBEDTLS_AES_C |
| 8040 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8041 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8042 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 8043 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8044 | -p "$P_PXY mtu=508" \ |
| 8045 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8046 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8047 | key_file=data_files/server7.key \ |
| 8048 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8049 | "$P_CLI dtls=1 debug_level=2 \ |
| 8050 | crt_file=data_files/server8_int-ca2.crt \ |
| 8051 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8052 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8053 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8054 | 0 \ |
| 8055 | -s "found fragmented DTLS handshake message" \ |
| 8056 | -c "found fragmented DTLS handshake message" \ |
| 8057 | -C "error" |
| 8058 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8059 | # 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] | 8060 | only_with_valgrind |
| 8061 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8062 | requires_config_enabled MBEDTLS_RSA_C |
| 8063 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8064 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8065 | requires_config_enabled MBEDTLS_AES_C |
| 8066 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8067 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8068 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 8069 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8070 | -p "$P_PXY mtu=508" \ |
| 8071 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8072 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8073 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8074 | hs_timeout=250-10000" \ |
| 8075 | "$P_CLI dtls=1 debug_level=2 \ |
| 8076 | crt_file=data_files/server8_int-ca2.crt \ |
| 8077 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8078 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8079 | hs_timeout=250-10000" \ |
| 8080 | 0 \ |
| 8081 | -s "found fragmented DTLS handshake message" \ |
| 8082 | -c "found fragmented DTLS handshake message" \ |
| 8083 | -C "error" |
| 8084 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8085 | # 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] | 8086 | # OTOH the client might resend if the server is to slow to reset after sending |
| 8087 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8088 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8089 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8090 | requires_config_enabled MBEDTLS_RSA_C |
| 8091 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8092 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8093 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8094 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8095 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8096 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8097 | crt_file=data_files/server7_int-ca.crt \ |
| 8098 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8099 | hs_timeout=10000-60000 \ |
| 8100 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8101 | "$P_CLI dtls=1 debug_level=2 \ |
| 8102 | crt_file=data_files/server8_int-ca2.crt \ |
| 8103 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8104 | hs_timeout=10000-60000 \ |
| 8105 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8106 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8107 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8108 | -s "found fragmented DTLS handshake message" \ |
| 8109 | -c "found fragmented DTLS handshake message" \ |
| 8110 | -C "error" |
| 8111 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8112 | # 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] | 8113 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 8114 | # OTOH the client might resend if the server is to slow to reset after sending |
| 8115 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8116 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8117 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8118 | requires_config_enabled MBEDTLS_RSA_C |
| 8119 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8120 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8121 | requires_config_enabled MBEDTLS_AES_C |
| 8122 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8123 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8124 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8125 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8126 | -p "$P_PXY mtu=512" \ |
| 8127 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8128 | crt_file=data_files/server7_int-ca.crt \ |
| 8129 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8130 | hs_timeout=10000-60000 \ |
| 8131 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8132 | "$P_CLI dtls=1 debug_level=2 \ |
| 8133 | crt_file=data_files/server8_int-ca2.crt \ |
| 8134 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8135 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8136 | hs_timeout=10000-60000 \ |
| 8137 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8138 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8139 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8140 | -s "found fragmented DTLS handshake message" \ |
| 8141 | -c "found fragmented DTLS handshake message" \ |
| 8142 | -C "error" |
| 8143 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8144 | not_with_valgrind # spurious autoreduction due to timeout |
| 8145 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8146 | requires_config_enabled MBEDTLS_RSA_C |
| 8147 | requires_config_enabled MBEDTLS_ECDSA_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: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8151 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [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=10000-60000 \ |
| 8156 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 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 | hs_timeout=10000-60000 \ |
| 8161 | mtu=1024 nbio=2" \ |
| 8162 | 0 \ |
| 8163 | -S "autoreduction" \ |
| 8164 | -s "found fragmented DTLS handshake message" \ |
| 8165 | -c "found fragmented DTLS handshake message" \ |
| 8166 | -C "error" |
| 8167 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8168 | # 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] | 8169 | not_with_valgrind # spurious autoreduction due to timeout |
| 8170 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8171 | requires_config_enabled MBEDTLS_RSA_C |
| 8172 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8173 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8174 | requires_config_enabled MBEDTLS_AES_C |
| 8175 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8176 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8177 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8178 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 8179 | -p "$P_PXY mtu=512" \ |
| 8180 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8181 | crt_file=data_files/server7_int-ca.crt \ |
| 8182 | key_file=data_files/server7.key \ |
| 8183 | hs_timeout=10000-60000 \ |
| 8184 | mtu=512 nbio=2" \ |
| 8185 | "$P_CLI dtls=1 debug_level=2 \ |
| 8186 | crt_file=data_files/server8_int-ca2.crt \ |
| 8187 | key_file=data_files/server8.key \ |
| 8188 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8189 | hs_timeout=10000-60000 \ |
| 8190 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8191 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8192 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8193 | -s "found fragmented DTLS handshake message" \ |
| 8194 | -c "found fragmented DTLS handshake message" \ |
| 8195 | -C "error" |
| 8196 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8197 | # 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] | 8198 | # This ensures things still work after session_reset(). |
| 8199 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8200 | # Since we don't support reading fragmented ClientHello yet, |
| 8201 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 8202 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8203 | # An autoreduction on the client-side might happen if the server is |
| 8204 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 8205 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8206 | # resumed listening, which would result in a spurious autoreduction. |
| 8207 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8208 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8209 | requires_config_enabled MBEDTLS_RSA_C |
| 8210 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8211 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8212 | requires_config_enabled MBEDTLS_AES_C |
| 8213 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8214 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8215 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8216 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 8217 | -p "$P_PXY mtu=1450" \ |
| 8218 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8219 | crt_file=data_files/server7_int-ca.crt \ |
| 8220 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8221 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8222 | mtu=1450" \ |
| 8223 | "$P_CLI dtls=1 debug_level=2 \ |
| 8224 | crt_file=data_files/server8_int-ca2.crt \ |
| 8225 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8226 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8227 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 8228 | 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] | 8229 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8230 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8231 | -s "found fragmented DTLS handshake message" \ |
| 8232 | -c "found fragmented DTLS handshake message" \ |
| 8233 | -C "error" |
| 8234 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8235 | # An autoreduction on the client-side might happen if the server is |
| 8236 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8237 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8238 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8239 | requires_config_enabled MBEDTLS_RSA_C |
| 8240 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8241 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8242 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8243 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8244 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8245 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8246 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8247 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 8248 | -p "$P_PXY mtu=512" \ |
| 8249 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8250 | crt_file=data_files/server7_int-ca.crt \ |
| 8251 | key_file=data_files/server7.key \ |
| 8252 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8253 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8254 | mtu=512" \ |
| 8255 | "$P_CLI dtls=1 debug_level=2 \ |
| 8256 | crt_file=data_files/server8_int-ca2.crt \ |
| 8257 | key_file=data_files/server8.key \ |
| 8258 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8259 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8260 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8261 | mtu=512" \ |
| 8262 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8263 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8264 | -s "found fragmented DTLS handshake message" \ |
| 8265 | -c "found fragmented DTLS handshake message" \ |
| 8266 | -C "error" |
| 8267 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8268 | # An autoreduction on the client-side might happen if the server is |
| 8269 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8270 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8271 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8272 | requires_config_enabled MBEDTLS_RSA_C |
| 8273 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8274 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8275 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8276 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8277 | requires_config_enabled MBEDTLS_AES_C |
| 8278 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8279 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8280 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8281 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 8282 | -p "$P_PXY mtu=512" \ |
| 8283 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8284 | crt_file=data_files/server7_int-ca.crt \ |
| 8285 | key_file=data_files/server7.key \ |
| 8286 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8287 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8288 | mtu=512" \ |
| 8289 | "$P_CLI dtls=1 debug_level=2 \ |
| 8290 | crt_file=data_files/server8_int-ca2.crt \ |
| 8291 | key_file=data_files/server8.key \ |
| 8292 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8293 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8294 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8295 | mtu=512" \ |
| 8296 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8297 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8298 | -s "found fragmented DTLS handshake message" \ |
| 8299 | -c "found fragmented DTLS handshake message" \ |
| 8300 | -C "error" |
| 8301 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8302 | # An autoreduction on the client-side might happen if the server is |
| 8303 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8304 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8305 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8306 | requires_config_enabled MBEDTLS_RSA_C |
| 8307 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8308 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8309 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8310 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8311 | requires_config_enabled MBEDTLS_AES_C |
| 8312 | requires_config_enabled MBEDTLS_CCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8313 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8314 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8315 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8316 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8317 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8318 | crt_file=data_files/server7_int-ca.crt \ |
| 8319 | key_file=data_files/server7.key \ |
| 8320 | exchanges=2 renegotiation=1 \ |
| 8321 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8322 | hs_timeout=10000-60000 \ |
| 8323 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8324 | "$P_CLI dtls=1 debug_level=2 \ |
| 8325 | crt_file=data_files/server8_int-ca2.crt \ |
| 8326 | key_file=data_files/server8.key \ |
| 8327 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8328 | hs_timeout=10000-60000 \ |
| 8329 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8330 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8331 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8332 | -s "found fragmented DTLS handshake message" \ |
| 8333 | -c "found fragmented DTLS handshake message" \ |
| 8334 | -C "error" |
| 8335 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8336 | # An autoreduction on the client-side might happen if the server is |
| 8337 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8338 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8339 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8340 | requires_config_enabled MBEDTLS_RSA_C |
| 8341 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8342 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8343 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8344 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8345 | requires_config_enabled MBEDTLS_AES_C |
| 8346 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8347 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8348 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8349 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8350 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8351 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8352 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8353 | crt_file=data_files/server7_int-ca.crt \ |
| 8354 | key_file=data_files/server7.key \ |
| 8355 | exchanges=2 renegotiation=1 \ |
| 8356 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8357 | hs_timeout=10000-60000 \ |
| 8358 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8359 | "$P_CLI dtls=1 debug_level=2 \ |
| 8360 | crt_file=data_files/server8_int-ca2.crt \ |
| 8361 | key_file=data_files/server8.key \ |
| 8362 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8363 | hs_timeout=10000-60000 \ |
| 8364 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8365 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8366 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8367 | -s "found fragmented DTLS handshake message" \ |
| 8368 | -c "found fragmented DTLS handshake message" \ |
| 8369 | -C "error" |
| 8370 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8371 | # An autoreduction on the client-side might happen if the server is |
| 8372 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8373 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8374 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8375 | requires_config_enabled MBEDTLS_RSA_C |
| 8376 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8377 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8378 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8379 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8380 | requires_config_enabled MBEDTLS_AES_C |
| 8381 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8382 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8383 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8384 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8385 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8386 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8387 | crt_file=data_files/server7_int-ca.crt \ |
| 8388 | key_file=data_files/server7.key \ |
| 8389 | exchanges=2 renegotiation=1 \ |
| 8390 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8391 | hs_timeout=10000-60000 \ |
| 8392 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8393 | "$P_CLI dtls=1 debug_level=2 \ |
| 8394 | crt_file=data_files/server8_int-ca2.crt \ |
| 8395 | key_file=data_files/server8.key \ |
| 8396 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8397 | hs_timeout=10000-60000 \ |
| 8398 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8399 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8400 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8401 | -s "found fragmented DTLS handshake message" \ |
| 8402 | -c "found fragmented DTLS handshake message" \ |
| 8403 | -C "error" |
| 8404 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8405 | # 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] | 8406 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8407 | requires_config_enabled MBEDTLS_RSA_C |
| 8408 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8409 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8410 | requires_config_enabled MBEDTLS_AES_C |
| 8411 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8412 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8413 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8414 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8415 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 8416 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8417 | "$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] | 8418 | crt_file=data_files/server7_int-ca.crt \ |
| 8419 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8420 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8421 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8422 | crt_file=data_files/server8_int-ca2.crt \ |
| 8423 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8424 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8425 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8426 | 0 \ |
| 8427 | -s "found fragmented DTLS handshake message" \ |
| 8428 | -c "found fragmented DTLS handshake message" \ |
| 8429 | -C "error" |
| 8430 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8431 | # 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] | 8432 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8433 | requires_config_enabled MBEDTLS_RSA_C |
| 8434 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8435 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8436 | requires_config_enabled MBEDTLS_AES_C |
| 8437 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8438 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8439 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8440 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8441 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 8442 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 8443 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8444 | crt_file=data_files/server7_int-ca.crt \ |
| 8445 | key_file=data_files/server7.key \ |
| 8446 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 8447 | "$P_CLI dtls=1 debug_level=2 \ |
| 8448 | crt_file=data_files/server8_int-ca2.crt \ |
| 8449 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8450 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8451 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 8452 | 0 \ |
| 8453 | -s "found fragmented DTLS handshake message" \ |
| 8454 | -c "found fragmented DTLS handshake message" \ |
| 8455 | -C "error" |
| 8456 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8457 | # interop tests for DTLS fragmentating with reliable connection |
| 8458 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8459 | # here and below we just want to test that the we fragment in a way that |
| 8460 | # pleases other implementations, so we don't need the peer to fragment |
| 8461 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8462 | requires_config_enabled MBEDTLS_RSA_C |
| 8463 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8464 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8465 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8466 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 8467 | "$G_SRV -u" \ |
| 8468 | "$P_CLI dtls=1 debug_level=2 \ |
| 8469 | crt_file=data_files/server8_int-ca2.crt \ |
| 8470 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8471 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8472 | 0 \ |
| 8473 | -c "fragmenting handshake message" \ |
| 8474 | -C "error" |
| 8475 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 8476 | # We use --insecure for the GnuTLS client because it expects |
| 8477 | # the hostname / IP it connects to to be the name used in the |
| 8478 | # certificate obtained from the server. Here, however, it |
| 8479 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 8480 | # as the server name in the certificate. This will make the |
| 8481 | # certifiate validation fail, but passing --insecure makes |
| 8482 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8483 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8484 | requires_config_enabled MBEDTLS_RSA_C |
| 8485 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8486 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 8487 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8488 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8489 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8490 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8491 | crt_file=data_files/server7_int-ca.crt \ |
| 8492 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8493 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8494 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8495 | 0 \ |
| 8496 | -s "fragmenting handshake message" |
| 8497 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8498 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8499 | requires_config_enabled MBEDTLS_RSA_C |
| 8500 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8501 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8502 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 8503 | "$O_SRV -dtls1_2 -verify 10" \ |
| 8504 | "$P_CLI dtls=1 debug_level=2 \ |
| 8505 | crt_file=data_files/server8_int-ca2.crt \ |
| 8506 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8507 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8508 | 0 \ |
| 8509 | -c "fragmenting handshake message" \ |
| 8510 | -C "error" |
| 8511 | |
| 8512 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8513 | requires_config_enabled MBEDTLS_RSA_C |
| 8514 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8515 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8516 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 8517 | "$P_SRV dtls=1 debug_level=2 \ |
| 8518 | crt_file=data_files/server7_int-ca.crt \ |
| 8519 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8520 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8521 | "$O_CLI -dtls1_2" \ |
| 8522 | 0 \ |
| 8523 | -s "fragmenting handshake message" |
| 8524 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8525 | # interop tests for DTLS fragmentating with unreliable connection |
| 8526 | # |
| 8527 | # again we just want to test that the we fragment in a way that |
| 8528 | # pleases other implementations, so we don't need the peer to fragment |
| 8529 | requires_gnutls_next |
| 8530 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8531 | requires_config_enabled MBEDTLS_RSA_C |
| 8532 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8533 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8534 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8535 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 8536 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8537 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8538 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8539 | crt_file=data_files/server8_int-ca2.crt \ |
| 8540 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8541 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8542 | 0 \ |
| 8543 | -c "fragmenting handshake message" \ |
| 8544 | -C "error" |
| 8545 | |
| 8546 | requires_gnutls_next |
| 8547 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8548 | requires_config_enabled MBEDTLS_RSA_C |
| 8549 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8550 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8551 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8552 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 8553 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8554 | "$P_SRV dtls=1 debug_level=2 \ |
| 8555 | crt_file=data_files/server7_int-ca.crt \ |
| 8556 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8557 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8558 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8559 | 0 \ |
| 8560 | -s "fragmenting handshake message" |
| 8561 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8562 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 8563 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8564 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8565 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8566 | ## (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] | 8567 | skip_next_test |
| 8568 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8569 | requires_config_enabled MBEDTLS_RSA_C |
| 8570 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8571 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8572 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8573 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 8574 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8575 | "$O_SRV -dtls1_2 -verify 10" \ |
| 8576 | "$P_CLI dtls=1 debug_level=2 \ |
| 8577 | crt_file=data_files/server8_int-ca2.crt \ |
| 8578 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8579 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8580 | 0 \ |
| 8581 | -c "fragmenting handshake message" \ |
| 8582 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8583 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8584 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8585 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8586 | requires_config_enabled MBEDTLS_RSA_C |
| 8587 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8588 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8589 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8590 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 8591 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8592 | "$P_SRV dtls=1 debug_level=2 \ |
| 8593 | crt_file=data_files/server7_int-ca.crt \ |
| 8594 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8595 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8596 | "$O_CLI -dtls1_2" \ |
| 8597 | 0 \ |
| 8598 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8599 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8600 | # Tests for DTLS-SRTP (RFC 5764) |
| 8601 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8602 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8603 | run_test "DTLS-SRTP all profiles supported" \ |
| 8604 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8605 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8606 | 0 \ |
| 8607 | -s "found use_srtp extension" \ |
| 8608 | -s "found srtp profile" \ |
| 8609 | -s "selected srtp profile" \ |
| 8610 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8611 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8612 | -c "client hello, adding use_srtp extension" \ |
| 8613 | -c "found use_srtp extension" \ |
| 8614 | -c "found srtp profile" \ |
| 8615 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8616 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8617 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8618 | -C "error" |
| 8619 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8620 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8621 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8622 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8623 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 8624 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8625 | "$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] | 8626 | 0 \ |
| 8627 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8628 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 8629 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8630 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8631 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8632 | -c "client hello, adding use_srtp extension" \ |
| 8633 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8634 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8635 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8636 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8637 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8638 | -C "error" |
| 8639 | |
| 8640 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8641 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8642 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8643 | "$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] | 8644 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8645 | 0 \ |
| 8646 | -s "found use_srtp extension" \ |
| 8647 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8648 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8649 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8650 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8651 | -c "client hello, adding use_srtp extension" \ |
| 8652 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8653 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8654 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8655 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8656 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8657 | -C "error" |
| 8658 | |
| 8659 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8660 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8661 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 8662 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8663 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8664 | 0 \ |
| 8665 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8666 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8667 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8668 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8669 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8670 | -c "client hello, adding use_srtp extension" \ |
| 8671 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8672 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8673 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8674 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8675 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8676 | -C "error" |
| 8677 | |
| 8678 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8679 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8680 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 8681 | "$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] | 8682 | "$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] | 8683 | 0 \ |
| 8684 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8685 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8686 | -S "selected srtp profile" \ |
| 8687 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8688 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8689 | -c "client hello, adding use_srtp extension" \ |
| 8690 | -C "found use_srtp extension" \ |
| 8691 | -C "found srtp profile" \ |
| 8692 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8693 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8694 | -C "error" |
| 8695 | |
| 8696 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8697 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8698 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 8699 | "$P_SRV dtls=1 debug_level=3" \ |
| 8700 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8701 | 0 \ |
| 8702 | -s "found use_srtp extension" \ |
| 8703 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8704 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8705 | -c "client hello, adding use_srtp extension" \ |
| 8706 | -C "found use_srtp extension" \ |
| 8707 | -C "found srtp profile" \ |
| 8708 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8709 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8710 | -C "error" |
| 8711 | |
| 8712 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8713 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8714 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 8715 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 8716 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8717 | 0 \ |
| 8718 | -s "found use_srtp extension" \ |
| 8719 | -s "found srtp profile" \ |
| 8720 | -s "selected srtp profile" \ |
| 8721 | -s "server hello, adding use_srtp extension" \ |
| 8722 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8723 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8724 | -c "client hello, adding use_srtp extension" \ |
| 8725 | -c "found use_srtp extension" \ |
| 8726 | -c "found srtp profile" \ |
| 8727 | -c "selected srtp profile" \ |
| 8728 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8729 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8730 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8731 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 8732 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8733 | -C "error" |
| 8734 | |
| 8735 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8736 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8737 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 8738 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8739 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8740 | 0 \ |
| 8741 | -s "found use_srtp extension" \ |
| 8742 | -s "found srtp profile" \ |
| 8743 | -s "selected srtp profile" \ |
| 8744 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8745 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 8746 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8747 | -S "dumping 'using mki' (8 bytes)" \ |
| 8748 | -c "client hello, adding use_srtp extension" \ |
| 8749 | -c "found use_srtp extension" \ |
| 8750 | -c "found srtp profile" \ |
| 8751 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8752 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 8753 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8754 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8755 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8756 | -C "dumping 'received mki' (8 bytes)" \ |
| 8757 | -C "error" |
| 8758 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8759 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8760 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8761 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 8762 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8763 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8764 | 0 \ |
| 8765 | -s "found use_srtp extension" \ |
| 8766 | -s "found srtp profile" \ |
| 8767 | -s "selected srtp profile" \ |
| 8768 | -s "server hello, adding use_srtp extension" \ |
| 8769 | -s "DTLS-SRTP key material is"\ |
| 8770 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 8771 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 8772 | |
| 8773 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8774 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8775 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 8776 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8777 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8778 | 0 \ |
| 8779 | -s "found use_srtp extension" \ |
| 8780 | -s "found srtp profile" \ |
| 8781 | -s "selected srtp profile" \ |
| 8782 | -s "server hello, adding use_srtp extension" \ |
| 8783 | -s "DTLS-SRTP key material is"\ |
| 8784 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 8785 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8786 | |
| 8787 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8788 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8789 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 8790 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8791 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8792 | 0 \ |
| 8793 | -s "found use_srtp extension" \ |
| 8794 | -s "found srtp profile" \ |
| 8795 | -s "selected srtp profile" \ |
| 8796 | -s "server hello, adding use_srtp extension" \ |
| 8797 | -s "DTLS-SRTP key material is"\ |
| 8798 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 8799 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8800 | |
| 8801 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8802 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8803 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 8804 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8805 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8806 | 0 \ |
| 8807 | -s "found use_srtp extension" \ |
| 8808 | -s "found srtp profile" \ |
| 8809 | -s "selected srtp profile" \ |
| 8810 | -s "server hello, adding use_srtp extension" \ |
| 8811 | -s "DTLS-SRTP key material is"\ |
| 8812 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 8813 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8814 | |
| 8815 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8816 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8817 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 8818 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8819 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8820 | 0 \ |
| 8821 | -s "found use_srtp extension" \ |
| 8822 | -s "found srtp profile" \ |
| 8823 | -s "selected srtp profile" \ |
| 8824 | -s "server hello, adding use_srtp extension" \ |
| 8825 | -s "DTLS-SRTP key material is"\ |
| 8826 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 8827 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8828 | |
| 8829 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8830 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8831 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 8832 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 8833 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8834 | 0 \ |
| 8835 | -s "found use_srtp extension" \ |
| 8836 | -s "found srtp profile" \ |
| 8837 | -S "selected srtp profile" \ |
| 8838 | -S "server hello, adding use_srtp extension" \ |
| 8839 | -S "DTLS-SRTP key material is"\ |
| 8840 | -C "SRTP Extension negotiated, profile" |
| 8841 | |
| 8842 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8843 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8844 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 8845 | "$P_SRV dtls=1 debug_level=3" \ |
| 8846 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8847 | 0 \ |
| 8848 | -s "found use_srtp extension" \ |
| 8849 | -S "server hello, adding use_srtp extension" \ |
| 8850 | -S "DTLS-SRTP key material is"\ |
| 8851 | -C "SRTP Extension negotiated, profile" |
| 8852 | |
| 8853 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8854 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8855 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 8856 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8857 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8858 | 0 \ |
| 8859 | -c "client hello, adding use_srtp extension" \ |
| 8860 | -c "found use_srtp extension" \ |
| 8861 | -c "found srtp profile" \ |
| 8862 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 8863 | -c "DTLS-SRTP key material is"\ |
| 8864 | -C "error" |
| 8865 | |
| 8866 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8867 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8868 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 8869 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8870 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8871 | 0 \ |
| 8872 | -c "client hello, adding use_srtp extension" \ |
| 8873 | -c "found use_srtp extension" \ |
| 8874 | -c "found srtp profile" \ |
| 8875 | -c "selected srtp profile" \ |
| 8876 | -c "DTLS-SRTP key material is"\ |
| 8877 | -C "error" |
| 8878 | |
| 8879 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8880 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8881 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 8882 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8883 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8884 | 0 \ |
| 8885 | -c "client hello, adding use_srtp extension" \ |
| 8886 | -c "found use_srtp extension" \ |
| 8887 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8888 | -c "selected srtp profile" \ |
| 8889 | -c "DTLS-SRTP key material is"\ |
| 8890 | -C "error" |
| 8891 | |
| 8892 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8893 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8894 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 8895 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8896 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8897 | 0 \ |
| 8898 | -c "client hello, adding use_srtp extension" \ |
| 8899 | -c "found use_srtp extension" \ |
| 8900 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8901 | -c "selected srtp profile" \ |
| 8902 | -c "DTLS-SRTP key material is"\ |
| 8903 | -C "error" |
| 8904 | |
| 8905 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8906 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8907 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 8908 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8909 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8910 | 0 \ |
| 8911 | -c "client hello, adding use_srtp extension" \ |
| 8912 | -c "found use_srtp extension" \ |
| 8913 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8914 | -c "selected srtp profile" \ |
| 8915 | -c "DTLS-SRTP key material is"\ |
| 8916 | -C "error" |
| 8917 | |
| 8918 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8919 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8920 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 8921 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8922 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 8923 | 0 \ |
| 8924 | -c "client hello, adding use_srtp extension" \ |
| 8925 | -C "found use_srtp extension" \ |
| 8926 | -C "found srtp profile" \ |
| 8927 | -C "selected srtp profile" \ |
| 8928 | -C "DTLS-SRTP key material is"\ |
| 8929 | -C "error" |
| 8930 | |
| 8931 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8932 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8933 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 8934 | "$O_SRV -dtls" \ |
| 8935 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8936 | 0 \ |
| 8937 | -c "client hello, adding use_srtp extension" \ |
| 8938 | -C "found use_srtp extension" \ |
| 8939 | -C "found srtp profile" \ |
| 8940 | -C "selected srtp profile" \ |
| 8941 | -C "DTLS-SRTP key material is"\ |
| 8942 | -C "error" |
| 8943 | |
| 8944 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8945 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8946 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 8947 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8948 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8949 | 0 \ |
| 8950 | -c "client hello, adding use_srtp extension" \ |
| 8951 | -c "found use_srtp extension" \ |
| 8952 | -c "found srtp profile" \ |
| 8953 | -c "selected srtp profile" \ |
| 8954 | -c "DTLS-SRTP key material is"\ |
| 8955 | -c "DTLS-SRTP no mki value negotiated"\ |
| 8956 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8957 | -C "dumping 'received mki' (8 bytes)" \ |
| 8958 | -C "error" |
| 8959 | |
| 8960 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8961 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8962 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8963 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8964 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8965 | "$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] | 8966 | 0 \ |
| 8967 | -s "found use_srtp extension" \ |
| 8968 | -s "found srtp profile" \ |
| 8969 | -s "selected srtp profile" \ |
| 8970 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8971 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8972 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 8973 | |
| 8974 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8975 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8976 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8977 | 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] | 8978 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8979 | "$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] | 8980 | 0 \ |
| 8981 | -s "found use_srtp extension" \ |
| 8982 | -s "found srtp profile" \ |
| 8983 | -s "selected srtp profile" \ |
| 8984 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8985 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8986 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 8987 | |
| 8988 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8989 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8990 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8991 | 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] | 8992 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8993 | "$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] | 8994 | 0 \ |
| 8995 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8996 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8997 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8998 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8999 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9000 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 9001 | |
| 9002 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9003 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9004 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9005 | 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] | 9006 | "$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] | 9007 | "$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] | 9008 | 0 \ |
| 9009 | -s "found use_srtp extension" \ |
| 9010 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9011 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9012 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9013 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9014 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 9015 | |
| 9016 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9017 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9018 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9019 | 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] | 9020 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9021 | "$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] | 9022 | 0 \ |
| 9023 | -s "found use_srtp extension" \ |
| 9024 | -s "found srtp profile" \ |
| 9025 | -s "selected srtp profile" \ |
| 9026 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9027 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9028 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 9029 | |
| 9030 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9031 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9032 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9033 | 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] | 9034 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 9035 | "$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] | 9036 | 0 \ |
| 9037 | -s "found use_srtp extension" \ |
| 9038 | -s "found srtp profile" \ |
| 9039 | -S "selected srtp profile" \ |
| 9040 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9041 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9042 | -C "SRTP profile:" |
| 9043 | |
| 9044 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9045 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9046 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9047 | 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] | 9048 | "$P_SRV dtls=1 debug_level=3" \ |
| 9049 | "$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] | 9050 | 0 \ |
| 9051 | -s "found use_srtp extension" \ |
| 9052 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9053 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9054 | -C "SRTP profile:" |
| 9055 | |
| 9056 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9057 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9058 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9059 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 9060 | "$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" \ |
| 9061 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9062 | 0 \ |
| 9063 | -c "client hello, adding use_srtp extension" \ |
| 9064 | -c "found use_srtp extension" \ |
| 9065 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9066 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9067 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9068 | -C "error" |
| 9069 | |
| 9070 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9071 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9072 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9073 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 9074 | "$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" \ |
| 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" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9080 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9081 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9082 | -C "error" |
| 9083 | |
| 9084 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9085 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9086 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9087 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 9088 | "$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" \ |
| 9089 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9090 | 0 \ |
| 9091 | -c "client hello, adding use_srtp extension" \ |
| 9092 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9093 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9094 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9095 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9096 | -C "error" |
| 9097 | |
| 9098 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9099 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9100 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9101 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 9102 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9103 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9104 | 0 \ |
| 9105 | -c "client hello, adding use_srtp extension" \ |
| 9106 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9107 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9108 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9109 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9110 | -C "error" |
| 9111 | |
| 9112 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9113 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9114 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9115 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 9116 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9117 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9118 | 0 \ |
| 9119 | -c "client hello, adding use_srtp extension" \ |
| 9120 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9121 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9122 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9123 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9124 | -C "error" |
| 9125 | |
| 9126 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9127 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9128 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9129 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 9130 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9131 | "$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] | 9132 | 0 \ |
| 9133 | -c "client hello, adding use_srtp extension" \ |
| 9134 | -C "found use_srtp extension" \ |
| 9135 | -C "found srtp profile" \ |
| 9136 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9137 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9138 | -C "error" |
| 9139 | |
| 9140 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9141 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9142 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9143 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 9144 | "$G_SRV -u" \ |
| 9145 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9146 | 0 \ |
| 9147 | -c "client hello, adding use_srtp extension" \ |
| 9148 | -C "found use_srtp extension" \ |
| 9149 | -C "found srtp profile" \ |
| 9150 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9151 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9152 | -C "error" |
| 9153 | |
| 9154 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9155 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9156 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9157 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 9158 | "$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" \ |
| 9159 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9160 | 0 \ |
| 9161 | -c "client hello, adding use_srtp extension" \ |
| 9162 | -c "found use_srtp extension" \ |
| 9163 | -c "found srtp profile" \ |
| 9164 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9165 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 9166 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9167 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9168 | -c "dumping 'received mki' (8 bytes)" \ |
| 9169 | -C "error" |
| 9170 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 9171 | # Tests for specific things with "unreliable" UDP connection |
| 9172 | |
| 9173 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9174 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 9175 | run_test "DTLS proxy: reference" \ |
| 9176 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9177 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 9178 | "$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] | 9179 | 0 \ |
| 9180 | -C "replayed record" \ |
| 9181 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 9182 | -C "Buffer record from epoch" \ |
| 9183 | -S "Buffer record from epoch" \ |
| 9184 | -C "ssl_buffer_message" \ |
| 9185 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 9186 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9187 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 9188 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9189 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 9190 | -c "HTTP/1.0 200 OK" |
| 9191 | |
| 9192 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9193 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9194 | run_test "DTLS proxy: duplicate every packet" \ |
| 9195 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9196 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 9197 | "$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] | 9198 | 0 \ |
| 9199 | -c "replayed record" \ |
| 9200 | -s "replayed record" \ |
| 9201 | -c "record from another epoch" \ |
| 9202 | -s "record from another epoch" \ |
| 9203 | -S "resend" \ |
| 9204 | -s "Extra-header:" \ |
| 9205 | -c "HTTP/1.0 200 OK" |
| 9206 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9207 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9208 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 9209 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9210 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 9211 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9212 | 0 \ |
| 9213 | -c "replayed record" \ |
| 9214 | -S "replayed record" \ |
| 9215 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9216 | -s "record from another epoch" \ |
| 9217 | -c "resend" \ |
| 9218 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9219 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9220 | -c "HTTP/1.0 200 OK" |
| 9221 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9222 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9223 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 9224 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9225 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 9226 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9227 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9228 | -c "next record in same datagram" \ |
| 9229 | -s "next record in same datagram" |
| 9230 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9231 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9232 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 9233 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9234 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 9235 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9236 | 0 \ |
| 9237 | -c "next record in same datagram" \ |
| 9238 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9239 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9240 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9241 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 9242 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9243 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 9244 | "$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] | 9245 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9246 | -c "discarding invalid record (mac)" \ |
| 9247 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9248 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9249 | -c "HTTP/1.0 200 OK" \ |
| 9250 | -S "too many records with bad MAC" \ |
| 9251 | -S "Verification of the message MAC failed" |
| 9252 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9253 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9254 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 9255 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9256 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 9257 | "$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] | 9258 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9259 | -C "discarding invalid record (mac)" \ |
| 9260 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9261 | -S "Extra-header:" \ |
| 9262 | -C "HTTP/1.0 200 OK" \ |
| 9263 | -s "too many records with bad MAC" \ |
| 9264 | -s "Verification of the message MAC failed" |
| 9265 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9266 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9267 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 9268 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9269 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 9270 | "$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] | 9271 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9272 | -c "discarding invalid record (mac)" \ |
| 9273 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9274 | -s "Extra-header:" \ |
| 9275 | -c "HTTP/1.0 200 OK" \ |
| 9276 | -S "too many records with bad MAC" \ |
| 9277 | -S "Verification of the message MAC failed" |
| 9278 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9279 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9280 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 9281 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9282 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 9283 | "$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] | 9284 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9285 | -c "discarding invalid record (mac)" \ |
| 9286 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9287 | -s "Extra-header:" \ |
| 9288 | -c "HTTP/1.0 200 OK" \ |
| 9289 | -s "too many records with bad MAC" \ |
| 9290 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9291 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9292 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9293 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 9294 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 9295 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 9296 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9297 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9298 | -c "record from another epoch" \ |
| 9299 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9300 | -s "Extra-header:" \ |
| 9301 | -c "HTTP/1.0 200 OK" |
| 9302 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 9303 | # Tests for reordering support with DTLS |
| 9304 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 9305 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9306 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9307 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 9308 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9309 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9310 | hs_timeout=2500-60000" \ |
| 9311 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9312 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 9313 | 0 \ |
| 9314 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9315 | -c "Next handshake message has been buffered - load"\ |
| 9316 | -S "Buffering HS message" \ |
| 9317 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9318 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9319 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9320 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9321 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 9322 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 9323 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9324 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9325 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 9326 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9327 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9328 | hs_timeout=2500-60000" \ |
| 9329 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9330 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9331 | 0 \ |
| 9332 | -c "Buffering HS message" \ |
| 9333 | -c "found fragmented DTLS handshake message"\ |
| 9334 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 9335 | -c "Next handshake message has been buffered - load"\ |
| 9336 | -S "Buffering HS message" \ |
| 9337 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9338 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9339 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9340 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 9341 | -S "Remember CCS message" |
| 9342 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9343 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 9344 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 9345 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 9346 | # while keeping the ServerKeyExchange. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 9347 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9348 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9349 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9350 | 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] | 9351 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9352 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9353 | hs_timeout=2500-60000" \ |
| 9354 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9355 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9356 | 0 \ |
| 9357 | -c "Buffering HS message" \ |
| 9358 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9359 | -C "attempt to make space by freeing buffered messages" \ |
| 9360 | -S "Buffering HS message" \ |
| 9361 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9362 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9363 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9364 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9365 | -S "Remember CCS message" |
| 9366 | |
| 9367 | # The size constraints ensure that the delayed certificate message can't |
| 9368 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 9369 | # when dropping it first. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 9370 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9371 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 9372 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9373 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9374 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 9375 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9376 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9377 | hs_timeout=2500-60000" \ |
| 9378 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9379 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9380 | 0 \ |
| 9381 | -c "Buffering HS message" \ |
| 9382 | -c "attempt to make space by freeing buffered future messages" \ |
| 9383 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9384 | -S "Buffering HS message" \ |
| 9385 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9386 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9387 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9388 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9389 | -S "Remember CCS message" |
| 9390 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 9391 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9392 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9393 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 9394 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9395 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 9396 | hs_timeout=2500-60000" \ |
| 9397 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9398 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9399 | 0 \ |
| 9400 | -C "Buffering HS message" \ |
| 9401 | -C "Next handshake message has been buffered - load"\ |
| 9402 | -s "Buffering HS message" \ |
| 9403 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9404 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9405 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9406 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9407 | -S "Remember CCS message" |
| 9408 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 9409 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9410 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9411 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 9412 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9413 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9414 | hs_timeout=2500-60000" \ |
| 9415 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9416 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9417 | 0 \ |
| 9418 | -C "Buffering HS message" \ |
| 9419 | -C "Next handshake message has been buffered - load"\ |
| 9420 | -S "Buffering HS message" \ |
| 9421 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9422 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9423 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9424 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9425 | -S "Remember CCS message" |
| 9426 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 9427 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9428 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9429 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 9430 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9431 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9432 | hs_timeout=2500-60000" \ |
| 9433 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9434 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9435 | 0 \ |
| 9436 | -C "Buffering HS message" \ |
| 9437 | -C "Next handshake message has been buffered - load"\ |
| 9438 | -S "Buffering HS message" \ |
| 9439 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9440 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9441 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9442 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9443 | -s "Remember CCS message" |
| 9444 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9445 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9446 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9447 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9448 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9449 | hs_timeout=2500-60000" \ |
| 9450 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9451 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 9452 | 0 \ |
| 9453 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9454 | -s "Found buffered record from current epoch - load" \ |
| 9455 | -c "Buffer record from epoch 1" \ |
| 9456 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9457 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9458 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 9459 | # from the server are delayed, so that the encrypted Finished message |
| 9460 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 9461 | # in afterwards, the encrypted Finished message must be freed in order |
| 9462 | # to make space for the NewSessionTicket to be reassembled. |
| 9463 | # This works only in very particular circumstances: |
| 9464 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 9465 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 9466 | # the encrypted Finished message. |
| 9467 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 9468 | # needs to be fragmented. |
| 9469 | # - All messages sent by the server must be small enough to be either sent |
| 9470 | # without fragmentation or be reassembled within the bounds of |
| 9471 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 9472 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 9473 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 9474 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9475 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9476 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 9477 | -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] | 9478 | "$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] | 9479 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 9480 | 0 \ |
| 9481 | -s "Buffer record from epoch 1" \ |
| 9482 | -s "Found buffered record from current epoch - load" \ |
| 9483 | -c "Buffer record from epoch 1" \ |
| 9484 | -C "Found buffered record from current epoch - load" \ |
| 9485 | -c "Enough space available after freeing future epoch record" |
| 9486 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 9487 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 9488 | |
| 9489 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9490 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9491 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 9492 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9493 | "$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] | 9494 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9495 | "$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] | 9496 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9497 | 0 \ |
| 9498 | -s "Extra-header:" \ |
| 9499 | -c "HTTP/1.0 200 OK" |
| 9500 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9501 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9502 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9503 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 9504 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9505 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 9506 | "$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] | 9507 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9508 | 0 \ |
| 9509 | -s "Extra-header:" \ |
| 9510 | -c "HTTP/1.0 200 OK" |
| 9511 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9512 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9513 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9514 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 9515 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9516 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 9517 | "$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] | 9518 | 0 \ |
| 9519 | -s "Extra-header:" \ |
| 9520 | -c "HTTP/1.0 200 OK" |
| 9521 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9522 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9523 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9524 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 9525 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9526 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 9527 | "$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] | 9528 | 0 \ |
| 9529 | -s "Extra-header:" \ |
| 9530 | -c "HTTP/1.0 200 OK" |
| 9531 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9532 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9533 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9534 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 9535 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9536 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 9537 | "$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] | 9538 | 0 \ |
| 9539 | -s "Extra-header:" \ |
| 9540 | -c "HTTP/1.0 200 OK" |
| 9541 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9542 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9543 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9544 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 9545 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9546 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 9547 | "$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] | 9548 | 0 \ |
| 9549 | -s "Extra-header:" \ |
| 9550 | -c "HTTP/1.0 200 OK" |
| 9551 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9552 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9553 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9554 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 9555 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9556 | "$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] | 9557 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9558 | "$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] | 9559 | 0 \ |
| 9560 | -s "Extra-header:" \ |
| 9561 | -c "HTTP/1.0 200 OK" |
| 9562 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9563 | client_needs_more_time 4 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9564 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 9565 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 9566 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 9567 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9568 | "$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] | 9569 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9570 | "$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] | 9571 | 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] | 9572 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9573 | 0 \ |
| 9574 | -s "a session has been resumed" \ |
| 9575 | -c "a session has been resumed" \ |
| 9576 | -s "Extra-header:" \ |
| 9577 | -c "HTTP/1.0 200 OK" |
| 9578 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9579 | client_needs_more_time 4 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9580 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 9581 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 9582 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 9583 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9584 | "$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] | 9585 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9586 | "$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] | 9587 | 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] | 9588 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 9589 | 0 \ |
| 9590 | -s "a session has been resumed" \ |
| 9591 | -c "a session has been resumed" \ |
| 9592 | -s "Extra-header:" \ |
| 9593 | -c "HTTP/1.0 200 OK" |
| 9594 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9595 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9596 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9597 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9598 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 9599 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9600 | "$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] | 9601 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9602 | "$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] | 9603 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 9604 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9605 | 0 \ |
| 9606 | -c "=> renegotiate" \ |
| 9607 | -s "=> renegotiate" \ |
| 9608 | -s "Extra-header:" \ |
| 9609 | -c "HTTP/1.0 200 OK" |
| 9610 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9611 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9612 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9613 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9614 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 9615 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9616 | "$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] | 9617 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9618 | "$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] | 9619 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9620 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9621 | 0 \ |
| 9622 | -c "=> renegotiate" \ |
| 9623 | -s "=> renegotiate" \ |
| 9624 | -s "Extra-header:" \ |
| 9625 | -c "HTTP/1.0 200 OK" |
| 9626 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9627 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9628 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9629 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9630 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 9631 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9632 | "$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] | 9633 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9634 | debug_level=2" \ |
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 | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 9636 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9637 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9638 | 0 \ |
| 9639 | -c "=> renegotiate" \ |
| 9640 | -s "=> renegotiate" \ |
| 9641 | -s "Extra-header:" \ |
| 9642 | -c "HTTP/1.0 200 OK" |
| 9643 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9644 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9645 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9646 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9647 | 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] | 9648 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9649 | "$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] | 9650 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9651 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9652 | "$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] | 9653 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9654 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9655 | 0 \ |
| 9656 | -c "=> renegotiate" \ |
| 9657 | -s "=> renegotiate" \ |
| 9658 | -s "Extra-header:" \ |
| 9659 | -c "HTTP/1.0 200 OK" |
| 9660 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9661 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 9662 | ## all versions installed on the CI machines), reported here: |
| 9663 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 9664 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 9665 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 9666 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9667 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9668 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9669 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9670 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 9671 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 9672 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9673 | "$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] | 9674 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 9675 | -c "HTTP/1.0 200 OK" |
| 9676 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9677 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9678 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9679 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9680 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9681 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 9682 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 9683 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9684 | "$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] | 9685 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9686 | -c "HTTP/1.0 200 OK" |
| 9687 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9688 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9689 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9690 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9691 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9692 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 9693 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 9694 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9695 | "$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] | 9696 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9697 | -c "HTTP/1.0 200 OK" |
| 9698 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 9699 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9700 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9701 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9702 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9703 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 9704 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 9705 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9706 | "$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] | 9707 | 0 \ |
| 9708 | -s "Extra-header:" \ |
| 9709 | -c "Extra-header:" |
| 9710 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9711 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9712 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9713 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9714 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9715 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 9716 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9717 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9718 | "$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] | 9719 | 0 \ |
| 9720 | -s "Extra-header:" \ |
| 9721 | -c "Extra-header:" |
| 9722 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9723 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9724 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9725 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9726 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9727 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 9728 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9729 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9730 | "$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] | 9731 | 0 \ |
| 9732 | -s "Extra-header:" \ |
| 9733 | -c "Extra-header:" |
| 9734 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9735 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 9736 | run_test "export keys functionality" \ |
| 9737 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 9738 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 9739 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 9740 | -c "EAP-TLS key material is:"\ |
| 9741 | -s "EAP-TLS key material is:"\ |
| 9742 | -c "EAP-TLS IV is:" \ |
| 9743 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 9744 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 9745 | # openssl feature tests: check if tls1.3 exists. |
| 9746 | requires_openssl_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9747 | run_test "TLS 1.3: Test openssl tls1_3 feature" \ |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 9748 | "$O_NEXT_SRV -tls1_3 -msg" \ |
| 9749 | "$O_NEXT_CLI -tls1_3 -msg" \ |
| 9750 | 0 \ |
| 9751 | -c "TLS 1.3" \ |
| 9752 | -s "TLS 1.3" |
| 9753 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 9754 | # 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] | 9755 | requires_gnutls_tls1_3 |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 9756 | requires_gnutls_next_no_ticket |
| 9757 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9758 | run_test "TLS 1.3: Test gnutls tls1_3 feature" \ |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 9759 | "$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] | 9760 | "$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] | 9761 | 0 \ |
| 9762 | -s "Version: TLS1.3" \ |
| 9763 | -c "Version: TLS1.3" |
| 9764 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 9765 | # TLS1.3 test cases |
| 9766 | # TODO: remove or rewrite this test case if #4832 is resolved. |
| 9767 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9768 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 9769 | skip_handshake_stage_check |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9770 | run_test "TLS 1.3: Not supported version check: tls12 and tls13" \ |
Xiaofei Bai | d25fab6 | 2021-12-02 06:36:27 +0000 | [diff] [blame] | 9771 | "$P_SRV debug_level=1 min_version=tls12 max_version=tls13" \ |
| 9772 | "$P_CLI debug_level=1 min_version=tls12 max_version=tls13" \ |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 9773 | 1 \ |
| 9774 | -s "SSL - The requested feature is not available" \ |
| 9775 | -c "SSL - The requested feature is not available" \ |
| 9776 | -s "Hybrid TLS 1.2 + TLS 1.3 configurations are not yet supported" \ |
| 9777 | -c "Hybrid TLS 1.2 + TLS 1.3 configurations are not yet supported" |
| 9778 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9779 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9780 | run_test "TLS 1.3: handshake dispatch test: tls13 only" \ |
Xiaofei Bai | d25fab6 | 2021-12-02 06:36:27 +0000 | [diff] [blame] | 9781 | "$P_SRV debug_level=2 min_version=tls13 max_version=tls13" \ |
| 9782 | "$P_CLI debug_level=2 min_version=tls13 max_version=tls13" \ |
Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 9783 | 1 \ |
Jerry Yu | e3b3412 | 2021-09-28 17:53:35 +0800 | [diff] [blame] | 9784 | -s "tls13 server state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 9785 | -c "tls13 client state: MBEDTLS_SSL_HELLO_REQUEST" |
Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 9786 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 9787 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9788 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9789 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9790 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9791 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9792 | run_test "TLS 1.3: minimal feature sets - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9793 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
Xiaofei Bai | d25fab6 | 2021-12-02 06:36:27 +0000 | [diff] [blame] | 9794 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 9795 | 0 \ |
Jerry Yu | cdcc55f | 2021-11-11 13:26:33 +0800 | [diff] [blame] | 9796 | -c "tls13 client state: MBEDTLS_SSL_HELLO_REQUEST(0)" \ |
| 9797 | -c "tls13 client state: MBEDTLS_SSL_SERVER_HELLO(2)" \ |
| 9798 | -c "tls13 client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS(19)" \ |
| 9799 | -c "tls13 client state: MBEDTLS_SSL_CERTIFICATE_REQUEST(5)" \ |
| 9800 | -c "tls13 client state: MBEDTLS_SSL_SERVER_CERTIFICATE(3)" \ |
| 9801 | -c "tls13 client state: MBEDTLS_SSL_CERTIFICATE_VERIFY(9)" \ |
| 9802 | -c "tls13 client state: MBEDTLS_SSL_SERVER_FINISHED(13)" \ |
| 9803 | -c "tls13 client state: MBEDTLS_SSL_CLIENT_FINISHED(11)" \ |
| 9804 | -c "tls13 client state: MBEDTLS_SSL_FLUSH_BUFFERS(14)" \ |
| 9805 | -c "tls13 client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP(15)" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 9806 | -c "<= ssl_tls13_process_server_hello" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 9807 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 9808 | -c "ECDH curve: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 9809 | -c "=> ssl_tls13_process_server_hello" \ |
Jerry Yu | daac359 | 2021-10-29 20:01:42 +0800 | [diff] [blame] | 9810 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 9811 | -c "Certificate verification flags clear" \ |
Jerry Yu | 5398c10 | 2021-11-05 13:32:38 +0800 | [diff] [blame] | 9812 | -c "=> parse certificate verify" \ |
| 9813 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 9814 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 9815 | -c "<= parse finished message" \ |
Gilles Peskine | c63a1e0 | 2022-01-13 01:10:24 +0100 | [diff] [blame] | 9816 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 9817 | -c "HTTP/1.0 200 ok" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 9818 | |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 9819 | requires_gnutls_tls1_3 |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 9820 | requires_gnutls_next_no_ticket |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9821 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9822 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9823 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9824 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9825 | run_test "TLS 1.3: minimal feature sets - gnutls" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9826 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --disable-client-cert" \ |
Xiaofei Bai | d25fab6 | 2021-12-02 06:36:27 +0000 | [diff] [blame] | 9827 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 9828 | 0 \ |
Jerry Yu | cdcc55f | 2021-11-11 13:26:33 +0800 | [diff] [blame] | 9829 | -s "SERVER HELLO was queued" \ |
| 9830 | -c "tls13 client state: MBEDTLS_SSL_HELLO_REQUEST(0)" \ |
| 9831 | -c "tls13 client state: MBEDTLS_SSL_SERVER_HELLO(2)" \ |
| 9832 | -c "tls13 client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS(19)" \ |
| 9833 | -c "tls13 client state: MBEDTLS_SSL_CERTIFICATE_REQUEST(5)" \ |
| 9834 | -c "tls13 client state: MBEDTLS_SSL_SERVER_CERTIFICATE(3)" \ |
| 9835 | -c "tls13 client state: MBEDTLS_SSL_CERTIFICATE_VERIFY(9)" \ |
| 9836 | -c "tls13 client state: MBEDTLS_SSL_SERVER_FINISHED(13)" \ |
| 9837 | -c "tls13 client state: MBEDTLS_SSL_CLIENT_FINISHED(11)" \ |
| 9838 | -c "tls13 client state: MBEDTLS_SSL_FLUSH_BUFFERS(14)" \ |
| 9839 | -c "tls13 client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP(15)" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 9840 | -c "<= ssl_tls13_process_server_hello" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 9841 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 9842 | -c "ECDH curve: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 9843 | -c "=> ssl_tls13_process_server_hello" \ |
Jerry Yu | daac359 | 2021-10-29 20:01:42 +0800 | [diff] [blame] | 9844 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 9845 | -c "Certificate verification flags clear" \ |
Jerry Yu | 5398c10 | 2021-11-05 13:32:38 +0800 | [diff] [blame] | 9846 | -c "=> parse certificate verify" \ |
| 9847 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 9848 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 9849 | -c "<= parse finished message" \ |
Gilles Peskine | 860429f | 2022-02-12 00:44:48 +0100 | [diff] [blame] | 9850 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 9851 | -c "HTTP/1.0 200 OK" |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 9852 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9853 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9854 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9855 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9856 | skip_handshake_stage_check |
| 9857 | requires_gnutls_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9858 | 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] | 9859 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0 -d 4" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9860 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9861 | 1 \ |
| 9862 | -s "Client's version: 3.3" \ |
| 9863 | -c "is a fatal alert message (msg 40)" \ |
| 9864 | -S "Version: TLS1.0" \ |
| 9865 | -C "Protocol is TLSv1.0" |
| 9866 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9867 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9868 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9869 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9870 | skip_handshake_stage_check |
| 9871 | requires_gnutls_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9872 | 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] | 9873 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1 -d 4" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9874 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9875 | 1 \ |
| 9876 | -s "Client's version: 3.3" \ |
| 9877 | -c "is a fatal alert message (msg 40)" \ |
| 9878 | -S "Version: TLS1.1" \ |
| 9879 | -C "Protocol is TLSv1.1" |
| 9880 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9881 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9882 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9883 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9884 | skip_handshake_stage_check |
| 9885 | requires_gnutls_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9886 | 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] | 9887 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2 -d 4" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9888 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9889 | 1 \ |
| 9890 | -s "Client's version: 3.3" \ |
| 9891 | -c "is a fatal alert message (msg 40)" \ |
| 9892 | -S "Version: TLS1.2" \ |
| 9893 | -C "Protocol is TLSv1.2" |
| 9894 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9895 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9896 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9897 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9898 | skip_handshake_stage_check |
| 9899 | requires_openssl_next |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9900 | 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] | 9901 | "$O_NEXT_SRV -msg -tls1" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9902 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9903 | 1 \ |
| 9904 | -s "fatal protocol_version" \ |
| 9905 | -c "is a fatal alert message (msg 70)" \ |
| 9906 | -S "Version: TLS1.0" \ |
| 9907 | -C "Protocol : TLSv1.0" |
| 9908 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9909 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9910 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9911 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9912 | skip_handshake_stage_check |
| 9913 | requires_openssl_next |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9914 | 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] | 9915 | "$O_NEXT_SRV -msg -tls1_1" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9916 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9917 | 1 \ |
| 9918 | -s "fatal protocol_version" \ |
| 9919 | -c "is a fatal alert message (msg 70)" \ |
| 9920 | -S "Version: TLS1.1" \ |
| 9921 | -C "Protocol : TLSv1.1" |
| 9922 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9923 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9924 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9925 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9926 | skip_handshake_stage_check |
| 9927 | requires_openssl_next |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9928 | 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] | 9929 | "$O_NEXT_SRV -msg -tls1_2" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9930 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9931 | 1 \ |
| 9932 | -s "fatal protocol_version" \ |
| 9933 | -c "is a fatal alert message (msg 70)" \ |
| 9934 | -S "Version: TLS1.2" \ |
| 9935 | -C "Protocol : TLSv1.2" |
| 9936 | |
Jerry Yu | 936dffd | 2021-11-22 18:34:36 +0800 | [diff] [blame] | 9937 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9938 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9939 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9940 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9941 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9942 | run_test "TLS 1.3: CertificateRequest check - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9943 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9944 | "$P_CLI debug_level=4 force_version=tls13 " \ |
Jerry Yu | 936dffd | 2021-11-22 18:34:36 +0800 | [diff] [blame] | 9945 | 1 \ |
Xiaofei Bai | 5d8598e | 2022-01-11 05:56:06 +0000 | [diff] [blame] | 9946 | -c "=> parse certificate request" \ |
Xiaofei Bai | 69fcd39 | 2022-01-20 08:25:00 +0000 | [diff] [blame] | 9947 | -c "got a certificate request" \ |
Xiaofei Bai | 5d8598e | 2022-01-11 05:56:06 +0000 | [diff] [blame] | 9948 | -c "<= parse certificate request" |
Jerry Yu | 936dffd | 2021-11-22 18:34:36 +0800 | [diff] [blame] | 9949 | |
| 9950 | requires_gnutls_tls1_3 |
| 9951 | requires_gnutls_next_no_ticket |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9952 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9953 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9954 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9955 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9956 | run_test "TLS 1.3: CertificateRequest check - gnutls" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9957 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9958 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
Jerry Yu | 936dffd | 2021-11-22 18:34:36 +0800 | [diff] [blame] | 9959 | 1 \ |
Xiaofei Bai | 5d8598e | 2022-01-11 05:56:06 +0000 | [diff] [blame] | 9960 | -c "=> parse certificate request" \ |
Xiaofei Bai | 69fcd39 | 2022-01-20 08:25:00 +0000 | [diff] [blame] | 9961 | -c "got a certificate request" \ |
Xiaofei Bai | 5d8598e | 2022-01-11 05:56:06 +0000 | [diff] [blame] | 9962 | -c "<= parse certificate request" |
Jerry Yu | 936dffd | 2021-11-22 18:34:36 +0800 | [diff] [blame] | 9963 | |
Gilles Peskine | 2ecf4ff | 2022-04-13 19:08:38 +0200 | [diff] [blame] | 9964 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9965 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9966 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9967 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 9968 | requires_openssl_tls1_3 |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 9969 | run_test "TLS 1.3: HelloRetryRequest check, ciphersuite TLS_AES_128_GCM_SHA256 - openssl" \ |
| 9970 | "$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" \ |
| 9971 | "$P_CLI debug_level=4 force_version=tls13" \ |
| 9972 | 0 \ |
| 9973 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 9974 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
| 9975 | -c "tls13 client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 9976 | -c "HTTP/1.0 200 ok" |
| 9977 | |
Gilles Peskine | 2ecf4ff | 2022-04-13 19:08:38 +0200 | [diff] [blame] | 9978 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 9979 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 9980 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9981 | requires_config_enabled MBEDTLS_SSL_CLI_C |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 9982 | requires_openssl_tls1_3 |
| 9983 | run_test "TLS 1.3: HelloRetryRequest check, ciphersuite TLS_AES_256_GCM_SHA384 - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9984 | "$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" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9985 | "$P_CLI debug_level=4 force_version=tls13" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 9986 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 9987 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 9988 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
| 9989 | -c "tls13 client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 9990 | -c "HTTP/1.0 200 ok" |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 9991 | |
Gilles Peskine | 2ecf4ff | 2022-04-13 19:08:38 +0200 | [diff] [blame] | 9992 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 9993 | requires_gnutls_tls1_3 |
| 9994 | requires_gnutls_next_no_ticket |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9995 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9996 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9997 | requires_config_enabled MBEDTLS_SSL_CLI_C |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 9998 | run_test "TLS 1.3: HelloRetryRequest check, ciphersuite TLS_AES_128_GCM_SHA256 - gnutls" \ |
| 9999 | "$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" \ |
| 10000 | "$P_CLI debug_level=4 force_version=tls13" \ |
| 10001 | 0 \ |
| 10002 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 10003 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
| 10004 | -c "tls13 client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 10005 | -c "HTTP/1.0 200 OK" |
| 10006 | |
Gilles Peskine | 2ecf4ff | 2022-04-13 19:08:38 +0200 | [diff] [blame] | 10007 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 10008 | requires_gnutls_tls1_3 |
| 10009 | requires_gnutls_next_no_ticket |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 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 |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 10013 | run_test "TLS 1.3: HelloRetryRequest check, ciphersuite TLS_AES_256_GCM_SHA384 - gnutls" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 10014 | "$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" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 10015 | "$P_CLI debug_level=4 force_version=tls13" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 10016 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 10017 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 10018 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
| 10019 | -c "tls13 client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 10020 | -c "HTTP/1.0 200 OK" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 10021 | |
Gilles Peskine | 2baaf60 | 2022-01-07 15:46:12 +0100 | [diff] [blame] | 10022 | for i in opt-testcases/*.sh |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 10023 | do |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 10024 | TEST_SUITE_NAME=${i##*/} |
| 10025 | TEST_SUITE_NAME=${TEST_SUITE_NAME%.*} |
| 10026 | . "$i" |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 10027 | done |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 10028 | unset TEST_SUITE_NAME |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 10029 | |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 10030 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10031 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 10032 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 10033 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10034 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 10035 | 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] | 10036 | "$O_NEXT_SRV -msg -tls1_3 -no_middlebox -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
| 10037 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
| 10038 | 0 \ |
| 10039 | -c "HTTP/1.0 200 ok" |
| 10040 | |
| 10041 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10042 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 10043 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 10044 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10045 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 10046 | 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] | 10047 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
| 10048 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
| 10049 | 1 \ |
| 10050 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 10051 | |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 10052 | requires_gnutls_tls1_3 |
| 10053 | requires_gnutls_next_no_ticket |
| 10054 | requires_gnutls_next_disable_tls13_compat |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10055 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 10056 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10057 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10058 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 10059 | run_test "TLS 1.3 m->G both peers do not support middlebox compatibility" \ |
| 10060 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE --disable-client-cert" \ |
| 10061 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
| 10062 | 0 \ |
| 10063 | -c "HTTP/1.0 200 OK" |
| 10064 | |
| 10065 | requires_gnutls_tls1_3 |
| 10066 | requires_gnutls_next_no_ticket |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10067 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 10068 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10069 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10070 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 10071 | run_test "TLS 1.3 m->G server with middlebox compat support, not client" \ |
| 10072 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --disable-client-cert" \ |
| 10073 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
| 10074 | 1 \ |
| 10075 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 10076 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 10077 | # Test heap memory usage after handshake |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10078 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 10079 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 10080 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 10081 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10082 | requires_max_content_len 16384 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 10083 | run_tests_memory_after_hanshake |
| 10084 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 10085 | # Final report |
| 10086 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10087 | echo "------------------------------------------------------------------------" |
| 10088 | |
| 10089 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 10090 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10091 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 10092 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10093 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 10094 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 10095 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10096 | |
| 10097 | exit $FAILS |