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 | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 266 | # Space-separated list of ciphersuites supported by this build of |
| 267 | # Mbed TLS. |
| 268 | P_CIPHERSUITES=" $($P_CLI --help 2>/dev/null | |
XiaokangQian | 4b82ca1 | 2021-11-18 08:27:17 +0000 | [diff] [blame] | 269 | grep 'TLS-\|TLS1-3' | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 270 | tr -s ' \n' ' ')" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 271 | requires_ciphersuite_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 272 | case $P_CIPHERSUITES in |
| 273 | *" $1 "*) :;; |
| 274 | *) SKIP_NEXT="YES";; |
| 275 | esac |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 276 | } |
| 277 | |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 278 | # maybe_requires_ciphersuite_enabled CMD [RUN_TEST_OPTION...] |
| 279 | # If CMD (call to a TLS client or server program) requires a specific |
| 280 | # ciphersuite, arrange to only run the test case if this ciphersuite is |
Dave Rodgman | c424098 | 2021-06-29 19:53:16 +0100 | [diff] [blame] | 281 | # enabled. |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 282 | maybe_requires_ciphersuite_enabled() { |
| 283 | case "$1" in |
| 284 | *\ force_ciphersuite=*) :;; |
| 285 | *) return;; # No specific required ciphersuite |
| 286 | esac |
| 287 | ciphersuite="${1##*\ force_ciphersuite=}" |
| 288 | ciphersuite="${ciphersuite%%[!-0-9A-Z_a-z]*}" |
| 289 | shift |
| 290 | |
Dave Rodgman | c424098 | 2021-06-29 19:53:16 +0100 | [diff] [blame] | 291 | requires_ciphersuite_enabled "$ciphersuite" |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 292 | |
| 293 | unset ciphersuite |
| 294 | } |
| 295 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 296 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 297 | requires_openssl_with_fallback_scsv() { |
| 298 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 299 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 300 | then |
| 301 | OPENSSL_HAS_FBSCSV="YES" |
| 302 | else |
| 303 | OPENSSL_HAS_FBSCSV="NO" |
| 304 | fi |
| 305 | fi |
| 306 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 307 | SKIP_NEXT="YES" |
| 308 | fi |
| 309 | } |
| 310 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 311 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 312 | requires_max_content_len() { |
| 313 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 314 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 315 | } |
| 316 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 317 | # skip next test if GnuTLS isn't available |
| 318 | requires_gnutls() { |
| 319 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 320 | 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] | 321 | GNUTLS_AVAILABLE="YES" |
| 322 | else |
| 323 | GNUTLS_AVAILABLE="NO" |
| 324 | fi |
| 325 | fi |
| 326 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 327 | SKIP_NEXT="YES" |
| 328 | fi |
| 329 | } |
| 330 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 331 | # skip next test if GnuTLS-next isn't available |
| 332 | requires_gnutls_next() { |
| 333 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 334 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 335 | GNUTLS_NEXT_AVAILABLE="YES" |
| 336 | else |
| 337 | GNUTLS_NEXT_AVAILABLE="NO" |
| 338 | fi |
| 339 | fi |
| 340 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 341 | SKIP_NEXT="YES" |
| 342 | fi |
| 343 | } |
| 344 | |
| 345 | # skip next test if OpenSSL-legacy isn't available |
| 346 | requires_openssl_legacy() { |
| 347 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 348 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 349 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 350 | else |
| 351 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 352 | fi |
| 353 | fi |
| 354 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 355 | SKIP_NEXT="YES" |
| 356 | fi |
| 357 | } |
| 358 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 359 | requires_openssl_next() { |
| 360 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then |
| 361 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then |
| 362 | OPENSSL_NEXT_AVAILABLE="YES" |
| 363 | else |
| 364 | OPENSSL_NEXT_AVAILABLE="NO" |
| 365 | fi |
| 366 | fi |
| 367 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 368 | SKIP_NEXT="YES" |
| 369 | fi |
| 370 | } |
| 371 | |
| 372 | # skip next test if tls1_3 is not available |
| 373 | requires_openssl_tls1_3() { |
| 374 | requires_openssl_next |
| 375 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 376 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 377 | fi |
| 378 | if [ -z "${OPENSSL_TLS1_3_AVAILABLE:-}" ]; then |
| 379 | if $OPENSSL_NEXT s_client -help 2>&1 | grep tls1_3 >/dev/null |
| 380 | then |
| 381 | OPENSSL_TLS1_3_AVAILABLE="YES" |
| 382 | else |
| 383 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 384 | fi |
| 385 | fi |
| 386 | if [ "$OPENSSL_TLS1_3_AVAILABLE" = "NO" ]; then |
| 387 | SKIP_NEXT="YES" |
| 388 | fi |
| 389 | } |
| 390 | |
| 391 | # skip next test if tls1_3 is not available |
| 392 | requires_gnutls_tls1_3() { |
| 393 | requires_gnutls_next |
| 394 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 395 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 396 | fi |
| 397 | if [ -z "${GNUTLS_TLS1_3_AVAILABLE:-}" ]; then |
| 398 | if $GNUTLS_NEXT_CLI -l 2>&1 | grep VERS-TLS1.3 >/dev/null |
| 399 | then |
| 400 | GNUTLS_TLS1_3_AVAILABLE="YES" |
| 401 | else |
| 402 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 403 | fi |
| 404 | fi |
| 405 | if [ "$GNUTLS_TLS1_3_AVAILABLE" = "NO" ]; then |
| 406 | SKIP_NEXT="YES" |
| 407 | fi |
| 408 | } |
| 409 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 410 | # Check %NO_TICKETS option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 411 | requires_gnutls_next_no_ticket() { |
| 412 | requires_gnutls_next |
| 413 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 414 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 415 | fi |
| 416 | if [ -z "${GNUTLS_NO_TICKETS_AVAILABLE:-}" ]; then |
| 417 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep NO_TICKETS >/dev/null |
| 418 | then |
| 419 | GNUTLS_NO_TICKETS_AVAILABLE="YES" |
| 420 | else |
| 421 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 422 | fi |
| 423 | fi |
| 424 | if [ "$GNUTLS_NO_TICKETS_AVAILABLE" = "NO" ]; then |
| 425 | SKIP_NEXT="YES" |
| 426 | fi |
| 427 | } |
| 428 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 429 | # Check %DISABLE_TLS13_COMPAT_MODE option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 430 | requires_gnutls_next_disable_tls13_compat() { |
| 431 | requires_gnutls_next |
| 432 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 433 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 434 | fi |
| 435 | if [ -z "${GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE:-}" ]; then |
| 436 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep DISABLE_TLS13_COMPAT_MODE >/dev/null |
| 437 | then |
| 438 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="YES" |
| 439 | else |
| 440 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 441 | fi |
| 442 | fi |
| 443 | if [ "$GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE" = "NO" ]; then |
| 444 | SKIP_NEXT="YES" |
| 445 | fi |
| 446 | } |
| 447 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 448 | # skip next test if IPv6 isn't available on this host |
| 449 | requires_ipv6() { |
| 450 | if [ -z "${HAS_IPV6:-}" ]; then |
| 451 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 452 | SRV_PID=$! |
| 453 | sleep 1 |
| 454 | kill $SRV_PID >/dev/null 2>&1 |
| 455 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 456 | HAS_IPV6="NO" |
| 457 | else |
| 458 | HAS_IPV6="YES" |
| 459 | fi |
| 460 | rm -r $SRV_OUT |
| 461 | fi |
| 462 | |
| 463 | if [ "$HAS_IPV6" = "NO" ]; then |
| 464 | SKIP_NEXT="YES" |
| 465 | fi |
| 466 | } |
| 467 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 468 | # skip next test if it's i686 or uname is not available |
| 469 | requires_not_i686() { |
| 470 | if [ -z "${IS_I686:-}" ]; then |
| 471 | IS_I686="YES" |
| 472 | if which "uname" >/dev/null 2>&1; then |
| 473 | if [ -z "$(uname -a | grep i686)" ]; then |
| 474 | IS_I686="NO" |
| 475 | fi |
| 476 | fi |
| 477 | fi |
| 478 | if [ "$IS_I686" = "YES" ]; then |
| 479 | SKIP_NEXT="YES" |
| 480 | fi |
| 481 | } |
| 482 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 483 | # Calculate the input & output maximum content lengths set in the config |
David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 484 | MAX_CONTENT_LEN=16384 |
Yuto Takano | 2be6f1a | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 485 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 486 | 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] | 487 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 488 | # Calculate the maximum content length that fits both |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 489 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 490 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 491 | fi |
| 492 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 493 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 494 | fi |
| 495 | |
| 496 | # skip the next test if the SSL output buffer is less than 16KB |
| 497 | requires_full_size_output_buffer() { |
| 498 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 499 | SKIP_NEXT="YES" |
| 500 | fi |
| 501 | } |
| 502 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 503 | # skip the next test if valgrind is in use |
| 504 | not_with_valgrind() { |
| 505 | if [ "$MEMCHECK" -gt 0 ]; then |
| 506 | SKIP_NEXT="YES" |
| 507 | fi |
| 508 | } |
| 509 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 510 | # skip the next test if valgrind is NOT in use |
| 511 | only_with_valgrind() { |
| 512 | if [ "$MEMCHECK" -eq 0 ]; then |
| 513 | SKIP_NEXT="YES" |
| 514 | fi |
| 515 | } |
| 516 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 517 | # 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] | 518 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 519 | CLI_DELAY_FACTOR=$1 |
| 520 | } |
| 521 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 522 | # wait for the given seconds after the client finished in the next test |
| 523 | server_needs_more_time() { |
| 524 | SRV_DELAY_SECONDS=$1 |
| 525 | } |
| 526 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 527 | # print_name <name> |
| 528 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 529 | TESTS=$(( $TESTS + 1 )) |
| 530 | LINE="" |
| 531 | |
| 532 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 533 | LINE="$TESTS " |
| 534 | fi |
| 535 | |
| 536 | LINE="$LINE$1" |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 537 | printf "%s " "$LINE" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 538 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 539 | for i in `seq 1 $LEN`; do printf '.'; done |
| 540 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 541 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 542 | } |
| 543 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 544 | # record_outcome <outcome> [<failure-reason>] |
| 545 | # The test name must be in $NAME. |
| 546 | record_outcome() { |
| 547 | echo "$1" |
| 548 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 549 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 550 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
| 551 | "ssl-opt" "$NAME" \ |
| 552 | "$1" "${2-}" \ |
| 553 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 554 | fi |
| 555 | } |
| 556 | |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 557 | # True if the presence of the given pattern in a log definitely indicates |
| 558 | # that the test has failed. False if the presence is inconclusive. |
| 559 | # |
| 560 | # Inputs: |
| 561 | # * $1: pattern found in the logs |
| 562 | # * $TIMES_LEFT: >0 if retrying is an option |
| 563 | # |
| 564 | # Outputs: |
| 565 | # * $outcome: set to a retry reason if the pattern is inconclusive, |
| 566 | # unchanged otherwise. |
| 567 | # * Return value: 1 if the pattern is inconclusive, |
| 568 | # 0 if the failure is definitive. |
| 569 | log_pattern_presence_is_conclusive() { |
| 570 | # If we've run out of attempts, then don't retry no matter what. |
| 571 | if [ $TIMES_LEFT -eq 0 ]; then |
| 572 | return 0 |
| 573 | fi |
| 574 | case $1 in |
| 575 | "resend") |
| 576 | # An undesired resend may have been caused by the OS dropping or |
| 577 | # delaying a packet at an inopportune time. |
| 578 | outcome="RETRY(resend)" |
| 579 | return 1;; |
| 580 | esac |
| 581 | } |
| 582 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 583 | # fail <message> |
| 584 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 585 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 586 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 587 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 588 | mv $SRV_OUT o-srv-${TESTS}.log |
| 589 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 590 | if [ -n "$PXY_CMD" ]; then |
| 591 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 592 | fi |
| 593 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 594 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 595 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 596 | echo " ! server output:" |
| 597 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 598 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 599 | echo " ! client output:" |
| 600 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 601 | if [ -n "$PXY_CMD" ]; then |
| 602 | echo " ! ========================================================" |
| 603 | echo " ! proxy output:" |
| 604 | cat o-pxy-${TESTS}.log |
| 605 | fi |
| 606 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 607 | fi |
| 608 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 609 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 610 | } |
| 611 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 612 | # is_polar <cmd_line> |
| 613 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 614 | case "$1" in |
| 615 | *ssl_client2*) true;; |
| 616 | *ssl_server2*) true;; |
| 617 | *) false;; |
| 618 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 619 | } |
| 620 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 621 | # openssl s_server doesn't have -www with DTLS |
| 622 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 623 | case "$SRV_CMD" in |
| 624 | *s_server*-dtls*) |
| 625 | NEEDS_INPUT=1 |
| 626 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 627 | *) NEEDS_INPUT=0;; |
| 628 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 629 | } |
| 630 | |
| 631 | # provide input to commands that need it |
| 632 | provide_input() { |
| 633 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 634 | return |
| 635 | fi |
| 636 | |
| 637 | while true; do |
| 638 | echo "HTTP/1.0 200 OK" |
| 639 | sleep 1 |
| 640 | done |
| 641 | } |
| 642 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 643 | # has_mem_err <log_file_name> |
| 644 | has_mem_err() { |
| 645 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 646 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 647 | then |
| 648 | return 1 # false: does not have errors |
| 649 | else |
| 650 | return 0 # true: has errors |
| 651 | fi |
| 652 | } |
| 653 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 654 | # 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] | 655 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 656 | wait_app_start() { |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 657 | newline=' |
| 658 | ' |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 659 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 660 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 661 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 662 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 663 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 664 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 665 | # Make a tight loop, server normally takes less than 1s to start. |
Paul Elliott | 58ed8a7 | 2021-10-19 17:56:39 +0100 | [diff] [blame] | 666 | while true; do |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 667 | SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -F p) |
| 668 | # When we use a proxy, it will be listening on the same port we |
| 669 | # are checking for as well as the server and lsof will list both. |
| 670 | # If multiple PIDs are returned, each one will be on a separate |
| 671 | # line, each prepended with 'p'. |
| 672 | case ${newline}${SERVER_PIDS}${newline} in |
| 673 | *${newline}p${2}${newline}*) break;; |
| 674 | esac |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 675 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 676 | echo "$3 START TIMEOUT" |
| 677 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 678 | break |
| 679 | fi |
| 680 | # Linux and *BSD support decimal arguments to sleep. On other |
| 681 | # OSes this may be a tight loop. |
| 682 | sleep 0.1 2>/dev/null || true |
| 683 | done |
| 684 | } |
| 685 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 686 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 687 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 688 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 689 | } |
| 690 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 691 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 692 | # Wait for server process $2 to be listening on port $1. |
| 693 | wait_server_start() { |
| 694 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 695 | } |
| 696 | |
| 697 | # Wait for proxy process $2 to be listening on port $1. |
| 698 | wait_proxy_start() { |
| 699 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 700 | } |
| 701 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 702 | # 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] | 703 | # 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] | 704 | # acceptable bounds |
| 705 | check_server_hello_time() { |
| 706 | # 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] | 707 | 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] | 708 | # Get the Unix timestamp for now |
| 709 | CUR_TIME=$(date +'%s') |
| 710 | THRESHOLD_IN_SECS=300 |
| 711 | |
| 712 | # Check if the ServerHello time was printed |
| 713 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 714 | return 1 |
| 715 | fi |
| 716 | |
| 717 | # Check the time in ServerHello is within acceptable bounds |
| 718 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 719 | # The time in ServerHello is at least 5 minutes before now |
| 720 | return 1 |
| 721 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 722 | # 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] | 723 | return 1 |
| 724 | else |
| 725 | return 0 |
| 726 | fi |
| 727 | } |
| 728 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 729 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 730 | handshake_memory_get() { |
| 731 | OUTPUT_VARIABLE="$1" |
| 732 | OUTPUT_FILE="$2" |
| 733 | |
| 734 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 735 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 736 | |
| 737 | # Check if memory usage was read |
| 738 | if [ -z "$MEM_USAGE" ]; then |
| 739 | echo "Error: Can not read the value of handshake memory usage" |
| 740 | return 1 |
| 741 | else |
| 742 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 743 | return 0 |
| 744 | fi |
| 745 | } |
| 746 | |
| 747 | # Get handshake memory usage from server or client output and check if this value |
| 748 | # is not higher than the maximum given by the first argument |
| 749 | handshake_memory_check() { |
| 750 | MAX_MEMORY="$1" |
| 751 | OUTPUT_FILE="$2" |
| 752 | |
| 753 | # Get memory usage |
| 754 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 755 | return 1 |
| 756 | fi |
| 757 | |
| 758 | # Check if memory usage is below max value |
| 759 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 760 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 761 | "but should be below $MAX_MEMORY bytes" |
| 762 | return 1 |
| 763 | else |
| 764 | return 0 |
| 765 | fi |
| 766 | } |
| 767 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 768 | # wait for client to terminate and set CLI_EXIT |
| 769 | # must be called right after starting the client |
| 770 | wait_client_done() { |
| 771 | CLI_PID=$! |
| 772 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 773 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 774 | CLI_DELAY_FACTOR=1 |
| 775 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 776 | ( 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] | 777 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 778 | |
| 779 | wait $CLI_PID |
| 780 | CLI_EXIT=$? |
| 781 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 782 | kill $DOG_PID >/dev/null 2>&1 |
| 783 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 784 | |
| 785 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 786 | |
| 787 | sleep $SRV_DELAY_SECONDS |
| 788 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 789 | } |
| 790 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 791 | # check if the given command uses dtls and sets global variable DTLS |
| 792 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 793 | case "$1" in |
Paul Elliott | 1428f25 | 2021-10-12 16:02:55 +0100 | [diff] [blame] | 794 | *dtls=1*|*-dtls*|*-u*) DTLS=1;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 795 | *) DTLS=0;; |
| 796 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 797 | } |
| 798 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 799 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 800 | is_gnutls() { |
| 801 | case "$1" in |
| 802 | *gnutls-cli*) |
| 803 | CMD_IS_GNUTLS=1 |
| 804 | ;; |
| 805 | *gnutls-serv*) |
| 806 | CMD_IS_GNUTLS=1 |
| 807 | ;; |
| 808 | *) |
| 809 | CMD_IS_GNUTLS=0 |
| 810 | ;; |
| 811 | esac |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 812 | } |
| 813 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 814 | # Compare file content |
| 815 | # Usage: find_in_both pattern file1 file2 |
| 816 | # extract from file1 the first line matching the pattern |
| 817 | # check in file2 that the same line can be found |
| 818 | find_in_both() { |
| 819 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 820 | if [ -z "$srv_pattern" ]; then |
| 821 | return 1; |
| 822 | fi |
| 823 | |
| 824 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 825 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 826 | else |
| 827 | return 1; |
| 828 | fi |
| 829 | } |
| 830 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 831 | SKIP_HANDSHAKE_CHECK="NO" |
| 832 | skip_handshake_stage_check() { |
| 833 | SKIP_HANDSHAKE_CHECK="YES" |
| 834 | } |
| 835 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 836 | # Analyze the commands that will be used in a test. |
| 837 | # |
| 838 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass |
| 839 | # extra arguments or go through wrappers. |
| 840 | # Set $DTLS (0=TLS, 1=DTLS). |
| 841 | analyze_test_commands() { |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 842 | # update DTLS variable |
| 843 | detect_dtls "$SRV_CMD" |
| 844 | |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 845 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 846 | # 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] | 847 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 848 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 849 | case " $SRV_CMD " in |
| 850 | *' server_addr=::1 '*) |
| 851 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 852 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 853 | fi |
| 854 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 855 | # update CMD_IS_GNUTLS variable |
| 856 | is_gnutls "$SRV_CMD" |
| 857 | |
| 858 | # if the server uses gnutls but doesn't set priority, explicitly |
| 859 | # set the default priority |
| 860 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 861 | case "$SRV_CMD" in |
| 862 | *--priority*) :;; |
| 863 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 864 | esac |
| 865 | fi |
| 866 | |
| 867 | # update CMD_IS_GNUTLS variable |
| 868 | is_gnutls "$CLI_CMD" |
| 869 | |
| 870 | # if the client uses gnutls but doesn't set priority, explicitly |
| 871 | # set the default priority |
| 872 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 873 | case "$CLI_CMD" in |
| 874 | *--priority*) :;; |
| 875 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 876 | esac |
| 877 | fi |
| 878 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 879 | # fix client port |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 880 | if [ -n "$PXY_CMD" ]; then |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 881 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 882 | else |
| 883 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 884 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 885 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 886 | # prepend valgrind to our commands if active |
| 887 | if [ "$MEMCHECK" -gt 0 ]; then |
| 888 | if is_polar "$SRV_CMD"; then |
| 889 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 890 | fi |
| 891 | if is_polar "$CLI_CMD"; then |
| 892 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 893 | fi |
| 894 | fi |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 895 | } |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 896 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 897 | # Check for failure conditions after a test case. |
| 898 | # |
| 899 | # Inputs from run_test: |
| 900 | # * positional parameters: test options (see run_test documentation) |
| 901 | # * $CLI_EXIT: client return code |
| 902 | # * $CLI_EXPECT: expected client return code |
| 903 | # * $SRV_RET: server return code |
| 904 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 905 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 906 | # |
| 907 | # Outputs: |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 908 | # * $outcome: one of PASS/RETRY*/FAIL |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 909 | check_test_failure() { |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 910 | outcome=FAIL |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 911 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 912 | if [ $TIMES_LEFT -gt 0 ] && |
| 913 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null |
| 914 | then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 915 | outcome="RETRY(client-timeout)" |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 916 | return |
| 917 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 918 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 919 | # 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] | 920 | # (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] | 921 | # expected client exit to incorrectly succeed in case of catastrophic |
| 922 | # failure) |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 923 | if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ] |
| 924 | then |
| 925 | if is_polar "$SRV_CMD"; then |
| 926 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
| 927 | else |
| 928 | fail "server or client failed to reach handshake stage" |
| 929 | return |
| 930 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 931 | fi |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 932 | if is_polar "$CLI_CMD"; then |
| 933 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
| 934 | else |
| 935 | fail "server or client failed to reach handshake stage" |
| 936 | return |
| 937 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 938 | fi |
| 939 | fi |
| 940 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 941 | SKIP_HANDSHAKE_CHECK="NO" |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 942 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 943 | # exit with status 0 when interrupted by a signal, and we don't really |
| 944 | # care anyway), in case e.g. the server reports a memory leak. |
| 945 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 946 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 947 | return |
| 948 | fi |
| 949 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 950 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 951 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 952 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 953 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 954 | 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] | 955 | return |
| 956 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 957 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 958 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 959 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 960 | # 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] | 961 | while [ $# -gt 0 ] |
| 962 | do |
| 963 | case $1 in |
| 964 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 965 | 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] | 966 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 967 | return |
| 968 | fi |
| 969 | ;; |
| 970 | |
| 971 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 972 | 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] | 973 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 974 | return |
| 975 | fi |
| 976 | ;; |
| 977 | |
| 978 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 979 | 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] | 980 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 981 | fail "pattern '$2' MUST NOT be present in the Server output" |
| 982 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 983 | return |
| 984 | fi |
| 985 | ;; |
| 986 | |
| 987 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 988 | 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] | 989 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 990 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 991 | fi |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 992 | return |
| 993 | fi |
| 994 | ;; |
| 995 | |
| 996 | # The filtering in the following two options (-u and -U) do the following |
| 997 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 998 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 999 | # - keep one of each non-unique line |
| 1000 | # - count how many lines remain |
| 1001 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 1002 | # if there were no duplicates. |
| 1003 | "-U") |
| 1004 | 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 |
| 1005 | fail "lines following pattern '$2' must be unique in Server output" |
| 1006 | return |
| 1007 | fi |
| 1008 | ;; |
| 1009 | |
| 1010 | "-u") |
| 1011 | 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 |
| 1012 | 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] | 1013 | return |
| 1014 | fi |
| 1015 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 1016 | "-F") |
| 1017 | if ! $2 "$SRV_OUT"; then |
| 1018 | fail "function call to '$2' failed on Server output" |
| 1019 | return |
| 1020 | fi |
| 1021 | ;; |
| 1022 | "-f") |
| 1023 | if ! $2 "$CLI_OUT"; then |
| 1024 | fail "function call to '$2' failed on Client output" |
| 1025 | return |
| 1026 | fi |
| 1027 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1028 | "-g") |
| 1029 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 1030 | fail "function call to '$2' failed on Server and Client output" |
| 1031 | return |
| 1032 | fi |
| 1033 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1034 | |
| 1035 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1036 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1037 | exit 1 |
| 1038 | esac |
| 1039 | shift 2 |
| 1040 | done |
| 1041 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1042 | # check valgrind's results |
| 1043 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1044 | 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] | 1045 | fail "Server has memory errors" |
| 1046 | return |
| 1047 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1048 | 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] | 1049 | fail "Client has memory errors" |
| 1050 | return |
| 1051 | fi |
| 1052 | fi |
| 1053 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1054 | # if we're here, everything is ok |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1055 | outcome=PASS |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1056 | } |
| 1057 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1058 | # Run the current test case: start the server and if applicable the proxy, run |
| 1059 | # the client, wait for all processes to finish or time out. |
| 1060 | # |
| 1061 | # Inputs: |
| 1062 | # * $NAME: test case name |
| 1063 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run |
| 1064 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs |
| 1065 | # |
| 1066 | # Outputs: |
| 1067 | # * $CLI_EXIT: client return code |
| 1068 | # * $SRV_RET: server return code |
| 1069 | do_run_test_once() { |
| 1070 | # run the commands |
| 1071 | if [ -n "$PXY_CMD" ]; then |
| 1072 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
| 1073 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 1074 | PXY_PID=$! |
| 1075 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
| 1076 | fi |
| 1077 | |
| 1078 | check_osrv_dtls |
| 1079 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
| 1080 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 1081 | SRV_PID=$! |
| 1082 | wait_server_start "$SRV_PORT" "$SRV_PID" |
| 1083 | |
| 1084 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
| 1085 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 1086 | wait_client_done |
| 1087 | |
| 1088 | sleep 0.05 |
| 1089 | |
| 1090 | # terminate the server (and the proxy) |
| 1091 | kill $SRV_PID |
| 1092 | wait $SRV_PID |
| 1093 | SRV_RET=$? |
| 1094 | |
| 1095 | if [ -n "$PXY_CMD" ]; then |
| 1096 | kill $PXY_PID >/dev/null 2>&1 |
| 1097 | wait $PXY_PID |
| 1098 | fi |
| 1099 | } |
| 1100 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1101 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
| 1102 | # Options: -s pattern pattern that must be present in server output |
| 1103 | # -c pattern pattern that must be present in client output |
| 1104 | # -u pattern lines after pattern must be unique in client output |
| 1105 | # -f call shell function on client output |
| 1106 | # -S pattern pattern that must be absent in server output |
| 1107 | # -C pattern pattern that must be absent in client output |
| 1108 | # -U pattern lines after pattern must be unique in server output |
| 1109 | # -F call shell function on server output |
| 1110 | # -g call shell function on server and client output |
| 1111 | run_test() { |
| 1112 | NAME="$1" |
| 1113 | shift 1 |
| 1114 | |
| 1115 | if is_excluded "$NAME"; then |
| 1116 | SKIP_NEXT="NO" |
| 1117 | # There was no request to run the test, so don't record its outcome. |
| 1118 | return |
| 1119 | fi |
| 1120 | |
| 1121 | print_name "$NAME" |
| 1122 | |
| 1123 | # Do we only run numbered tests? |
| 1124 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 1125 | case ",$RUN_TEST_NUMBER," in |
| 1126 | *",$TESTS,"*) :;; |
| 1127 | *) SKIP_NEXT="YES";; |
| 1128 | esac |
| 1129 | fi |
| 1130 | |
| 1131 | # does this test use a proxy? |
| 1132 | if [ "X$1" = "X-p" ]; then |
| 1133 | PXY_CMD="$2" |
| 1134 | shift 2 |
| 1135 | else |
| 1136 | PXY_CMD="" |
| 1137 | fi |
| 1138 | |
| 1139 | # get commands and client output |
| 1140 | SRV_CMD="$1" |
| 1141 | CLI_CMD="$2" |
| 1142 | CLI_EXPECT="$3" |
| 1143 | shift 3 |
| 1144 | |
| 1145 | # Check if test uses files |
| 1146 | case "$SRV_CMD $CLI_CMD" in |
| 1147 | *data_files/*) |
| 1148 | requires_config_enabled MBEDTLS_FS_IO;; |
| 1149 | esac |
| 1150 | |
| 1151 | # If the client or serve requires a ciphersuite, check that it's enabled. |
| 1152 | maybe_requires_ciphersuite_enabled "$SRV_CMD" "$@" |
| 1153 | maybe_requires_ciphersuite_enabled "$CLI_CMD" "$@" |
| 1154 | |
| 1155 | # should we skip? |
| 1156 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 1157 | SKIP_NEXT="NO" |
| 1158 | record_outcome "SKIP" |
| 1159 | SKIPS=$(( $SKIPS + 1 )) |
| 1160 | return |
| 1161 | fi |
| 1162 | |
| 1163 | analyze_test_commands "$@" |
| 1164 | |
| 1165 | TIMES_LEFT=2 |
| 1166 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1167 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1168 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1169 | do_run_test_once |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1170 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1171 | check_test_failure "$@" |
| 1172 | case $outcome in |
| 1173 | PASS) break;; |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1174 | RETRY*) printf "$outcome ";; |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1175 | FAIL) return;; |
| 1176 | esac |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1177 | done |
| 1178 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1179 | # If we get this far, the test case passed. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1180 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1181 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1182 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1183 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1184 | if [ -n "$PXY_CMD" ]; then |
| 1185 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1186 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1187 | fi |
| 1188 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1189 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1190 | } |
| 1191 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1192 | run_test_psa() { |
| 1193 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1194 | run_test "PSA-supported ciphersuite: $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1195 | "$P_SRV debug_level=3 force_version=tls12" \ |
| 1196 | "$P_CLI debug_level=3 force_version=tls12 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1197 | 0 \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1198 | -c "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1199 | -c "calc PSA finished" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1200 | -s "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1201 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1202 | -C "Failed to setup PSA-based cipher context"\ |
| 1203 | -S "Failed to setup PSA-based cipher context"\ |
| 1204 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1205 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1206 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1207 | -S "error" \ |
| 1208 | -C "error" |
| 1209 | } |
| 1210 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1211 | run_test_psa_force_curve() { |
| 1212 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1213 | run_test "PSA - ECDH with $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1214 | "$P_SRV debug_level=4 force_version=tls12 curves=$1" \ |
| 1215 | "$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] | 1216 | 0 \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1217 | -c "PSA calc verify" \ |
| 1218 | -c "calc PSA finished" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1219 | -s "PSA calc verify" \ |
| 1220 | -s "calc PSA finished" \ |
| 1221 | -C "Failed to setup PSA-based cipher context"\ |
| 1222 | -S "Failed to setup PSA-based cipher context"\ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1223 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1224 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1225 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1226 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1227 | -C "error" |
| 1228 | } |
| 1229 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1230 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1231 | # a maximum fragment length. |
| 1232 | # first argument ($1) is MFL for SSL client |
| 1233 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1234 | run_test_memory_after_hanshake_with_mfl() |
| 1235 | { |
| 1236 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1237 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1238 | |
| 1239 | # Leave some margin for robustness |
| 1240 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1241 | |
| 1242 | run_test "Handshake memory usage (MFL $1)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1243 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
| 1244 | "$P_CLI debug_level=3 force_version=tls12 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1245 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1246 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1247 | 0 \ |
| 1248 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1249 | } |
| 1250 | |
| 1251 | |
| 1252 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1253 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1254 | run_tests_memory_after_hanshake() |
| 1255 | { |
| 1256 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1257 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1258 | |
| 1259 | # first test with default MFU is to get reference memory usage |
| 1260 | MEMORY_USAGE_MFL_16K=0 |
| 1261 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1262 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
| 1263 | "$P_CLI debug_level=3 force_version=tls12 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1264 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1265 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1266 | 0 \ |
| 1267 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1268 | |
| 1269 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1270 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1271 | |
| 1272 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1273 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1274 | |
| 1275 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1276 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1277 | |
| 1278 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1279 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1280 | } |
| 1281 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1282 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1283 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1284 | rm -f context_srv.txt |
| 1285 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1286 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1287 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1288 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1289 | 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] | 1290 | exit 1 |
| 1291 | } |
| 1292 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1293 | # |
| 1294 | # MAIN |
| 1295 | # |
| 1296 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1297 | get_options "$@" |
| 1298 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1299 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1300 | # patterns rather than regular expressions, use a case statement instead |
| 1301 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1302 | # detects simple cases: plain substring, everything, nothing. |
| 1303 | # |
| 1304 | # As an exception, the character '.' is treated as an ordinary character |
| 1305 | # if it is the only special character in the string. This is because it's |
| 1306 | # rare to need "any one character", but needing a literal '.' is common |
| 1307 | # (e.g. '-f "DTLS 1.2"'). |
| 1308 | need_grep= |
| 1309 | case "$FILTER" in |
| 1310 | '^$') simple_filter=;; |
| 1311 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1312 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1313 | need_grep=1;; |
| 1314 | *) # No regexp or shell-pattern special character |
| 1315 | simple_filter="*$FILTER*";; |
| 1316 | esac |
| 1317 | case "$EXCLUDE" in |
| 1318 | '^$') simple_exclude=;; |
| 1319 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1320 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1321 | need_grep=1;; |
| 1322 | *) # No regexp or shell-pattern special character |
| 1323 | simple_exclude="*$EXCLUDE*";; |
| 1324 | esac |
| 1325 | if [ -n "$need_grep" ]; then |
| 1326 | is_excluded () { |
| 1327 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1328 | } |
| 1329 | else |
| 1330 | is_excluded () { |
| 1331 | case "$1" in |
| 1332 | $simple_exclude) true;; |
| 1333 | $simple_filter) false;; |
| 1334 | *) true;; |
| 1335 | esac |
| 1336 | } |
| 1337 | fi |
| 1338 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1339 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1340 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1341 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1342 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1343 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1344 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1345 | exit 1 |
| 1346 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1347 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1348 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1349 | exit 1 |
| 1350 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1351 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1352 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1353 | exit 1 |
| 1354 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1355 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1356 | if which valgrind >/dev/null 2>&1; then :; else |
| 1357 | echo "Memcheck not possible. Valgrind not found" |
| 1358 | exit 1 |
| 1359 | fi |
| 1360 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1361 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 1362 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1363 | exit 1 |
| 1364 | fi |
| 1365 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1366 | # used by watchdog |
| 1367 | MAIN_PID="$$" |
| 1368 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1369 | # We use somewhat arbitrary delays for tests: |
| 1370 | # - how long do we wait for the server to start (when lsof not available)? |
| 1371 | # - how long do we allow for the client to finish? |
| 1372 | # (not to check performance, just to avoid waiting indefinitely) |
| 1373 | # Things are slower with valgrind, so give extra time here. |
| 1374 | # |
| 1375 | # Note: without lsof, there is a trade-off between the running time of this |
| 1376 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1377 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1378 | # 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] | 1379 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1380 | START_DELAY=6 |
| 1381 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1382 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1383 | START_DELAY=2 |
| 1384 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1385 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1386 | |
| 1387 | # some particular tests need more time: |
| 1388 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1389 | # - for the server, we sleep for a number of seconds after the client exits |
| 1390 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1391 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1392 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1393 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1394 | # 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] | 1395 | # +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] | 1396 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 1397 | # 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] | 1398 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1399 | 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] | 1400 | 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] | 1401 | O_SRV="$O_SRV -accept $SRV_PORT" |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1402 | 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] | 1403 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1404 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1405 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1406 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1407 | 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] | 1408 | 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] | 1409 | fi |
| 1410 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 1411 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 1412 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1413 | 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] | 1414 | 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] | 1415 | fi |
| 1416 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1417 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1418 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1419 | 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] | 1420 | fi |
| 1421 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1422 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1423 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1424 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1425 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1426 | # Allow SHA-1, because many of our test certificates use it |
| 1427 | P_SRV="$P_SRV allow_sha1=1" |
| 1428 | P_CLI="$P_CLI allow_sha1=1" |
| 1429 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1430 | # Also pick a unique name for intermediate files |
| 1431 | SRV_OUT="srv_out.$$" |
| 1432 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1433 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1434 | SESSION="session.$$" |
| 1435 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1436 | SKIP_NEXT="NO" |
| 1437 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1438 | trap cleanup INT TERM HUP |
| 1439 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1440 | # Basic test |
| 1441 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1442 | # Checks that: |
| 1443 | # - 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] | 1444 | # - the expected parameters are selected |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1445 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1446 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1447 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1448 | "$P_CLI" \ |
| 1449 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1450 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1451 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1452 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 1453 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1454 | -S "error" \ |
| 1455 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1456 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1457 | run_test "Default, DTLS" \ |
| 1458 | "$P_SRV dtls=1" \ |
| 1459 | "$P_CLI dtls=1" \ |
| 1460 | 0 \ |
| 1461 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1462 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1463 | |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1464 | run_test "TLS client auth: required" \ |
| 1465 | "$P_SRV auth_mode=required" \ |
| 1466 | "$P_CLI" \ |
| 1467 | 0 \ |
| 1468 | -s "Verifying peer X.509 certificate... ok" |
| 1469 | |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 1470 | run_test "key size: TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1471 | "$P_SRV" \ |
| 1472 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1473 | 0 \ |
| 1474 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1475 | -c "Key size is 256" |
| 1476 | |
| 1477 | run_test "key size: TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1478 | "$P_SRV" \ |
| 1479 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1480 | 0 \ |
| 1481 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1482 | -c "Key size is 128" |
| 1483 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1484 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1485 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1486 | requires_config_enabled MBEDTLS_SHA256_C |
| 1487 | run_test "TLS: password protected client key" \ |
| 1488 | "$P_SRV auth_mode=required" \ |
| 1489 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1490 | 0 |
| 1491 | |
| 1492 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1493 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1494 | requires_config_enabled MBEDTLS_SHA256_C |
| 1495 | run_test "TLS: password protected server key" \ |
| 1496 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1497 | "$P_CLI" \ |
| 1498 | 0 |
| 1499 | |
| 1500 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1501 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1502 | requires_config_enabled MBEDTLS_RSA_C |
| 1503 | requires_config_enabled MBEDTLS_SHA256_C |
| 1504 | run_test "TLS: password protected server key, two certificates" \ |
| 1505 | "$P_SRV \ |
| 1506 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1507 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1508 | "$P_CLI" \ |
| 1509 | 0 |
| 1510 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1511 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1512 | run_test "CA callback on client" \ |
| 1513 | "$P_SRV debug_level=3" \ |
| 1514 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1515 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1516 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1517 | -S "error" \ |
| 1518 | -C "error" |
| 1519 | |
| 1520 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1521 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1522 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1523 | requires_config_enabled MBEDTLS_SHA256_C |
| 1524 | run_test "CA callback on server" \ |
| 1525 | "$P_SRV auth_mode=required" \ |
| 1526 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1527 | key_file=data_files/server5.key" \ |
| 1528 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1529 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1530 | -s "Verifying peer X.509 certificate... ok" \ |
| 1531 | -S "error" \ |
| 1532 | -C "error" |
| 1533 | |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1534 | # Test using an opaque private key for client authentication |
| 1535 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1536 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1537 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1538 | requires_config_enabled MBEDTLS_SHA256_C |
| 1539 | run_test "Opaque key for client authentication" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1540 | "$P_SRV auth_mode=required crt_file=data_files/server5.crt \ |
| 1541 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1542 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1543 | key_file=data_files/server5.key" \ |
| 1544 | 0 \ |
| 1545 | -c "key type: Opaque" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1546 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1547 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1548 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1549 | -S "error" \ |
| 1550 | -C "error" |
| 1551 | |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1552 | # Test using an opaque private key for server authentication |
| 1553 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1554 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1555 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1556 | requires_config_enabled MBEDTLS_SHA256_C |
| 1557 | run_test "Opaque key for server authentication" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1558 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
| 1559 | key_file=data_files/server5.key" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1560 | "$P_CLI crt_file=data_files/server5.crt \ |
| 1561 | key_file=data_files/server5.key" \ |
| 1562 | 0 \ |
| 1563 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1564 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 1565 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1566 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1567 | -S "error" \ |
| 1568 | -C "error" |
| 1569 | |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1570 | # Test using an opaque private key for client/server authentication |
| 1571 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1572 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1573 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1574 | requires_config_enabled MBEDTLS_SHA256_C |
| 1575 | run_test "Opaque key for client/server authentication" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1576 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
| 1577 | key_file=data_files/server5.key" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1578 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1579 | key_file=data_files/server5.key" \ |
| 1580 | 0 \ |
| 1581 | -c "key type: Opaque" \ |
| 1582 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1583 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 1584 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1585 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1586 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1587 | -S "error" \ |
| 1588 | -C "error" |
| 1589 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1590 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 1591 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 1592 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 1593 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 1594 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 1595 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 1596 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 1597 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 1598 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 1599 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 1600 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 1601 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1602 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1603 | run_test_psa_force_curve "secp521r1" |
| 1604 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 1605 | run_test_psa_force_curve "brainpoolP512r1" |
| 1606 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 1607 | run_test_psa_force_curve "secp384r1" |
| 1608 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1609 | run_test_psa_force_curve "brainpoolP384r1" |
| 1610 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1611 | run_test_psa_force_curve "secp256r1" |
| 1612 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1613 | run_test_psa_force_curve "secp256k1" |
| 1614 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1615 | run_test_psa_force_curve "brainpoolP256r1" |
| 1616 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1617 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1618 | ## SECP224K1 is buggy via the PSA API |
| 1619 | ## (https://github.com/ARMmbed/mbedtls/issues/3541), |
| 1620 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 1621 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 1622 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 1623 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1624 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1625 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1626 | run_test_psa_force_curve "secp192r1" |
| 1627 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1628 | run_test_psa_force_curve "secp192k1" |
| 1629 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1630 | # Test current time in ServerHello |
| 1631 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 1632 | run_test "ServerHello contains gmt_unix_time" \ |
| 1633 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1634 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1635 | 0 \ |
| 1636 | -f "check_server_hello_time" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1637 | -F "check_server_hello_time" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1638 | |
| 1639 | # Test for uniqueness of IVs in AEAD ciphersuites |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1640 | run_test "Unique IV in GCM" \ |
| 1641 | "$P_SRV exchanges=20 debug_level=4" \ |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1642 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1643 | 0 \ |
| 1644 | -u "IV used" \ |
| 1645 | -U "IV used" |
| 1646 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1647 | # Tests for certificate verification callback |
| 1648 | run_test "Configuration-specific CRT verification callback" \ |
| 1649 | "$P_SRV debug_level=3" \ |
| 1650 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1651 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1652 | -S "error" \ |
| 1653 | -c "Verify requested for " \ |
| 1654 | -c "Use configuration-specific verification callback" \ |
| 1655 | -C "Use context-specific verification callback" \ |
| 1656 | -C "error" |
| 1657 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1658 | run_test "Context-specific CRT verification callback" \ |
| 1659 | "$P_SRV debug_level=3" \ |
| 1660 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 1661 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1662 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1663 | -c "Verify requested for " \ |
| 1664 | -c "Use context-specific verification callback" \ |
| 1665 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1666 | -C "error" |
| 1667 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1668 | # Tests for SHA-1 support |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1669 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1670 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1671 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1672 | 1 \ |
| 1673 | -c "The certificate is signed with an unacceptable hash" |
| 1674 | |
| 1675 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1676 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1677 | "$P_CLI allow_sha1=1" \ |
| 1678 | 0 |
| 1679 | |
| 1680 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1681 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1682 | "$P_CLI allow_sha1=0" \ |
| 1683 | 0 |
| 1684 | |
| 1685 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1686 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1687 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1688 | 1 \ |
| 1689 | -s "The certificate is signed with an unacceptable hash" |
| 1690 | |
| 1691 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1692 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1693 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1694 | 0 |
| 1695 | |
| 1696 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1697 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1698 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1699 | 0 |
| 1700 | |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1701 | # Dummy TLS 1.3 test |
| 1702 | # Currently only checking that passing TLS 1.3 key exchange modes to |
| 1703 | # ssl_client2/ssl_server2 example programs works. |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1704 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1705 | run_test "TLS 1.3, key exchange mode parameter passing: PSK only" \ |
Jerry Yu | 31c01d3 | 2021-08-24 10:49:06 +0800 | [diff] [blame] | 1706 | "$P_SRV tls13_kex_modes=psk" \ |
| 1707 | "$P_CLI tls13_kex_modes=psk" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1708 | 0 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1709 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1710 | run_test "TLS 1.3, key exchange mode parameter passing: PSK-ephemeral only" \ |
| 1711 | "$P_SRV tls13_kex_modes=psk_ephemeral" \ |
| 1712 | "$P_CLI tls13_kex_modes=psk_ephemeral" \ |
| 1713 | 0 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1714 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1715 | 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] | 1716 | "$P_SRV tls13_kex_modes=ephemeral" \ |
| 1717 | "$P_CLI tls13_kex_modes=ephemeral" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1718 | 0 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1719 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1720 | run_test "TLS 1.3, key exchange mode parameter passing: All ephemeral" \ |
| 1721 | "$P_SRV tls13_kex_modes=ephemeral_all" \ |
| 1722 | "$P_CLI tls13_kex_modes=ephemeral_all" \ |
| 1723 | 0 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1724 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1725 | run_test "TLS 1.3, key exchange mode parameter passing: All PSK" \ |
| 1726 | "$P_SRV tls13_kex_modes=psk_all" \ |
| 1727 | "$P_CLI tls13_kex_modes=psk_all" \ |
| 1728 | 0 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1729 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1730 | run_test "TLS 1.3, key exchange mode parameter passing: All" \ |
| 1731 | "$P_SRV tls13_kex_modes=all" \ |
| 1732 | "$P_CLI tls13_kex_modes=all" \ |
| 1733 | 0 |
| 1734 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1735 | # Tests for datagram packing |
| 1736 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1737 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1738 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1739 | 0 \ |
| 1740 | -c "next record in same datagram" \ |
| 1741 | -s "next record in same datagram" |
| 1742 | |
| 1743 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1744 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1745 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1746 | 0 \ |
| 1747 | -s "next record in same datagram" \ |
| 1748 | -C "next record in same datagram" |
| 1749 | |
| 1750 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1751 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1752 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1753 | 0 \ |
| 1754 | -S "next record in same datagram" \ |
| 1755 | -c "next record in same datagram" |
| 1756 | |
| 1757 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1758 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1759 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1760 | 0 \ |
| 1761 | -S "next record in same datagram" \ |
| 1762 | -C "next record in same datagram" |
| 1763 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1764 | # Tests for Context serialization |
| 1765 | |
| 1766 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1767 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1768 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1769 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1770 | 0 \ |
| 1771 | -c "Deserializing connection..." \ |
| 1772 | -S "Deserializing connection..." |
| 1773 | |
| 1774 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1775 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 1776 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1777 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1778 | 0 \ |
| 1779 | -c "Deserializing connection..." \ |
| 1780 | -S "Deserializing connection..." |
| 1781 | |
| 1782 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1783 | run_test "Context serialization, client serializes, GCM" \ |
| 1784 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1785 | "$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] | 1786 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1787 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1788 | -S "Deserializing connection..." |
| 1789 | |
| 1790 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1791 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1792 | run_test "Context serialization, client serializes, with CID" \ |
| 1793 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1794 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1795 | 0 \ |
| 1796 | -c "Deserializing connection..." \ |
| 1797 | -S "Deserializing connection..." |
| 1798 | |
| 1799 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1800 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1801 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1802 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1803 | 0 \ |
| 1804 | -C "Deserializing connection..." \ |
| 1805 | -s "Deserializing connection..." |
| 1806 | |
| 1807 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1808 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 1809 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1810 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1811 | 0 \ |
| 1812 | -C "Deserializing connection..." \ |
| 1813 | -s "Deserializing connection..." |
| 1814 | |
| 1815 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1816 | run_test "Context serialization, server serializes, GCM" \ |
| 1817 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1818 | "$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] | 1819 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1820 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1821 | -s "Deserializing connection..." |
| 1822 | |
| 1823 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1824 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1825 | run_test "Context serialization, server serializes, with CID" \ |
| 1826 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1827 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1828 | 0 \ |
| 1829 | -C "Deserializing connection..." \ |
| 1830 | -s "Deserializing connection..." |
| 1831 | |
| 1832 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1833 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1834 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1835 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1836 | 0 \ |
| 1837 | -c "Deserializing connection..." \ |
| 1838 | -s "Deserializing connection..." |
| 1839 | |
| 1840 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1841 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 1842 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1843 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1844 | 0 \ |
| 1845 | -c "Deserializing connection..." \ |
| 1846 | -s "Deserializing connection..." |
| 1847 | |
| 1848 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1849 | run_test "Context serialization, both serialize, GCM" \ |
| 1850 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1851 | "$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] | 1852 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1853 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1854 | -s "Deserializing connection..." |
| 1855 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1856 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1857 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1858 | run_test "Context serialization, both serialize, with CID" \ |
| 1859 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1860 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1861 | 0 \ |
| 1862 | -c "Deserializing connection..." \ |
| 1863 | -s "Deserializing connection..." |
| 1864 | |
| 1865 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1866 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1867 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1868 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1869 | 0 \ |
| 1870 | -c "Deserializing connection..." \ |
| 1871 | -S "Deserializing connection..." |
| 1872 | |
| 1873 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1874 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 1875 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1876 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1877 | 0 \ |
| 1878 | -c "Deserializing connection..." \ |
| 1879 | -S "Deserializing connection..." |
| 1880 | |
| 1881 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1882 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 1883 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1884 | "$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] | 1885 | 0 \ |
| 1886 | -c "Deserializing connection..." \ |
| 1887 | -S "Deserializing connection..." |
| 1888 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1889 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1890 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1891 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 1892 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1893 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1894 | 0 \ |
| 1895 | -c "Deserializing connection..." \ |
| 1896 | -S "Deserializing connection..." |
| 1897 | |
| 1898 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1899 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1900 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1901 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1902 | 0 \ |
| 1903 | -C "Deserializing connection..." \ |
| 1904 | -s "Deserializing connection..." |
| 1905 | |
| 1906 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1907 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 1908 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1909 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1910 | 0 \ |
| 1911 | -C "Deserializing connection..." \ |
| 1912 | -s "Deserializing connection..." |
| 1913 | |
| 1914 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1915 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 1916 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1917 | "$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] | 1918 | 0 \ |
| 1919 | -C "Deserializing connection..." \ |
| 1920 | -s "Deserializing connection..." |
| 1921 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1922 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1923 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1924 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 1925 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1926 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1927 | 0 \ |
| 1928 | -C "Deserializing connection..." \ |
| 1929 | -s "Deserializing connection..." |
| 1930 | |
| 1931 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1932 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1933 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1934 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1935 | 0 \ |
| 1936 | -c "Deserializing connection..." \ |
| 1937 | -s "Deserializing connection..." |
| 1938 | |
| 1939 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1940 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 1941 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1942 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1943 | 0 \ |
| 1944 | -c "Deserializing connection..." \ |
| 1945 | -s "Deserializing connection..." |
| 1946 | |
| 1947 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1948 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 1949 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1950 | "$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] | 1951 | 0 \ |
| 1952 | -c "Deserializing connection..." \ |
| 1953 | -s "Deserializing connection..." |
| 1954 | |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1955 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1956 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1957 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 1958 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1959 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1960 | 0 \ |
| 1961 | -c "Deserializing connection..." \ |
| 1962 | -s "Deserializing connection..." |
| 1963 | |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1964 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1965 | run_test "Saving the serialized context to a file" \ |
| 1966 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 1967 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 1968 | 0 \ |
| 1969 | -s "Save serialized context to a file... ok" \ |
| 1970 | -c "Save serialized context to a file... ok" |
| 1971 | rm -f context_srv.txt |
| 1972 | rm -f context_cli.txt |
| 1973 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1974 | # Tests for DTLS Connection ID extension |
| 1975 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1976 | # So far, the CID API isn't implemented, so we can't |
| 1977 | # grep for output witnessing its use. This needs to be |
| 1978 | # changed once the CID extension is implemented. |
| 1979 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1980 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1981 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1982 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 1983 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1984 | 0 \ |
| 1985 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1986 | -s "found CID extension" \ |
| 1987 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1988 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1989 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1990 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1991 | -C "found CID extension" \ |
| 1992 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1993 | -C "Copy CIDs into SSL transform" \ |
| 1994 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1995 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1996 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1997 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1998 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1999 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 2000 | 0 \ |
| 2001 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2002 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2003 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2004 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2005 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2006 | -C "found CID extension" \ |
| 2007 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2008 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 2009 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2010 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2011 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2012 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2013 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2014 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 2015 | 0 \ |
| 2016 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2017 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2018 | -c "client hello, adding CID extension" \ |
| 2019 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2020 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2021 | -s "server hello, adding CID extension" \ |
| 2022 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2023 | -c "Use of CID extension negotiated" \ |
| 2024 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2025 | -c "Copy CIDs into SSL transform" \ |
| 2026 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2027 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2028 | -s "Use of Connection ID has been negotiated" \ |
| 2029 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2030 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2031 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2032 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2033 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2034 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 2035 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 2036 | 0 \ |
| 2037 | -c "Enable use of CID extension." \ |
| 2038 | -s "Enable use of CID extension." \ |
| 2039 | -c "client hello, adding CID extension" \ |
| 2040 | -s "found CID extension" \ |
| 2041 | -s "Use of CID extension negotiated" \ |
| 2042 | -s "server hello, adding CID extension" \ |
| 2043 | -c "found CID extension" \ |
| 2044 | -c "Use of CID extension negotiated" \ |
| 2045 | -s "Copy CIDs into SSL transform" \ |
| 2046 | -c "Copy CIDs into SSL transform" \ |
| 2047 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2048 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2049 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2050 | -c "Use of Connection ID has been negotiated" \ |
| 2051 | -c "ignoring unexpected CID" \ |
| 2052 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2053 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2054 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2055 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 2056 | -p "$P_PXY mtu=800" \ |
| 2057 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2058 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2059 | 0 \ |
| 2060 | -c "Enable use of CID extension." \ |
| 2061 | -s "Enable use of CID extension." \ |
| 2062 | -c "client hello, adding CID extension" \ |
| 2063 | -s "found CID extension" \ |
| 2064 | -s "Use of CID extension negotiated" \ |
| 2065 | -s "server hello, adding CID extension" \ |
| 2066 | -c "found CID extension" \ |
| 2067 | -c "Use of CID extension negotiated" \ |
| 2068 | -s "Copy CIDs into SSL transform" \ |
| 2069 | -c "Copy CIDs into SSL transform" \ |
| 2070 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2071 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2072 | -s "Use of Connection ID has been negotiated" \ |
| 2073 | -c "Use of Connection ID has been negotiated" |
| 2074 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2075 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2076 | 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] | 2077 | -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] | 2078 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2079 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2080 | 0 \ |
| 2081 | -c "Enable use of CID extension." \ |
| 2082 | -s "Enable use of CID extension." \ |
| 2083 | -c "client hello, adding CID extension" \ |
| 2084 | -s "found CID extension" \ |
| 2085 | -s "Use of CID extension negotiated" \ |
| 2086 | -s "server hello, adding CID extension" \ |
| 2087 | -c "found CID extension" \ |
| 2088 | -c "Use of CID extension negotiated" \ |
| 2089 | -s "Copy CIDs into SSL transform" \ |
| 2090 | -c "Copy CIDs into SSL transform" \ |
| 2091 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2092 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2093 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2094 | -c "Use of Connection ID has been negotiated" \ |
| 2095 | -c "ignoring unexpected CID" \ |
| 2096 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2097 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2098 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2099 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2100 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2101 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2102 | 0 \ |
| 2103 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2104 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2105 | -c "client hello, adding CID extension" \ |
| 2106 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2107 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2108 | -s "server hello, adding CID extension" \ |
| 2109 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2110 | -c "Use of CID extension negotiated" \ |
| 2111 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2112 | -c "Copy CIDs into SSL transform" \ |
| 2113 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2114 | -s "Peer CID (length 0 Bytes):" \ |
| 2115 | -s "Use of Connection ID has been negotiated" \ |
| 2116 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2117 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2118 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2119 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2120 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2121 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2122 | 0 \ |
| 2123 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2124 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2125 | -c "client hello, adding CID extension" \ |
| 2126 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2127 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2128 | -s "server hello, adding CID extension" \ |
| 2129 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2130 | -c "Use of CID extension negotiated" \ |
| 2131 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2132 | -c "Copy CIDs into SSL transform" \ |
| 2133 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2134 | -c "Peer CID (length 0 Bytes):" \ |
| 2135 | -s "Use of Connection ID has been negotiated" \ |
| 2136 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2137 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2138 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2139 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2140 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2141 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2142 | 0 \ |
| 2143 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2144 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2145 | -c "client hello, adding CID extension" \ |
| 2146 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2147 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2148 | -s "server hello, adding CID extension" \ |
| 2149 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2150 | -c "Use of CID extension negotiated" \ |
| 2151 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2152 | -c "Copy CIDs into SSL transform" \ |
| 2153 | -S "Use of Connection ID has been negotiated" \ |
| 2154 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2155 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2156 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2157 | 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] | 2158 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2159 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2160 | 0 \ |
| 2161 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2162 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2163 | -c "client hello, adding CID extension" \ |
| 2164 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2165 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2166 | -s "server hello, adding CID extension" \ |
| 2167 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2168 | -c "Use of CID extension negotiated" \ |
| 2169 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2170 | -c "Copy CIDs into SSL transform" \ |
| 2171 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2172 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2173 | -s "Use of Connection ID has been negotiated" \ |
| 2174 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2175 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2176 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2177 | 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] | 2178 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2179 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2180 | 0 \ |
| 2181 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2182 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2183 | -c "client hello, adding CID extension" \ |
| 2184 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2185 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2186 | -s "server hello, adding CID extension" \ |
| 2187 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2188 | -c "Use of CID extension negotiated" \ |
| 2189 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2190 | -c "Copy CIDs into SSL transform" \ |
| 2191 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2192 | -s "Peer CID (length 0 Bytes):" \ |
| 2193 | -s "Use of Connection ID has been negotiated" \ |
| 2194 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2195 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2196 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2197 | 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] | 2198 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2199 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2200 | 0 \ |
| 2201 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2202 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2203 | -c "client hello, adding CID extension" \ |
| 2204 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2205 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2206 | -s "server hello, adding CID extension" \ |
| 2207 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2208 | -c "Use of CID extension negotiated" \ |
| 2209 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2210 | -c "Copy CIDs into SSL transform" \ |
| 2211 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2212 | -c "Peer CID (length 0 Bytes):" \ |
| 2213 | -s "Use of Connection ID has been negotiated" \ |
| 2214 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2215 | |
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 empty, AES-128-CCM-8" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2218 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2219 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 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 | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2230 | -c "Copy CIDs into SSL transform" \ |
| 2231 | -S "Use of Connection ID has been negotiated" \ |
| 2232 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2233 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2234 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2235 | 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] | 2236 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2237 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2238 | 0 \ |
| 2239 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2240 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2241 | -c "client hello, adding CID extension" \ |
| 2242 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2243 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2244 | -s "server hello, adding CID extension" \ |
| 2245 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2246 | -c "Use of CID extension negotiated" \ |
| 2247 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2248 | -c "Copy CIDs into SSL transform" \ |
| 2249 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2250 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2251 | -s "Use of Connection ID has been negotiated" \ |
| 2252 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2253 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2254 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2255 | 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] | 2256 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2257 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2258 | 0 \ |
| 2259 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2260 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2261 | -c "client hello, adding CID extension" \ |
| 2262 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2263 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2264 | -s "server hello, adding CID extension" \ |
| 2265 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2266 | -c "Use of CID extension negotiated" \ |
| 2267 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2268 | -c "Copy CIDs into SSL transform" \ |
| 2269 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2270 | -s "Peer CID (length 0 Bytes):" \ |
| 2271 | -s "Use of Connection ID has been negotiated" \ |
| 2272 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2273 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2274 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2275 | 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] | 2276 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2277 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2278 | 0 \ |
| 2279 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2280 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2281 | -c "client hello, adding CID extension" \ |
| 2282 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2283 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2284 | -s "server hello, adding CID extension" \ |
| 2285 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2286 | -c "Use of CID extension negotiated" \ |
| 2287 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2288 | -c "Copy CIDs into SSL transform" \ |
| 2289 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2290 | -c "Peer CID (length 0 Bytes):" \ |
| 2291 | -s "Use of Connection ID has been negotiated" \ |
| 2292 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2293 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2294 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2295 | 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] | 2296 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2297 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2298 | 0 \ |
| 2299 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2300 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2301 | -c "client hello, adding CID extension" \ |
| 2302 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2303 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2304 | -s "server hello, adding CID extension" \ |
| 2305 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2306 | -c "Use of CID extension negotiated" \ |
| 2307 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2308 | -c "Copy CIDs into SSL transform" \ |
| 2309 | -S "Use of Connection ID has been negotiated" \ |
| 2310 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2311 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2312 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 2313 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2314 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2315 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2316 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2317 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2318 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2319 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2320 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2321 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2322 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2323 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2324 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2325 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2326 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2327 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2328 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2329 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2330 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2331 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2332 | 0 \ |
| 2333 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2334 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2335 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2336 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2337 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2338 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2339 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2340 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2341 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2342 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2343 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2344 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 2345 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2346 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2347 | 0 \ |
| 2348 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2349 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2350 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2351 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2352 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2353 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2354 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2355 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2356 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2357 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2358 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2359 | 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] | 2360 | -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] | 2361 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2362 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2363 | 0 \ |
| 2364 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2365 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2366 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2367 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2368 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2369 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2370 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2371 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2372 | -c "ignoring unexpected CID" \ |
| 2373 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2374 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2375 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2376 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2377 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2378 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2379 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2380 | 0 \ |
| 2381 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2382 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2383 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2384 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2385 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2386 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2387 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2388 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2389 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2390 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2391 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2392 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 2393 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2394 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2395 | 0 \ |
| 2396 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2397 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2398 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2399 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2400 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2401 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2402 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2403 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2404 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2405 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2406 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2407 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2408 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2409 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2410 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2411 | 0 \ |
| 2412 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2413 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2414 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2415 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2416 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2417 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2418 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2419 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2420 | -c "ignoring unexpected CID" \ |
| 2421 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2422 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2423 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2424 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2425 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2426 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2427 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2428 | 0 \ |
| 2429 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2430 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2431 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2432 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2433 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2434 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2435 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2436 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2437 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2438 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 2439 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2440 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2441 | 0 \ |
| 2442 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2443 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2444 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2445 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2446 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2447 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2448 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2449 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2450 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2451 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2452 | -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] | 2453 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2454 | "$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" \ |
| 2455 | 0 \ |
| 2456 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2457 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2458 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2459 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2460 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2461 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2462 | -c "ignoring unexpected CID" \ |
| 2463 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2464 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2465 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2466 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2467 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2468 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2469 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2470 | 0 \ |
| 2471 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2472 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2473 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2474 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2475 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2476 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2477 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2478 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2479 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 2480 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2481 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2482 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2483 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2484 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2485 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2486 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2487 | 0 \ |
| 2488 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2489 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2490 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2491 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2492 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2493 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2494 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2495 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2496 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2497 | -c "ignoring unexpected CID" \ |
| 2498 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2499 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2500 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2501 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2502 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 2503 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2504 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2505 | 0 \ |
| 2506 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2507 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2508 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2509 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2510 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2511 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2512 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2513 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2514 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2515 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2516 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2517 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2518 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2519 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2520 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2521 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2522 | 0 \ |
| 2523 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2524 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2525 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2526 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2527 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2528 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2529 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2530 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2531 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2532 | -c "ignoring unexpected CID" \ |
| 2533 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2534 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 2535 | # 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] | 2536 | # tests check that the buffer contents are reallocated when the message is |
| 2537 | # larger than the buffer. |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2538 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2539 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2540 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2541 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 2542 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2543 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 2544 | 0 \ |
| 2545 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2546 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2547 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2548 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2549 | -s "Reallocating in_buf" \ |
| 2550 | -s "Reallocating out_buf" |
| 2551 | |
| 2552 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2553 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2554 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2555 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 2556 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2557 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 2558 | 0 \ |
| 2559 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2560 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2561 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2562 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2563 | -s "Reallocating in_buf" \ |
| 2564 | -s "Reallocating out_buf" |
| 2565 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2566 | # Tests for Encrypt-then-MAC extension |
| 2567 | |
| 2568 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2569 | "$P_SRV debug_level=3 \ |
| 2570 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2571 | "$P_CLI debug_level=3" \ |
| 2572 | 0 \ |
| 2573 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2574 | -s "found encrypt then mac extension" \ |
| 2575 | -s "server hello, adding encrypt then mac extension" \ |
| 2576 | -c "found encrypt_then_mac extension" \ |
| 2577 | -c "using encrypt then mac" \ |
| 2578 | -s "using encrypt then mac" |
| 2579 | |
| 2580 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2581 | "$P_SRV debug_level=3 etm=0 \ |
| 2582 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2583 | "$P_CLI debug_level=3 etm=1" \ |
| 2584 | 0 \ |
| 2585 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2586 | -s "found encrypt then mac extension" \ |
| 2587 | -S "server hello, adding encrypt then mac extension" \ |
| 2588 | -C "found encrypt_then_mac extension" \ |
| 2589 | -C "using encrypt then mac" \ |
| 2590 | -S "using encrypt then mac" |
| 2591 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2592 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 2593 | "$P_SRV debug_level=3 etm=1 \ |
| 2594 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 2595 | "$P_CLI debug_level=3 etm=1" \ |
| 2596 | 0 \ |
| 2597 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2598 | -s "found encrypt then mac extension" \ |
| 2599 | -S "server hello, adding encrypt then mac extension" \ |
| 2600 | -C "found encrypt_then_mac extension" \ |
| 2601 | -C "using encrypt then mac" \ |
| 2602 | -S "using encrypt then mac" |
| 2603 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2604 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2605 | "$P_SRV debug_level=3 etm=1 \ |
| 2606 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2607 | "$P_CLI debug_level=3 etm=0" \ |
| 2608 | 0 \ |
| 2609 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2610 | -S "found encrypt then mac extension" \ |
| 2611 | -S "server hello, adding encrypt then mac extension" \ |
| 2612 | -C "found encrypt_then_mac extension" \ |
| 2613 | -C "using encrypt then mac" \ |
| 2614 | -S "using encrypt then mac" |
| 2615 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2616 | # Tests for Extended Master Secret extension |
| 2617 | |
| 2618 | run_test "Extended Master Secret: default" \ |
| 2619 | "$P_SRV debug_level=3" \ |
| 2620 | "$P_CLI debug_level=3" \ |
| 2621 | 0 \ |
| 2622 | -c "client hello, adding extended_master_secret extension" \ |
| 2623 | -s "found extended master secret extension" \ |
| 2624 | -s "server hello, adding extended master secret extension" \ |
| 2625 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2626 | -c "session hash for extended master secret" \ |
| 2627 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2628 | |
| 2629 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 2630 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 2631 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 2632 | 0 \ |
| 2633 | -c "client hello, adding extended_master_secret extension" \ |
| 2634 | -s "found extended master secret extension" \ |
| 2635 | -S "server hello, adding extended master secret extension" \ |
| 2636 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2637 | -C "session hash for extended master secret" \ |
| 2638 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2639 | |
| 2640 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 2641 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 2642 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 2643 | 0 \ |
| 2644 | -C "client hello, adding extended_master_secret extension" \ |
| 2645 | -S "found extended master secret extension" \ |
| 2646 | -S "server hello, adding extended master secret extension" \ |
| 2647 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2648 | -C "session hash for extended master secret" \ |
| 2649 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2650 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2651 | # Test sending and receiving empty application data records |
| 2652 | |
| 2653 | run_test "Encrypt then MAC: empty application data record" \ |
| 2654 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 2655 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 2656 | 0 \ |
| 2657 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2658 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2659 | -c "0 bytes written in 1 fragments" |
| 2660 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2661 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2662 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 2663 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 2664 | 0 \ |
| 2665 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2666 | -c "0 bytes written in 1 fragments" |
| 2667 | |
| 2668 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 2669 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 2670 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 2671 | 0 \ |
| 2672 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2673 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2674 | -c "0 bytes written in 1 fragments" |
| 2675 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2676 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2677 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 2678 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 2679 | 0 \ |
| 2680 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2681 | -c "0 bytes written in 1 fragments" |
| 2682 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2683 | # Tests for CBC 1/n-1 record splitting |
| 2684 | |
| 2685 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 2686 | "$P_SRV" \ |
| 2687 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 2688 | request_size=123 force_version=tls12" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2689 | 0 \ |
| 2690 | -s "Read from client: 123 bytes read" \ |
| 2691 | -S "Read from client: 1 bytes read" \ |
| 2692 | -S "122 bytes read" |
| 2693 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2694 | # Tests for Session Tickets |
| 2695 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2696 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2697 | "$P_SRV debug_level=3 tickets=1" \ |
| 2698 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2699 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2700 | -c "client hello, adding session ticket extension" \ |
| 2701 | -s "found session ticket extension" \ |
| 2702 | -s "server hello, adding session ticket extension" \ |
| 2703 | -c "found session_ticket extension" \ |
| 2704 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2705 | -S "session successfully restored from cache" \ |
| 2706 | -s "session successfully restored from ticket" \ |
| 2707 | -s "a session has been resumed" \ |
| 2708 | -c "a session has been resumed" |
| 2709 | |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame^] | 2710 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 2711 | run_test "Session resume using tickets: manual rotation" \ |
| 2712 | "$P_SRV debug_level=3 tickets=1 ticket_rotate=1" \ |
| 2713 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2714 | 0 \ |
| 2715 | -c "client hello, adding session ticket extension" \ |
| 2716 | -s "found session ticket extension" \ |
| 2717 | -s "server hello, adding session ticket extension" \ |
| 2718 | -c "found session_ticket extension" \ |
| 2719 | -c "parse new session ticket" \ |
| 2720 | -S "session successfully restored from cache" \ |
| 2721 | -s "session successfully restored from ticket" \ |
| 2722 | -s "a session has been resumed" \ |
| 2723 | -c "a session has been resumed" |
| 2724 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2725 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2726 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2727 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2728 | 0 \ |
| 2729 | -c "client hello, adding session ticket extension" \ |
| 2730 | -s "found session ticket extension" \ |
| 2731 | -s "server hello, adding session ticket extension" \ |
| 2732 | -c "found session_ticket extension" \ |
| 2733 | -c "parse new session ticket" \ |
| 2734 | -S "session successfully restored from cache" \ |
| 2735 | -s "session successfully restored from ticket" \ |
| 2736 | -s "a session has been resumed" \ |
| 2737 | -c "a session has been resumed" |
| 2738 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2739 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2740 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2741 | "$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] | 2742 | 0 \ |
| 2743 | -c "client hello, adding session ticket extension" \ |
| 2744 | -s "found session ticket extension" \ |
| 2745 | -s "server hello, adding session ticket extension" \ |
| 2746 | -c "found session_ticket extension" \ |
| 2747 | -c "parse new session ticket" \ |
| 2748 | -S "session successfully restored from cache" \ |
| 2749 | -S "session successfully restored from ticket" \ |
| 2750 | -S "a session has been resumed" \ |
| 2751 | -C "a session has been resumed" |
| 2752 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2753 | run_test "Session resume using tickets: session copy" \ |
| 2754 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2755 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 2756 | 0 \ |
| 2757 | -c "client hello, adding session ticket extension" \ |
| 2758 | -s "found session ticket extension" \ |
| 2759 | -s "server hello, adding session ticket extension" \ |
| 2760 | -c "found session_ticket extension" \ |
| 2761 | -c "parse new session ticket" \ |
| 2762 | -S "session successfully restored from cache" \ |
| 2763 | -s "session successfully restored from ticket" \ |
| 2764 | -s "a session has been resumed" \ |
| 2765 | -c "a session has been resumed" |
| 2766 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2767 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2768 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2769 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2770 | 0 \ |
| 2771 | -c "client hello, adding session ticket extension" \ |
| 2772 | -c "found session_ticket extension" \ |
| 2773 | -c "parse new session ticket" \ |
| 2774 | -c "a session has been resumed" |
| 2775 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2776 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2777 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2778 | "( $O_CLI -sess_out $SESSION; \ |
| 2779 | $O_CLI -sess_in $SESSION; \ |
| 2780 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2781 | 0 \ |
| 2782 | -s "found session ticket extension" \ |
| 2783 | -s "server hello, adding session ticket extension" \ |
| 2784 | -S "session successfully restored from cache" \ |
| 2785 | -s "session successfully restored from ticket" \ |
| 2786 | -s "a session has been resumed" |
| 2787 | |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 2788 | run_test "Session resume using tickets: AES-128-GCM" \ |
| 2789 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-GCM" \ |
| 2790 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2791 | 0 \ |
| 2792 | -c "client hello, adding session ticket extension" \ |
| 2793 | -s "found session ticket extension" \ |
| 2794 | -s "server hello, adding session ticket extension" \ |
| 2795 | -c "found session_ticket extension" \ |
| 2796 | -c "parse new session ticket" \ |
| 2797 | -S "session successfully restored from cache" \ |
| 2798 | -s "session successfully restored from ticket" \ |
| 2799 | -s "a session has been resumed" \ |
| 2800 | -c "a session has been resumed" |
| 2801 | |
| 2802 | run_test "Session resume using tickets: AES-192-GCM" \ |
| 2803 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-GCM" \ |
| 2804 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2805 | 0 \ |
| 2806 | -c "client hello, adding session ticket extension" \ |
| 2807 | -s "found session ticket extension" \ |
| 2808 | -s "server hello, adding session ticket extension" \ |
| 2809 | -c "found session_ticket extension" \ |
| 2810 | -c "parse new session ticket" \ |
| 2811 | -S "session successfully restored from cache" \ |
| 2812 | -s "session successfully restored from ticket" \ |
| 2813 | -s "a session has been resumed" \ |
| 2814 | -c "a session has been resumed" |
| 2815 | |
| 2816 | run_test "Session resume using tickets: AES-128-CCM" \ |
| 2817 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-CCM" \ |
| 2818 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2819 | 0 \ |
| 2820 | -c "client hello, adding session ticket extension" \ |
| 2821 | -s "found session ticket extension" \ |
| 2822 | -s "server hello, adding session ticket extension" \ |
| 2823 | -c "found session_ticket extension" \ |
| 2824 | -c "parse new session ticket" \ |
| 2825 | -S "session successfully restored from cache" \ |
| 2826 | -s "session successfully restored from ticket" \ |
| 2827 | -s "a session has been resumed" \ |
| 2828 | -c "a session has been resumed" |
| 2829 | |
| 2830 | run_test "Session resume using tickets: AES-192-CCM" \ |
| 2831 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-CCM" \ |
| 2832 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2833 | 0 \ |
| 2834 | -c "client hello, adding session ticket extension" \ |
| 2835 | -s "found session ticket extension" \ |
| 2836 | -s "server hello, adding session ticket extension" \ |
| 2837 | -c "found session_ticket extension" \ |
| 2838 | -c "parse new session ticket" \ |
| 2839 | -S "session successfully restored from cache" \ |
| 2840 | -s "session successfully restored from ticket" \ |
| 2841 | -s "a session has been resumed" \ |
| 2842 | -c "a session has been resumed" |
| 2843 | |
| 2844 | run_test "Session resume using tickets: AES-256-CCM" \ |
| 2845 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-256-CCM" \ |
| 2846 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2847 | 0 \ |
| 2848 | -c "client hello, adding session ticket extension" \ |
| 2849 | -s "found session ticket extension" \ |
| 2850 | -s "server hello, adding session ticket extension" \ |
| 2851 | -c "found session_ticket extension" \ |
| 2852 | -c "parse new session ticket" \ |
| 2853 | -S "session successfully restored from cache" \ |
| 2854 | -s "session successfully restored from ticket" \ |
| 2855 | -s "a session has been resumed" \ |
| 2856 | -c "a session has been resumed" |
| 2857 | |
| 2858 | run_test "Session resume using tickets: CAMELLIA-128-CCM" \ |
| 2859 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-128-CCM" \ |
| 2860 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2861 | 0 \ |
| 2862 | -c "client hello, adding session ticket extension" \ |
| 2863 | -s "found session ticket extension" \ |
| 2864 | -s "server hello, adding session ticket extension" \ |
| 2865 | -c "found session_ticket extension" \ |
| 2866 | -c "parse new session ticket" \ |
| 2867 | -S "session successfully restored from cache" \ |
| 2868 | -s "session successfully restored from ticket" \ |
| 2869 | -s "a session has been resumed" \ |
| 2870 | -c "a session has been resumed" |
| 2871 | |
| 2872 | run_test "Session resume using tickets: CAMELLIA-192-CCM" \ |
| 2873 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-192-CCM" \ |
| 2874 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2875 | 0 \ |
| 2876 | -c "client hello, adding session ticket extension" \ |
| 2877 | -s "found session ticket extension" \ |
| 2878 | -s "server hello, adding session ticket extension" \ |
| 2879 | -c "found session_ticket extension" \ |
| 2880 | -c "parse new session ticket" \ |
| 2881 | -S "session successfully restored from cache" \ |
| 2882 | -s "session successfully restored from ticket" \ |
| 2883 | -s "a session has been resumed" \ |
| 2884 | -c "a session has been resumed" |
| 2885 | |
| 2886 | run_test "Session resume using tickets: CAMELLIA-256-CCM" \ |
| 2887 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-256-CCM" \ |
| 2888 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2889 | 0 \ |
| 2890 | -c "client hello, adding session ticket extension" \ |
| 2891 | -s "found session ticket extension" \ |
| 2892 | -s "server hello, adding session ticket extension" \ |
| 2893 | -c "found session_ticket extension" \ |
| 2894 | -c "parse new session ticket" \ |
| 2895 | -S "session successfully restored from cache" \ |
| 2896 | -s "session successfully restored from ticket" \ |
| 2897 | -s "a session has been resumed" \ |
| 2898 | -c "a session has been resumed" |
| 2899 | |
| 2900 | run_test "Session resume using tickets: ARIA-128-GCM" \ |
| 2901 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-GCM" \ |
| 2902 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2903 | 0 \ |
| 2904 | -c "client hello, adding session ticket extension" \ |
| 2905 | -s "found session ticket extension" \ |
| 2906 | -s "server hello, adding session ticket extension" \ |
| 2907 | -c "found session_ticket extension" \ |
| 2908 | -c "parse new session ticket" \ |
| 2909 | -S "session successfully restored from cache" \ |
| 2910 | -s "session successfully restored from ticket" \ |
| 2911 | -s "a session has been resumed" \ |
| 2912 | -c "a session has been resumed" |
| 2913 | |
| 2914 | run_test "Session resume using tickets: ARIA-192-GCM" \ |
| 2915 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-GCM" \ |
| 2916 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2917 | 0 \ |
| 2918 | -c "client hello, adding session ticket extension" \ |
| 2919 | -s "found session ticket extension" \ |
| 2920 | -s "server hello, adding session ticket extension" \ |
| 2921 | -c "found session_ticket extension" \ |
| 2922 | -c "parse new session ticket" \ |
| 2923 | -S "session successfully restored from cache" \ |
| 2924 | -s "session successfully restored from ticket" \ |
| 2925 | -s "a session has been resumed" \ |
| 2926 | -c "a session has been resumed" |
| 2927 | |
| 2928 | run_test "Session resume using tickets: ARIA-256-GCM" \ |
| 2929 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-GCM" \ |
| 2930 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2931 | 0 \ |
| 2932 | -c "client hello, adding session ticket extension" \ |
| 2933 | -s "found session ticket extension" \ |
| 2934 | -s "server hello, adding session ticket extension" \ |
| 2935 | -c "found session_ticket extension" \ |
| 2936 | -c "parse new session ticket" \ |
| 2937 | -S "session successfully restored from cache" \ |
| 2938 | -s "session successfully restored from ticket" \ |
| 2939 | -s "a session has been resumed" \ |
| 2940 | -c "a session has been resumed" |
| 2941 | |
| 2942 | run_test "Session resume using tickets: ARIA-128-CCM" \ |
| 2943 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-CCM" \ |
| 2944 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2945 | 0 \ |
| 2946 | -c "client hello, adding session ticket extension" \ |
| 2947 | -s "found session ticket extension" \ |
| 2948 | -s "server hello, adding session ticket extension" \ |
| 2949 | -c "found session_ticket extension" \ |
| 2950 | -c "parse new session ticket" \ |
| 2951 | -S "session successfully restored from cache" \ |
| 2952 | -s "session successfully restored from ticket" \ |
| 2953 | -s "a session has been resumed" \ |
| 2954 | -c "a session has been resumed" |
| 2955 | |
| 2956 | run_test "Session resume using tickets: ARIA-192-CCM" \ |
| 2957 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-CCM" \ |
| 2958 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2959 | 0 \ |
| 2960 | -c "client hello, adding session ticket extension" \ |
| 2961 | -s "found session ticket extension" \ |
| 2962 | -s "server hello, adding session ticket extension" \ |
| 2963 | -c "found session_ticket extension" \ |
| 2964 | -c "parse new session ticket" \ |
| 2965 | -S "session successfully restored from cache" \ |
| 2966 | -s "session successfully restored from ticket" \ |
| 2967 | -s "a session has been resumed" \ |
| 2968 | -c "a session has been resumed" |
| 2969 | |
| 2970 | run_test "Session resume using tickets: ARIA-256-CCM" \ |
| 2971 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-CCM" \ |
| 2972 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2973 | 0 \ |
| 2974 | -c "client hello, adding session ticket extension" \ |
| 2975 | -s "found session ticket extension" \ |
| 2976 | -s "server hello, adding session ticket extension" \ |
| 2977 | -c "found session_ticket extension" \ |
| 2978 | -c "parse new session ticket" \ |
| 2979 | -S "session successfully restored from cache" \ |
| 2980 | -s "session successfully restored from ticket" \ |
| 2981 | -s "a session has been resumed" \ |
| 2982 | -c "a session has been resumed" |
| 2983 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2984 | # Tests for Session Tickets with DTLS |
| 2985 | |
| 2986 | run_test "Session resume using tickets, DTLS: basic" \ |
| 2987 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2988 | "$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] | 2989 | 0 \ |
| 2990 | -c "client hello, adding session ticket extension" \ |
| 2991 | -s "found session ticket extension" \ |
| 2992 | -s "server hello, adding session ticket extension" \ |
| 2993 | -c "found session_ticket extension" \ |
| 2994 | -c "parse new session ticket" \ |
| 2995 | -S "session successfully restored from cache" \ |
| 2996 | -s "session successfully restored from ticket" \ |
| 2997 | -s "a session has been resumed" \ |
| 2998 | -c "a session has been resumed" |
| 2999 | |
| 3000 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 3001 | "$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] | 3002 | "$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] | 3003 | 0 \ |
| 3004 | -c "client hello, adding session ticket extension" \ |
| 3005 | -s "found session ticket extension" \ |
| 3006 | -s "server hello, adding session ticket extension" \ |
| 3007 | -c "found session_ticket extension" \ |
| 3008 | -c "parse new session ticket" \ |
| 3009 | -S "session successfully restored from cache" \ |
| 3010 | -s "session successfully restored from ticket" \ |
| 3011 | -s "a session has been resumed" \ |
| 3012 | -c "a session has been resumed" |
| 3013 | |
| 3014 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 3015 | "$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] | 3016 | "$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] | 3017 | 0 \ |
| 3018 | -c "client hello, adding session ticket extension" \ |
| 3019 | -s "found session ticket extension" \ |
| 3020 | -s "server hello, adding session ticket extension" \ |
| 3021 | -c "found session_ticket extension" \ |
| 3022 | -c "parse new session ticket" \ |
| 3023 | -S "session successfully restored from cache" \ |
| 3024 | -S "session successfully restored from ticket" \ |
| 3025 | -S "a session has been resumed" \ |
| 3026 | -C "a session has been resumed" |
| 3027 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3028 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 3029 | "$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] | 3030 | "$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] | 3031 | 0 \ |
| 3032 | -c "client hello, adding session ticket extension" \ |
| 3033 | -s "found session ticket extension" \ |
| 3034 | -s "server hello, adding session ticket extension" \ |
| 3035 | -c "found session_ticket extension" \ |
| 3036 | -c "parse new session ticket" \ |
| 3037 | -S "session successfully restored from cache" \ |
| 3038 | -s "session successfully restored from ticket" \ |
| 3039 | -s "a session has been resumed" \ |
| 3040 | -c "a session has been resumed" |
| 3041 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3042 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 3043 | "$O_SRV -dtls" \ |
| 3044 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 3045 | 0 \ |
| 3046 | -c "client hello, adding session ticket extension" \ |
| 3047 | -c "found session_ticket extension" \ |
| 3048 | -c "parse new session ticket" \ |
| 3049 | -c "a session has been resumed" |
| 3050 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3051 | # 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] | 3052 | # 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] | 3053 | requires_openssl_next |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3054 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 3055 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3056 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 3057 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3058 | rm -f $SESSION )" \ |
| 3059 | 0 \ |
| 3060 | -s "found session ticket extension" \ |
| 3061 | -s "server hello, adding session ticket extension" \ |
| 3062 | -S "session successfully restored from cache" \ |
| 3063 | -s "session successfully restored from ticket" \ |
| 3064 | -s "a session has been resumed" |
| 3065 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3066 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3067 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3068 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3069 | "$P_SRV debug_level=3 tickets=0" \ |
| 3070 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3071 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3072 | -c "client hello, adding session ticket extension" \ |
| 3073 | -s "found session ticket extension" \ |
| 3074 | -S "server hello, adding session ticket extension" \ |
| 3075 | -C "found session_ticket extension" \ |
| 3076 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3077 | -s "session successfully restored from cache" \ |
| 3078 | -S "session successfully restored from ticket" \ |
| 3079 | -s "a session has been resumed" \ |
| 3080 | -c "a session has been resumed" |
| 3081 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3082 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3083 | "$P_SRV debug_level=3 tickets=1" \ |
| 3084 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3085 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3086 | -C "client hello, adding session ticket extension" \ |
| 3087 | -S "found session ticket extension" \ |
| 3088 | -S "server hello, adding session ticket extension" \ |
| 3089 | -C "found session_ticket extension" \ |
| 3090 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3091 | -s "session successfully restored from cache" \ |
| 3092 | -S "session successfully restored from ticket" \ |
| 3093 | -s "a session has been resumed" \ |
| 3094 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3095 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3096 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3097 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 3098 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3099 | 0 \ |
| 3100 | -S "session successfully restored from cache" \ |
| 3101 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3102 | -S "a session has been resumed" \ |
| 3103 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3104 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3105 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3106 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 3107 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3108 | 0 \ |
| 3109 | -s "session successfully restored from cache" \ |
| 3110 | -S "session successfully restored from ticket" \ |
| 3111 | -s "a session has been resumed" \ |
| 3112 | -c "a session has been resumed" |
| 3113 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 3114 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3115 | "$P_SRV debug_level=3 tickets=0" \ |
| 3116 | "$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] | 3117 | 0 \ |
| 3118 | -s "session successfully restored from cache" \ |
| 3119 | -S "session successfully restored from ticket" \ |
| 3120 | -s "a session has been resumed" \ |
| 3121 | -c "a session has been resumed" |
| 3122 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3123 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3124 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 3125 | "$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] | 3126 | 0 \ |
| 3127 | -S "session successfully restored from cache" \ |
| 3128 | -S "session successfully restored from ticket" \ |
| 3129 | -S "a session has been resumed" \ |
| 3130 | -C "a session has been resumed" |
| 3131 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3132 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3133 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 3134 | "$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] | 3135 | 0 \ |
| 3136 | -s "session successfully restored from cache" \ |
| 3137 | -S "session successfully restored from ticket" \ |
| 3138 | -s "a session has been resumed" \ |
| 3139 | -c "a session has been resumed" |
| 3140 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3141 | run_test "Session resume using cache: session copy" \ |
| 3142 | "$P_SRV debug_level=3 tickets=0" \ |
| 3143 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 3144 | 0 \ |
| 3145 | -s "session successfully restored from cache" \ |
| 3146 | -S "session successfully restored from ticket" \ |
| 3147 | -s "a session has been resumed" \ |
| 3148 | -c "a session has been resumed" |
| 3149 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3150 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3151 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3152 | "( $O_CLI -sess_out $SESSION; \ |
| 3153 | $O_CLI -sess_in $SESSION; \ |
| 3154 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 3155 | 0 \ |
| 3156 | -s "found session ticket extension" \ |
| 3157 | -S "server hello, adding session ticket extension" \ |
| 3158 | -s "session successfully restored from cache" \ |
| 3159 | -S "session successfully restored from ticket" \ |
| 3160 | -s "a session has been resumed" |
| 3161 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3162 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 3163 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3164 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 3165 | 0 \ |
| 3166 | -C "found session_ticket extension" \ |
| 3167 | -C "parse new session ticket" \ |
| 3168 | -c "a session has been resumed" |
| 3169 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3170 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 3171 | |
| 3172 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 3173 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3174 | "$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] | 3175 | 0 \ |
| 3176 | -c "client hello, adding session ticket extension" \ |
| 3177 | -s "found session ticket extension" \ |
| 3178 | -S "server hello, adding session ticket extension" \ |
| 3179 | -C "found session_ticket extension" \ |
| 3180 | -C "parse new session ticket" \ |
| 3181 | -s "session successfully restored from cache" \ |
| 3182 | -S "session successfully restored from ticket" \ |
| 3183 | -s "a session has been resumed" \ |
| 3184 | -c "a session has been resumed" |
| 3185 | |
| 3186 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 3187 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3188 | "$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] | 3189 | 0 \ |
| 3190 | -C "client hello, adding session ticket extension" \ |
| 3191 | -S "found session ticket extension" \ |
| 3192 | -S "server hello, adding session ticket extension" \ |
| 3193 | -C "found session_ticket extension" \ |
| 3194 | -C "parse new session ticket" \ |
| 3195 | -s "session successfully restored from cache" \ |
| 3196 | -S "session successfully restored from ticket" \ |
| 3197 | -s "a session has been resumed" \ |
| 3198 | -c "a session has been resumed" |
| 3199 | |
| 3200 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 3201 | "$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] | 3202 | "$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] | 3203 | 0 \ |
| 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 | |
| 3209 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 3210 | "$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] | 3211 | "$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] | 3212 | 0 \ |
| 3213 | -s "session successfully restored from cache" \ |
| 3214 | -S "session successfully restored from ticket" \ |
| 3215 | -s "a session has been resumed" \ |
| 3216 | -c "a session has been resumed" |
| 3217 | |
| 3218 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 3219 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3220 | "$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] | 3221 | 0 \ |
| 3222 | -s "session successfully restored from cache" \ |
| 3223 | -S "session successfully restored from ticket" \ |
| 3224 | -s "a session has been resumed" \ |
| 3225 | -c "a session has been resumed" |
| 3226 | |
| 3227 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 3228 | "$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] | 3229 | "$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] | 3230 | 0 \ |
| 3231 | -S "session successfully restored from cache" \ |
| 3232 | -S "session successfully restored from ticket" \ |
| 3233 | -S "a session has been resumed" \ |
| 3234 | -C "a session has been resumed" |
| 3235 | |
| 3236 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 3237 | "$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] | 3238 | "$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] | 3239 | 0 \ |
| 3240 | -s "session successfully restored from cache" \ |
| 3241 | -S "session successfully restored from ticket" \ |
| 3242 | -s "a session has been resumed" \ |
| 3243 | -c "a session has been resumed" |
| 3244 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3245 | run_test "Session resume using cache, DTLS: session copy" \ |
| 3246 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3247 | "$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] | 3248 | 0 \ |
| 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 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3254 | # 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] | 3255 | # 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] | 3256 | requires_openssl_next |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3257 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 3258 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3259 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 3260 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3261 | rm -f $SESSION )" \ |
| 3262 | 0 \ |
| 3263 | -s "found session ticket extension" \ |
| 3264 | -S "server hello, adding session ticket extension" \ |
| 3265 | -s "session successfully restored from cache" \ |
| 3266 | -S "session successfully restored from ticket" \ |
| 3267 | -s "a session has been resumed" |
| 3268 | |
| 3269 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 3270 | "$O_SRV -dtls" \ |
| 3271 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 3272 | 0 \ |
| 3273 | -C "found session_ticket extension" \ |
| 3274 | -C "parse new session ticket" \ |
| 3275 | -c "a session has been resumed" |
| 3276 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3277 | # Tests for Max Fragment Length extension |
| 3278 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3279 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3280 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3281 | "$P_SRV debug_level=3" \ |
| 3282 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3283 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3284 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3285 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3286 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3287 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3288 | -C "client hello, adding max_fragment_length extension" \ |
| 3289 | -S "found max fragment length extension" \ |
| 3290 | -S "server hello, max_fragment_length extension" \ |
| 3291 | -C "found max_fragment_length extension" |
| 3292 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3293 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3294 | run_test "Max fragment length: enabled, default, larger message" \ |
| 3295 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3296 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3297 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3298 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3299 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3300 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3301 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3302 | -C "client hello, adding max_fragment_length extension" \ |
| 3303 | -S "found max fragment length extension" \ |
| 3304 | -S "server hello, max_fragment_length extension" \ |
| 3305 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3306 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3307 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3308 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3309 | |
| 3310 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3311 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 3312 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3313 | "$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] | 3314 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3315 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3316 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3317 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3318 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3319 | -C "client hello, adding max_fragment_length extension" \ |
| 3320 | -S "found max fragment length extension" \ |
| 3321 | -S "server hello, max_fragment_length extension" \ |
| 3322 | -C "found max_fragment_length extension" \ |
| 3323 | -c "fragment larger than.*maximum " |
| 3324 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3325 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 3326 | # (session fragment length will be 16384 regardless of mbedtls |
| 3327 | # content length configuration.) |
| 3328 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3329 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3330 | run_test "Max fragment length: disabled, larger message" \ |
| 3331 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3332 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3333 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3334 | -C "Maximum incoming record payload length is 16384" \ |
| 3335 | -C "Maximum outgoing record payload length is 16384" \ |
| 3336 | -S "Maximum incoming record payload length is 16384" \ |
| 3337 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3338 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3339 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3340 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3341 | |
| 3342 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 3343 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3344 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3345 | "$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] | 3346 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3347 | -C "Maximum incoming record payload length is 16384" \ |
| 3348 | -C "Maximum outgoing record payload length is 16384" \ |
| 3349 | -S "Maximum incoming record payload length is 16384" \ |
| 3350 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3351 | -c "fragment larger than.*maximum " |
| 3352 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3353 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3354 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3355 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3356 | "$P_SRV debug_level=3" \ |
| 3357 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3358 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3359 | -c "Maximum incoming record payload length is 4096" \ |
| 3360 | -c "Maximum outgoing record payload length is 4096" \ |
| 3361 | -s "Maximum incoming record payload length is 4096" \ |
| 3362 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3363 | -c "client hello, adding max_fragment_length extension" \ |
| 3364 | -s "found max fragment length extension" \ |
| 3365 | -s "server hello, max_fragment_length extension" \ |
| 3366 | -c "found max_fragment_length extension" |
| 3367 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3368 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3369 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3370 | run_test "Max fragment length: client 512, server 1024" \ |
| 3371 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3372 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3373 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3374 | -c "Maximum incoming record payload length is 512" \ |
| 3375 | -c "Maximum outgoing record payload length is 512" \ |
| 3376 | -s "Maximum incoming record payload length is 512" \ |
| 3377 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3378 | -c "client hello, adding max_fragment_length extension" \ |
| 3379 | -s "found max fragment length extension" \ |
| 3380 | -s "server hello, max_fragment_length extension" \ |
| 3381 | -c "found max_fragment_length extension" |
| 3382 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3383 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3384 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3385 | run_test "Max fragment length: client 512, server 2048" \ |
| 3386 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3387 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3388 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3389 | -c "Maximum incoming record payload length is 512" \ |
| 3390 | -c "Maximum outgoing record payload length is 512" \ |
| 3391 | -s "Maximum incoming record payload length is 512" \ |
| 3392 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3393 | -c "client hello, adding max_fragment_length extension" \ |
| 3394 | -s "found max fragment length extension" \ |
| 3395 | -s "server hello, max_fragment_length extension" \ |
| 3396 | -c "found max_fragment_length extension" |
| 3397 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3398 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3399 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3400 | run_test "Max fragment length: client 512, server 4096" \ |
| 3401 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3402 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3403 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3404 | -c "Maximum incoming record payload length is 512" \ |
| 3405 | -c "Maximum outgoing record payload length is 512" \ |
| 3406 | -s "Maximum incoming record payload length is 512" \ |
| 3407 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3408 | -c "client hello, adding max_fragment_length extension" \ |
| 3409 | -s "found max fragment length extension" \ |
| 3410 | -s "server hello, max_fragment_length extension" \ |
| 3411 | -c "found max_fragment_length extension" |
| 3412 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3413 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3414 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3415 | run_test "Max fragment length: client 1024, server 512" \ |
| 3416 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3417 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3418 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3419 | -c "Maximum incoming record payload length is 1024" \ |
| 3420 | -c "Maximum outgoing record payload length is 1024" \ |
| 3421 | -s "Maximum incoming record payload length is 1024" \ |
| 3422 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3423 | -c "client hello, adding max_fragment_length extension" \ |
| 3424 | -s "found max fragment length extension" \ |
| 3425 | -s "server hello, max_fragment_length extension" \ |
| 3426 | -c "found max_fragment_length extension" |
| 3427 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3428 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3429 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3430 | run_test "Max fragment length: client 1024, server 2048" \ |
| 3431 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3432 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3433 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3434 | -c "Maximum incoming record payload length is 1024" \ |
| 3435 | -c "Maximum outgoing record payload length is 1024" \ |
| 3436 | -s "Maximum incoming record payload length is 1024" \ |
| 3437 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3438 | -c "client hello, adding max_fragment_length extension" \ |
| 3439 | -s "found max fragment length extension" \ |
| 3440 | -s "server hello, max_fragment_length extension" \ |
| 3441 | -c "found max_fragment_length extension" |
| 3442 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3443 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3444 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3445 | run_test "Max fragment length: client 1024, server 4096" \ |
| 3446 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3447 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3448 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3449 | -c "Maximum incoming record payload length is 1024" \ |
| 3450 | -c "Maximum outgoing record payload length is 1024" \ |
| 3451 | -s "Maximum incoming record payload length is 1024" \ |
| 3452 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3453 | -c "client hello, adding max_fragment_length extension" \ |
| 3454 | -s "found max fragment length extension" \ |
| 3455 | -s "server hello, max_fragment_length extension" \ |
| 3456 | -c "found max_fragment_length extension" |
| 3457 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3458 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3459 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3460 | run_test "Max fragment length: client 2048, server 512" \ |
| 3461 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3462 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3463 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3464 | -c "Maximum incoming record payload length is 2048" \ |
| 3465 | -c "Maximum outgoing record payload length is 2048" \ |
| 3466 | -s "Maximum incoming record payload length is 2048" \ |
| 3467 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3468 | -c "client hello, adding max_fragment_length extension" \ |
| 3469 | -s "found max fragment length extension" \ |
| 3470 | -s "server hello, max_fragment_length extension" \ |
| 3471 | -c "found max_fragment_length extension" |
| 3472 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3473 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3474 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3475 | run_test "Max fragment length: client 2048, server 1024" \ |
| 3476 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3477 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3478 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3479 | -c "Maximum incoming record payload length is 2048" \ |
| 3480 | -c "Maximum outgoing record payload length is 2048" \ |
| 3481 | -s "Maximum incoming record payload length is 2048" \ |
| 3482 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3483 | -c "client hello, adding max_fragment_length extension" \ |
| 3484 | -s "found max fragment length extension" \ |
| 3485 | -s "server hello, max_fragment_length extension" \ |
| 3486 | -c "found max_fragment_length extension" |
| 3487 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3488 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3489 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3490 | run_test "Max fragment length: client 2048, server 4096" \ |
| 3491 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3492 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3493 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3494 | -c "Maximum incoming record payload length is 2048" \ |
| 3495 | -c "Maximum outgoing record payload length is 2048" \ |
| 3496 | -s "Maximum incoming record payload length is 2048" \ |
| 3497 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3498 | -c "client hello, adding max_fragment_length extension" \ |
| 3499 | -s "found max fragment length extension" \ |
| 3500 | -s "server hello, max_fragment_length extension" \ |
| 3501 | -c "found max_fragment_length extension" |
| 3502 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3503 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3504 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3505 | run_test "Max fragment length: client 4096, server 512" \ |
| 3506 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3507 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3508 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3509 | -c "Maximum incoming record payload length is 4096" \ |
| 3510 | -c "Maximum outgoing record payload length is 4096" \ |
| 3511 | -s "Maximum incoming record payload length is 4096" \ |
| 3512 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3513 | -c "client hello, adding max_fragment_length extension" \ |
| 3514 | -s "found max fragment length extension" \ |
| 3515 | -s "server hello, max_fragment_length extension" \ |
| 3516 | -c "found max_fragment_length extension" |
| 3517 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3518 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3519 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3520 | run_test "Max fragment length: client 4096, server 1024" \ |
| 3521 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3522 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3523 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3524 | -c "Maximum incoming record payload length is 4096" \ |
| 3525 | -c "Maximum outgoing record payload length is 4096" \ |
| 3526 | -s "Maximum incoming record payload length is 4096" \ |
| 3527 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3528 | -c "client hello, adding max_fragment_length extension" \ |
| 3529 | -s "found max fragment length extension" \ |
| 3530 | -s "server hello, max_fragment_length extension" \ |
| 3531 | -c "found max_fragment_length extension" |
| 3532 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3533 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3534 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3535 | run_test "Max fragment length: client 4096, server 2048" \ |
| 3536 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3537 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3538 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3539 | -c "Maximum incoming record payload length is 4096" \ |
| 3540 | -c "Maximum outgoing record payload length is 4096" \ |
| 3541 | -s "Maximum incoming record payload length is 4096" \ |
| 3542 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3543 | -c "client hello, adding max_fragment_length extension" \ |
| 3544 | -s "found max fragment length extension" \ |
| 3545 | -s "server hello, max_fragment_length extension" \ |
| 3546 | -c "found max_fragment_length extension" |
| 3547 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3548 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3549 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3550 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3551 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3552 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3553 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3554 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3555 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3556 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3557 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3558 | -C "client hello, adding max_fragment_length extension" \ |
| 3559 | -S "found max fragment length extension" \ |
| 3560 | -S "server hello, max_fragment_length extension" \ |
| 3561 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3562 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3563 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3564 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3565 | requires_gnutls |
| 3566 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3567 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3568 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3569 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3570 | -c "Maximum incoming record payload length is 4096" \ |
| 3571 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3572 | -c "client hello, adding max_fragment_length extension" \ |
| 3573 | -c "found max_fragment_length extension" |
| 3574 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3575 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3576 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3577 | run_test "Max fragment length: client, message just fits" \ |
| 3578 | "$P_SRV debug_level=3" \ |
| 3579 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 3580 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3581 | -c "Maximum incoming record payload length is 2048" \ |
| 3582 | -c "Maximum outgoing record payload length is 2048" \ |
| 3583 | -s "Maximum incoming record payload length is 2048" \ |
| 3584 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3585 | -c "client hello, adding max_fragment_length extension" \ |
| 3586 | -s "found max fragment length extension" \ |
| 3587 | -s "server hello, max_fragment_length extension" \ |
| 3588 | -c "found max_fragment_length extension" \ |
| 3589 | -c "2048 bytes written in 1 fragments" \ |
| 3590 | -s "2048 bytes read" |
| 3591 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3592 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3593 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3594 | run_test "Max fragment length: client, larger message" \ |
| 3595 | "$P_SRV debug_level=3" \ |
| 3596 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 3597 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3598 | -c "Maximum incoming record payload length is 2048" \ |
| 3599 | -c "Maximum outgoing record payload length is 2048" \ |
| 3600 | -s "Maximum incoming record payload length is 2048" \ |
| 3601 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3602 | -c "client hello, adding max_fragment_length extension" \ |
| 3603 | -s "found max fragment length extension" \ |
| 3604 | -s "server hello, max_fragment_length extension" \ |
| 3605 | -c "found max_fragment_length extension" \ |
| 3606 | -c "2345 bytes written in 2 fragments" \ |
| 3607 | -s "2048 bytes read" \ |
| 3608 | -s "297 bytes read" |
| 3609 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3610 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3611 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 3612 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3613 | "$P_SRV debug_level=3 dtls=1" \ |
| 3614 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 3615 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3616 | -c "Maximum incoming record payload length is 2048" \ |
| 3617 | -c "Maximum outgoing record payload length is 2048" \ |
| 3618 | -s "Maximum incoming record payload length is 2048" \ |
| 3619 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [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" \ |
| 3624 | -c "fragment larger than.*maximum" |
| 3625 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3626 | # Tests for renegotiation |
| 3627 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3628 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3629 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3630 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3631 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3632 | 0 \ |
| 3633 | -C "client hello, adding renegotiation extension" \ |
| 3634 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3635 | -S "found renegotiation extension" \ |
| 3636 | -s "server hello, secure renegotiation extension" \ |
| 3637 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3638 | -C "=> renegotiate" \ |
| 3639 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3640 | -S "write hello request" |
| 3641 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3642 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3643 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3644 | "$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] | 3645 | "$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] | 3646 | 0 \ |
| 3647 | -c "client hello, adding renegotiation extension" \ |
| 3648 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3649 | -s "found renegotiation extension" \ |
| 3650 | -s "server hello, secure renegotiation extension" \ |
| 3651 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3652 | -c "=> renegotiate" \ |
| 3653 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3654 | -S "write hello request" |
| 3655 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3656 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3657 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3658 | "$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] | 3659 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3660 | 0 \ |
| 3661 | -c "client hello, adding renegotiation extension" \ |
| 3662 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3663 | -s "found renegotiation extension" \ |
| 3664 | -s "server hello, secure renegotiation extension" \ |
| 3665 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3666 | -c "=> renegotiate" \ |
| 3667 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3668 | -s "write hello request" |
| 3669 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3670 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3671 | # 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] | 3672 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3673 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3674 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 3675 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 3676 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3677 | 0 \ |
| 3678 | -c "client hello, adding renegotiation extension" \ |
| 3679 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3680 | -s "found renegotiation extension" \ |
| 3681 | -s "server hello, secure renegotiation extension" \ |
| 3682 | -c "found renegotiation extension" \ |
| 3683 | -c "=> renegotiate" \ |
| 3684 | -s "=> renegotiate" \ |
| 3685 | -S "write hello request" \ |
| 3686 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3687 | |
| 3688 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3689 | # 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] | 3690 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3691 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3692 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 3693 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 3694 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3695 | 0 \ |
| 3696 | -c "client hello, adding renegotiation extension" \ |
| 3697 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3698 | -s "found renegotiation extension" \ |
| 3699 | -s "server hello, secure renegotiation extension" \ |
| 3700 | -c "found renegotiation extension" \ |
| 3701 | -c "=> renegotiate" \ |
| 3702 | -s "=> renegotiate" \ |
| 3703 | -s "write hello request" \ |
| 3704 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3705 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3706 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3707 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3708 | "$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] | 3709 | "$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] | 3710 | 0 \ |
| 3711 | -c "client hello, adding renegotiation extension" \ |
| 3712 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3713 | -s "found renegotiation extension" \ |
| 3714 | -s "server hello, secure renegotiation extension" \ |
| 3715 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3716 | -c "=> renegotiate" \ |
| 3717 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3718 | -s "write hello request" |
| 3719 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3720 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3721 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3722 | requires_max_content_len 2048 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3723 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 3724 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 3725 | "$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" \ |
| 3726 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3727 | -c "Maximum incoming record payload length is 2048" \ |
| 3728 | -c "Maximum outgoing record payload length is 2048" \ |
| 3729 | -s "Maximum incoming record payload length is 2048" \ |
| 3730 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3731 | -c "client hello, adding max_fragment_length extension" \ |
| 3732 | -s "found max fragment length extension" \ |
| 3733 | -s "server hello, max_fragment_length extension" \ |
| 3734 | -c "found max_fragment_length extension" \ |
| 3735 | -c "client hello, adding renegotiation extension" \ |
| 3736 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3737 | -s "found renegotiation extension" \ |
| 3738 | -s "server hello, secure renegotiation extension" \ |
| 3739 | -c "found renegotiation extension" \ |
| 3740 | -c "=> renegotiate" \ |
| 3741 | -s "=> renegotiate" \ |
| 3742 | -s "write hello request" |
| 3743 | |
| 3744 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3745 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3746 | "$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] | 3747 | "$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] | 3748 | 1 \ |
| 3749 | -c "client hello, adding renegotiation extension" \ |
| 3750 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3751 | -S "found renegotiation extension" \ |
| 3752 | -s "server hello, secure renegotiation extension" \ |
| 3753 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3754 | -c "=> renegotiate" \ |
| 3755 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3756 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 3757 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3758 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3759 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3760 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3761 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3762 | "$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] | 3763 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3764 | 0 \ |
| 3765 | -C "client hello, adding renegotiation extension" \ |
| 3766 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3767 | -S "found renegotiation extension" \ |
| 3768 | -s "server hello, secure renegotiation extension" \ |
| 3769 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3770 | -C "=> renegotiate" \ |
| 3771 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3772 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 3773 | -S "SSL - An unexpected message was received from our peer" \ |
| 3774 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3775 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3776 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3777 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3778 | "$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] | 3779 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3780 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3781 | 0 \ |
| 3782 | -C "client hello, adding renegotiation extension" \ |
| 3783 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3784 | -S "found renegotiation extension" \ |
| 3785 | -s "server hello, secure renegotiation extension" \ |
| 3786 | -c "found renegotiation extension" \ |
| 3787 | -C "=> renegotiate" \ |
| 3788 | -S "=> renegotiate" \ |
| 3789 | -s "write hello request" \ |
| 3790 | -S "SSL - An unexpected message was received from our peer" \ |
| 3791 | -S "failed" |
| 3792 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3793 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3794 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3795 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3796 | "$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] | 3797 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3798 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3799 | 0 \ |
| 3800 | -C "client hello, adding renegotiation extension" \ |
| 3801 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3802 | -S "found renegotiation extension" \ |
| 3803 | -s "server hello, secure renegotiation extension" \ |
| 3804 | -c "found renegotiation extension" \ |
| 3805 | -C "=> renegotiate" \ |
| 3806 | -S "=> renegotiate" \ |
| 3807 | -s "write hello request" \ |
| 3808 | -S "SSL - An unexpected message was received from our peer" \ |
| 3809 | -S "failed" |
| 3810 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3811 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3812 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3813 | "$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] | 3814 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3815 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3816 | 0 \ |
| 3817 | -C "client hello, adding renegotiation extension" \ |
| 3818 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3819 | -S "found renegotiation extension" \ |
| 3820 | -s "server hello, secure renegotiation extension" \ |
| 3821 | -c "found renegotiation extension" \ |
| 3822 | -C "=> renegotiate" \ |
| 3823 | -S "=> renegotiate" \ |
| 3824 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3825 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3826 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3827 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3828 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3829 | "$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] | 3830 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3831 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3832 | 0 \ |
| 3833 | -c "client hello, adding renegotiation extension" \ |
| 3834 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3835 | -s "found renegotiation extension" \ |
| 3836 | -s "server hello, secure renegotiation extension" \ |
| 3837 | -c "found renegotiation extension" \ |
| 3838 | -c "=> renegotiate" \ |
| 3839 | -s "=> renegotiate" \ |
| 3840 | -s "write hello request" \ |
| 3841 | -S "SSL - An unexpected message was received from our peer" \ |
| 3842 | -S "failed" |
| 3843 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3844 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3845 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3846 | "$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] | 3847 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3848 | 0 \ |
| 3849 | -C "client hello, adding renegotiation extension" \ |
| 3850 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3851 | -S "found renegotiation extension" \ |
| 3852 | -s "server hello, secure renegotiation extension" \ |
| 3853 | -c "found renegotiation extension" \ |
| 3854 | -S "record counter limit reached: renegotiate" \ |
| 3855 | -C "=> renegotiate" \ |
| 3856 | -S "=> renegotiate" \ |
| 3857 | -S "write hello request" \ |
| 3858 | -S "SSL - An unexpected message was received from our peer" \ |
| 3859 | -S "failed" |
| 3860 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 3861 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3862 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3863 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3864 | "$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] | 3865 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3866 | 0 \ |
| 3867 | -c "client hello, adding renegotiation extension" \ |
| 3868 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3869 | -s "found renegotiation extension" \ |
| 3870 | -s "server hello, secure renegotiation extension" \ |
| 3871 | -c "found renegotiation extension" \ |
| 3872 | -s "record counter limit reached: renegotiate" \ |
| 3873 | -c "=> renegotiate" \ |
| 3874 | -s "=> renegotiate" \ |
| 3875 | -s "write hello request" \ |
| 3876 | -S "SSL - An unexpected message was received from our peer" \ |
| 3877 | -S "failed" |
| 3878 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3879 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3880 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3881 | "$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] | 3882 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3883 | 0 \ |
| 3884 | -c "client hello, adding renegotiation extension" \ |
| 3885 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3886 | -s "found renegotiation extension" \ |
| 3887 | -s "server hello, secure renegotiation extension" \ |
| 3888 | -c "found renegotiation extension" \ |
| 3889 | -s "record counter limit reached: renegotiate" \ |
| 3890 | -c "=> renegotiate" \ |
| 3891 | -s "=> renegotiate" \ |
| 3892 | -s "write hello request" \ |
| 3893 | -S "SSL - An unexpected message was received from our peer" \ |
| 3894 | -S "failed" |
| 3895 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3896 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3897 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3898 | "$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] | 3899 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 3900 | 0 \ |
| 3901 | -C "client hello, adding renegotiation extension" \ |
| 3902 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3903 | -S "found renegotiation extension" \ |
| 3904 | -s "server hello, secure renegotiation extension" \ |
| 3905 | -c "found renegotiation extension" \ |
| 3906 | -S "record counter limit reached: renegotiate" \ |
| 3907 | -C "=> renegotiate" \ |
| 3908 | -S "=> renegotiate" \ |
| 3909 | -S "write hello request" \ |
| 3910 | -S "SSL - An unexpected message was received from our peer" \ |
| 3911 | -S "failed" |
| 3912 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3913 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3914 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3915 | "$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] | 3916 | "$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] | 3917 | 0 \ |
| 3918 | -c "client hello, adding renegotiation extension" \ |
| 3919 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3920 | -s "found renegotiation extension" \ |
| 3921 | -s "server hello, secure renegotiation extension" \ |
| 3922 | -c "found renegotiation extension" \ |
| 3923 | -c "=> renegotiate" \ |
| 3924 | -s "=> renegotiate" \ |
| 3925 | -S "write hello request" |
| 3926 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3927 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3928 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3929 | "$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] | 3930 | "$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] | 3931 | 0 \ |
| 3932 | -c "client hello, adding renegotiation extension" \ |
| 3933 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3934 | -s "found renegotiation extension" \ |
| 3935 | -s "server hello, secure renegotiation extension" \ |
| 3936 | -c "found renegotiation extension" \ |
| 3937 | -c "=> renegotiate" \ |
| 3938 | -s "=> renegotiate" \ |
| 3939 | -s "write hello request" |
| 3940 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3941 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3942 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 3943 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3944 | "$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] | 3945 | 0 \ |
| 3946 | -c "client hello, adding renegotiation extension" \ |
| 3947 | -c "found renegotiation extension" \ |
| 3948 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3949 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3950 | -C "error" \ |
| 3951 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3952 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3953 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3954 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3955 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 3956 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3957 | "$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] | 3958 | 0 \ |
| 3959 | -c "client hello, adding renegotiation extension" \ |
| 3960 | -c "found renegotiation extension" \ |
| 3961 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3962 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3963 | -C "error" \ |
| 3964 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3965 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3966 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3967 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3968 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 3969 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3970 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3971 | 1 \ |
| 3972 | -c "client hello, adding renegotiation extension" \ |
| 3973 | -C "found renegotiation extension" \ |
| 3974 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3975 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3976 | -c "error" \ |
| 3977 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3978 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3979 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3980 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3981 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 3982 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3983 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3984 | allow_legacy=0" \ |
| 3985 | 1 \ |
| 3986 | -c "client hello, adding renegotiation extension" \ |
| 3987 | -C "found renegotiation extension" \ |
| 3988 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3989 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3990 | -c "error" \ |
| 3991 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3992 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3993 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3994 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3995 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 3996 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3997 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3998 | allow_legacy=1" \ |
| 3999 | 0 \ |
| 4000 | -c "client hello, adding renegotiation extension" \ |
| 4001 | -C "found renegotiation extension" \ |
| 4002 | -c "=> renegotiate" \ |
| 4003 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4004 | -C "error" \ |
| 4005 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4006 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4007 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 4008 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 4009 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 4010 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4011 | 0 \ |
| 4012 | -c "client hello, adding renegotiation extension" \ |
| 4013 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4014 | -s "found renegotiation extension" \ |
| 4015 | -s "server hello, secure renegotiation extension" \ |
| 4016 | -c "found renegotiation extension" \ |
| 4017 | -c "=> renegotiate" \ |
| 4018 | -s "=> renegotiate" \ |
| 4019 | -S "write hello request" |
| 4020 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4021 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 4022 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 4023 | "$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] | 4024 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 4025 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 4026 | 0 \ |
| 4027 | -c "client hello, adding renegotiation extension" \ |
| 4028 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4029 | -s "found renegotiation extension" \ |
| 4030 | -s "server hello, secure renegotiation extension" \ |
| 4031 | -c "found renegotiation extension" \ |
| 4032 | -c "=> renegotiate" \ |
| 4033 | -s "=> renegotiate" \ |
| 4034 | -s "write hello request" |
| 4035 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4036 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 4037 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 4038 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 4039 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 4040 | 0 \ |
| 4041 | -c "client hello, adding renegotiation extension" \ |
| 4042 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4043 | -s "found renegotiation extension" \ |
| 4044 | -s "server hello, secure renegotiation extension" \ |
| 4045 | -s "record counter limit reached: renegotiate" \ |
| 4046 | -c "=> renegotiate" \ |
| 4047 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4048 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 4049 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 4050 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4051 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 4052 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 4053 | "$G_SRV -u --mtu 4096" \ |
| 4054 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 4055 | 0 \ |
| 4056 | -c "client hello, adding renegotiation extension" \ |
| 4057 | -c "found renegotiation extension" \ |
| 4058 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4059 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 4060 | -C "error" \ |
| 4061 | -s "Extra-header:" |
| 4062 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4063 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 4064 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4065 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4066 | run_test "Renego ext: gnutls server strict, client default" \ |
| 4067 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 4068 | "$P_CLI debug_level=3" \ |
| 4069 | 0 \ |
| 4070 | -c "found renegotiation extension" \ |
| 4071 | -C "error" \ |
| 4072 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4073 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4074 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4075 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 4076 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4077 | "$P_CLI debug_level=3" \ |
| 4078 | 0 \ |
| 4079 | -C "found renegotiation extension" \ |
| 4080 | -C "error" \ |
| 4081 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4082 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4083 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4084 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 4085 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4086 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 4087 | 1 \ |
| 4088 | -C "found renegotiation extension" \ |
| 4089 | -c "error" \ |
| 4090 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4091 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4092 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4093 | run_test "Renego ext: gnutls client strict, server default" \ |
| 4094 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4095 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4096 | 0 \ |
| 4097 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4098 | -s "server hello, secure renegotiation extension" |
| 4099 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4100 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4101 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 4102 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4103 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4104 | 0 \ |
| 4105 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4106 | -S "server hello, secure renegotiation extension" |
| 4107 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4108 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4109 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 4110 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4111 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4112 | 1 \ |
| 4113 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4114 | -S "server hello, secure renegotiation extension" |
| 4115 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4116 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 4117 | |
| 4118 | requires_gnutls |
| 4119 | run_test "DER format: no trailing bytes" \ |
| 4120 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 4121 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4122 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4123 | 0 \ |
| 4124 | -c "Handshake was completed" \ |
| 4125 | |
| 4126 | requires_gnutls |
| 4127 | run_test "DER format: with a trailing zero byte" \ |
| 4128 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 4129 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4130 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4131 | 0 \ |
| 4132 | -c "Handshake was completed" \ |
| 4133 | |
| 4134 | requires_gnutls |
| 4135 | run_test "DER format: with a trailing random byte" \ |
| 4136 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 4137 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4138 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4139 | 0 \ |
| 4140 | -c "Handshake was completed" \ |
| 4141 | |
| 4142 | requires_gnutls |
| 4143 | run_test "DER format: with 2 trailing random bytes" \ |
| 4144 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 4145 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4146 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4147 | 0 \ |
| 4148 | -c "Handshake was completed" \ |
| 4149 | |
| 4150 | requires_gnutls |
| 4151 | run_test "DER format: with 4 trailing random bytes" \ |
| 4152 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 4153 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4154 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4155 | 0 \ |
| 4156 | -c "Handshake was completed" \ |
| 4157 | |
| 4158 | requires_gnutls |
| 4159 | run_test "DER format: with 8 trailing random bytes" \ |
| 4160 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 4161 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4162 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4163 | 0 \ |
| 4164 | -c "Handshake was completed" \ |
| 4165 | |
| 4166 | requires_gnutls |
| 4167 | run_test "DER format: with 9 trailing random bytes" \ |
| 4168 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 4169 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4170 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4171 | 0 \ |
| 4172 | -c "Handshake was completed" \ |
| 4173 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4174 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 4175 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4176 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4177 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4178 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4179 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4180 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4181 | 1 \ |
| 4182 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4183 | -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] | 4184 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4185 | -c "X509 - Certificate verification failed" |
| 4186 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4187 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4188 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4189 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4190 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4191 | 0 \ |
| 4192 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4193 | -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] | 4194 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4195 | -C "X509 - Certificate verification failed" |
| 4196 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 4197 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 4198 | "$P_SRV" \ |
| 4199 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 4200 | 0 \ |
| 4201 | -c "x509_verify_cert() returned" \ |
| 4202 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4203 | -c "! Certificate verification flags"\ |
| 4204 | -C "! mbedtls_ssl_handshake returned" \ |
| 4205 | -C "X509 - Certificate verification failed" \ |
| 4206 | -C "SSL - No CA Chain is set, but required to operate" |
| 4207 | |
| 4208 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 4209 | "$P_SRV" \ |
| 4210 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 4211 | 1 \ |
| 4212 | -c "x509_verify_cert() returned" \ |
| 4213 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4214 | -c "! Certificate verification flags"\ |
| 4215 | -c "! mbedtls_ssl_handshake returned" \ |
| 4216 | -c "SSL - No CA Chain is set, but required to operate" |
| 4217 | |
| 4218 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4219 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4220 | # the client informs the server about the supported curves - it does, though, in the |
| 4221 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4222 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4223 | # different means to have the server ignoring the client's supported curve list. |
| 4224 | |
| 4225 | requires_config_enabled MBEDTLS_ECP_C |
| 4226 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4227 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4228 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4229 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4230 | 1 \ |
| 4231 | -c "bad certificate (EC key curve)"\ |
| 4232 | -c "! Certificate verification flags"\ |
| 4233 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4234 | |
| 4235 | requires_config_enabled MBEDTLS_ECP_C |
| 4236 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4237 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4238 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4239 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4240 | 1 \ |
| 4241 | -c "bad certificate (EC key curve)"\ |
| 4242 | -c "! Certificate verification flags"\ |
| 4243 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4244 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4245 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 4246 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4247 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4248 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4249 | 0 \ |
| 4250 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4251 | -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] | 4252 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4253 | -C "X509 - Certificate verification failed" |
| 4254 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 4255 | run_test "Authentication: client SHA256, server required" \ |
| 4256 | "$P_SRV auth_mode=required" \ |
| 4257 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4258 | key_file=data_files/server6.key \ |
| 4259 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4260 | 0 \ |
| 4261 | -c "Supported Signature Algorithm found: 4," \ |
| 4262 | -c "Supported Signature Algorithm found: 5," |
| 4263 | |
| 4264 | run_test "Authentication: client SHA384, server required" \ |
| 4265 | "$P_SRV auth_mode=required" \ |
| 4266 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4267 | key_file=data_files/server6.key \ |
| 4268 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4269 | 0 \ |
| 4270 | -c "Supported Signature Algorithm found: 4," \ |
| 4271 | -c "Supported Signature Algorithm found: 5," |
| 4272 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4273 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 4274 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4275 | "$P_CLI debug_level=3 crt_file=none \ |
| 4276 | key_file=data_files/server5.key" \ |
| 4277 | 1 \ |
| 4278 | -S "skip write certificate request" \ |
| 4279 | -C "skip parse certificate request" \ |
| 4280 | -c "got a certificate request" \ |
| 4281 | -c "= write certificate$" \ |
| 4282 | -C "skip write certificate$" \ |
| 4283 | -S "x509_verify_cert() returned" \ |
| 4284 | -s "client has no certificate" \ |
| 4285 | -s "! mbedtls_ssl_handshake returned" \ |
| 4286 | -c "! mbedtls_ssl_handshake returned" \ |
| 4287 | -s "No client certification received from the client, but required by the authentication mode" |
| 4288 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4289 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4290 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4291 | "$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] | 4292 | key_file=data_files/server5.key" \ |
| 4293 | 1 \ |
| 4294 | -S "skip write certificate request" \ |
| 4295 | -C "skip parse certificate request" \ |
| 4296 | -c "got a certificate request" \ |
| 4297 | -C "skip write certificate" \ |
| 4298 | -C "skip write certificate verify" \ |
| 4299 | -S "skip parse certificate verify" \ |
| 4300 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4301 | -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] | 4302 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4303 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4304 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4305 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4306 | # We don't check that the client receives the alert because it might |
| 4307 | # detect that its write end of the connection is closed and abort |
| 4308 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4309 | |
Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 4310 | run_test "Authentication: client cert self-signed and trusted, server required" \ |
| 4311 | "$P_SRV debug_level=3 auth_mode=required ca_file=data_files/server5-selfsigned.crt" \ |
| 4312 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4313 | key_file=data_files/server5.key" \ |
| 4314 | 0 \ |
| 4315 | -S "skip write certificate request" \ |
| 4316 | -C "skip parse certificate request" \ |
| 4317 | -c "got a certificate request" \ |
| 4318 | -C "skip write certificate" \ |
| 4319 | -C "skip write certificate verify" \ |
| 4320 | -S "skip parse certificate verify" \ |
| 4321 | -S "x509_verify_cert() returned" \ |
| 4322 | -S "! The certificate is not correctly signed" \ |
| 4323 | -S "X509 - Certificate verification failed" |
| 4324 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4325 | run_test "Authentication: client cert not trusted, server required" \ |
| 4326 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4327 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4328 | key_file=data_files/server5.key" \ |
| 4329 | 1 \ |
| 4330 | -S "skip write certificate request" \ |
| 4331 | -C "skip parse certificate request" \ |
| 4332 | -c "got a certificate request" \ |
| 4333 | -C "skip write certificate" \ |
| 4334 | -C "skip write certificate verify" \ |
| 4335 | -S "skip parse certificate verify" \ |
| 4336 | -s "x509_verify_cert() returned" \ |
| 4337 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4338 | -s "! mbedtls_ssl_handshake returned" \ |
| 4339 | -c "! mbedtls_ssl_handshake returned" \ |
| 4340 | -s "X509 - Certificate verification failed" |
| 4341 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4342 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4343 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4344 | "$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] | 4345 | key_file=data_files/server5.key" \ |
| 4346 | 0 \ |
| 4347 | -S "skip write certificate request" \ |
| 4348 | -C "skip parse certificate request" \ |
| 4349 | -c "got a certificate request" \ |
| 4350 | -C "skip write certificate" \ |
| 4351 | -C "skip write certificate verify" \ |
| 4352 | -S "skip parse certificate verify" \ |
| 4353 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4354 | -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] | 4355 | -S "! mbedtls_ssl_handshake returned" \ |
| 4356 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4357 | -S "X509 - Certificate verification failed" |
| 4358 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4359 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4360 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 4361 | "$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] | 4362 | key_file=data_files/server5.key" \ |
| 4363 | 0 \ |
| 4364 | -s "skip write certificate request" \ |
| 4365 | -C "skip parse certificate request" \ |
| 4366 | -c "got no certificate request" \ |
| 4367 | -c "skip write certificate" \ |
| 4368 | -c "skip write certificate verify" \ |
| 4369 | -s "skip parse certificate verify" \ |
| 4370 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4371 | -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] | 4372 | -S "! mbedtls_ssl_handshake returned" \ |
| 4373 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4374 | -S "X509 - Certificate verification failed" |
| 4375 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4376 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4377 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4378 | "$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] | 4379 | 0 \ |
| 4380 | -S "skip write certificate request" \ |
| 4381 | -C "skip parse certificate request" \ |
| 4382 | -c "got a certificate request" \ |
| 4383 | -C "skip write certificate$" \ |
| 4384 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4385 | -c "skip write certificate verify" \ |
| 4386 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4387 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4388 | -S "! mbedtls_ssl_handshake returned" \ |
| 4389 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4390 | -S "X509 - Certificate verification failed" |
| 4391 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4392 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4393 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4394 | "$O_CLI" \ |
| 4395 | 0 \ |
| 4396 | -S "skip write certificate request" \ |
| 4397 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4398 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4399 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4400 | -S "X509 - Certificate verification failed" |
| 4401 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4402 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4403 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4404 | "$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] | 4405 | 0 \ |
| 4406 | -C "skip parse certificate request" \ |
| 4407 | -c "got a certificate request" \ |
| 4408 | -C "skip write certificate$" \ |
| 4409 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4410 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4411 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4412 | run_test "Authentication: client no cert, openssl server required" \ |
| 4413 | "$O_SRV -Verify 10" \ |
| 4414 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 4415 | 1 \ |
| 4416 | -C "skip parse certificate request" \ |
| 4417 | -c "got a certificate request" \ |
| 4418 | -C "skip write certificate$" \ |
| 4419 | -c "skip write certificate verify" \ |
| 4420 | -c "! mbedtls_ssl_handshake returned" |
| 4421 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4422 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 4423 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 4424 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4425 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4426 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4427 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4428 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 4429 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 4430 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 4431 | # 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] | 4432 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4433 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4434 | run_test "Authentication: server max_int chain, client default" \ |
| 4435 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4436 | key_file=data_files/dir-maxpath/09.key" \ |
| 4437 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4438 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4439 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4440 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4441 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4442 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4443 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 4444 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4445 | key_file=data_files/dir-maxpath/10.key" \ |
| 4446 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4447 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4448 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4449 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4450 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4451 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4452 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 4453 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4454 | key_file=data_files/dir-maxpath/10.key" \ |
| 4455 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4456 | auth_mode=optional" \ |
| 4457 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4458 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4459 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4460 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4461 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4462 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 4463 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4464 | key_file=data_files/dir-maxpath/10.key" \ |
| 4465 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4466 | auth_mode=none" \ |
| 4467 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4468 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4469 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4470 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4471 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4472 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 4473 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 4474 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4475 | key_file=data_files/dir-maxpath/10.key" \ |
| 4476 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4477 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4478 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4479 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4480 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4481 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 4482 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4483 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4484 | key_file=data_files/dir-maxpath/10.key" \ |
| 4485 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4486 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4487 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4488 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4489 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4490 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 4491 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4492 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4493 | key_file=data_files/dir-maxpath/10.key" \ |
| 4494 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4495 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4496 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4497 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4498 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4499 | run_test "Authentication: client max_int chain, server required" \ |
| 4500 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4501 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4502 | key_file=data_files/dir-maxpath/09.key" \ |
| 4503 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4504 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4505 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4506 | # Tests for CA list in CertificateRequest messages |
| 4507 | |
| 4508 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 4509 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4510 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4511 | key_file=data_files/server6.key" \ |
| 4512 | 0 \ |
| 4513 | -s "requested DN" |
| 4514 | |
| 4515 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 4516 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4517 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4518 | key_file=data_files/server6.key" \ |
| 4519 | 0 \ |
| 4520 | -S "requested DN" |
| 4521 | |
| 4522 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 4523 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4524 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4525 | key_file=data_files/server5.key" \ |
| 4526 | 1 \ |
| 4527 | -S "requested DN" \ |
| 4528 | -s "x509_verify_cert() returned" \ |
| 4529 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4530 | -s "! mbedtls_ssl_handshake returned" \ |
| 4531 | -c "! mbedtls_ssl_handshake returned" \ |
| 4532 | -s "X509 - Certificate verification failed" |
| 4533 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4534 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 4535 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4536 | |
| 4537 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4538 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 4539 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4540 | key_file=data_files/server5.key" \ |
| 4541 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4542 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4543 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4544 | -c "x509_verify_cert() returned" \ |
| 4545 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4546 | -c "! mbedtls_ssl_handshake returned" \ |
| 4547 | -c "X509 - Certificate verification failed" |
| 4548 | |
| 4549 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4550 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 4551 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4552 | key_file=data_files/server5.key" \ |
| 4553 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4554 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4555 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4556 | -c "x509_verify_cert() returned" \ |
| 4557 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4558 | -C "! mbedtls_ssl_handshake returned" \ |
| 4559 | -C "X509 - Certificate verification failed" |
| 4560 | |
| 4561 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4562 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4563 | # the client informs the server about the supported curves - it does, though, in the |
| 4564 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4565 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4566 | # different means to have the server ignoring the client's supported curve list. |
| 4567 | |
| 4568 | requires_config_enabled MBEDTLS_ECP_C |
| 4569 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4570 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4571 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4572 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4573 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4574 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4575 | -c "use CA callback for X.509 CRT verification" \ |
| 4576 | -c "bad certificate (EC key curve)" \ |
| 4577 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4578 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4579 | |
| 4580 | requires_config_enabled MBEDTLS_ECP_C |
| 4581 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4582 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4583 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4584 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4585 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4586 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4587 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4588 | -c "bad certificate (EC key curve)"\ |
| 4589 | -c "! Certificate verification flags"\ |
| 4590 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4591 | |
| 4592 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4593 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 4594 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4595 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4596 | key_file=data_files/server6.key \ |
| 4597 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4598 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4599 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4600 | -c "Supported Signature Algorithm found: 4," \ |
| 4601 | -c "Supported Signature Algorithm found: 5," |
| 4602 | |
| 4603 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4604 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 4605 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4606 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4607 | key_file=data_files/server6.key \ |
| 4608 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4609 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4610 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4611 | -c "Supported Signature Algorithm found: 4," \ |
| 4612 | -c "Supported Signature Algorithm found: 5," |
| 4613 | |
| 4614 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4615 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 4616 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4617 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4618 | key_file=data_files/server5.key" \ |
| 4619 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4620 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4621 | -S "skip write certificate request" \ |
| 4622 | -C "skip parse certificate request" \ |
| 4623 | -c "got a certificate request" \ |
| 4624 | -C "skip write certificate" \ |
| 4625 | -C "skip write certificate verify" \ |
| 4626 | -S "skip parse certificate verify" \ |
| 4627 | -s "x509_verify_cert() returned" \ |
| 4628 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4629 | -s "! mbedtls_ssl_handshake returned" \ |
| 4630 | -s "send alert level=2 message=48" \ |
| 4631 | -c "! mbedtls_ssl_handshake returned" \ |
| 4632 | -s "X509 - Certificate verification failed" |
| 4633 | # We don't check that the client receives the alert because it might |
| 4634 | # detect that its write end of the connection is closed and abort |
| 4635 | # before reading the alert message. |
| 4636 | |
| 4637 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4638 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 4639 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4640 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4641 | key_file=data_files/server5.key" \ |
| 4642 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4643 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4644 | -S "skip write certificate request" \ |
| 4645 | -C "skip parse certificate request" \ |
| 4646 | -c "got a certificate request" \ |
| 4647 | -C "skip write certificate" \ |
| 4648 | -C "skip write certificate verify" \ |
| 4649 | -S "skip parse certificate verify" \ |
| 4650 | -s "x509_verify_cert() returned" \ |
| 4651 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4652 | -s "! mbedtls_ssl_handshake returned" \ |
| 4653 | -c "! mbedtls_ssl_handshake returned" \ |
| 4654 | -s "X509 - Certificate verification failed" |
| 4655 | |
| 4656 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4657 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 4658 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4659 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4660 | key_file=data_files/server5.key" \ |
| 4661 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4662 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4663 | -S "skip write certificate request" \ |
| 4664 | -C "skip parse certificate request" \ |
| 4665 | -c "got a certificate request" \ |
| 4666 | -C "skip write certificate" \ |
| 4667 | -C "skip write certificate verify" \ |
| 4668 | -S "skip parse certificate verify" \ |
| 4669 | -s "x509_verify_cert() returned" \ |
| 4670 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4671 | -S "! mbedtls_ssl_handshake returned" \ |
| 4672 | -C "! mbedtls_ssl_handshake returned" \ |
| 4673 | -S "X509 - Certificate verification failed" |
| 4674 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4675 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4676 | requires_full_size_output_buffer |
| 4677 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4678 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 4679 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4680 | key_file=data_files/dir-maxpath/09.key" \ |
| 4681 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4682 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4683 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4684 | -C "X509 - A fatal error occurred" |
| 4685 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4686 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4687 | requires_full_size_output_buffer |
| 4688 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4689 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 4690 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4691 | key_file=data_files/dir-maxpath/10.key" \ |
| 4692 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4693 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4694 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4695 | -c "X509 - A fatal error occurred" |
| 4696 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4697 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4698 | requires_full_size_output_buffer |
| 4699 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4700 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 4701 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4702 | key_file=data_files/dir-maxpath/10.key" \ |
| 4703 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4704 | debug_level=3 auth_mode=optional" \ |
| 4705 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4706 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4707 | -c "X509 - A fatal error occurred" |
| 4708 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4709 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4710 | requires_full_size_output_buffer |
| 4711 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4712 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 4713 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4714 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4715 | key_file=data_files/dir-maxpath/10.key" \ |
| 4716 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4717 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4718 | -s "X509 - A fatal error occurred" |
| 4719 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4720 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4721 | requires_full_size_output_buffer |
| 4722 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4723 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 4724 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4725 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4726 | key_file=data_files/dir-maxpath/10.key" \ |
| 4727 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4728 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4729 | -s "X509 - A fatal error occurred" |
| 4730 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4731 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4732 | requires_full_size_output_buffer |
| 4733 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4734 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 4735 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4736 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4737 | key_file=data_files/dir-maxpath/09.key" \ |
| 4738 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4739 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4740 | -S "X509 - A fatal error occurred" |
| 4741 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4742 | # Tests for certificate selection based on SHA verson |
| 4743 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4744 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4745 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 4746 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4747 | key_file=data_files/server5.key \ |
| 4748 | crt_file2=data_files/server5-sha1.crt \ |
| 4749 | key_file2=data_files/server5.key" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 4750 | "$P_CLI force_version=tls12" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4751 | 0 \ |
| 4752 | -c "signed using.*ECDSA with SHA256" \ |
| 4753 | -C "signed using.*ECDSA with SHA1" |
| 4754 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4755 | # tests for SNI |
| 4756 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4757 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4758 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4759 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4760 | 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] | 4761 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4762 | 0 \ |
| 4763 | -S "parse ServerName extension" \ |
| 4764 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4765 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4766 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4767 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4768 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4769 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4770 | 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] | 4771 | 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] | 4772 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4773 | 0 \ |
| 4774 | -s "parse ServerName extension" \ |
| 4775 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4776 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4777 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4778 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4779 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4780 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4781 | 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] | 4782 | 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] | 4783 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4784 | 0 \ |
| 4785 | -s "parse ServerName extension" \ |
| 4786 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4787 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4788 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4789 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4790 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4791 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4792 | 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] | 4793 | 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] | 4794 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4795 | 1 \ |
| 4796 | -s "parse ServerName extension" \ |
| 4797 | -s "ssl_sni_wrapper() returned" \ |
| 4798 | -s "mbedtls_ssl_handshake returned" \ |
| 4799 | -c "mbedtls_ssl_handshake returned" \ |
| 4800 | -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] | 4801 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4802 | run_test "SNI: client auth no override: optional" \ |
| 4803 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4804 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4805 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4806 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4807 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4808 | -S "skip write certificate request" \ |
| 4809 | -C "skip parse certificate request" \ |
| 4810 | -c "got a certificate request" \ |
| 4811 | -C "skip write certificate" \ |
| 4812 | -C "skip write certificate verify" \ |
| 4813 | -S "skip parse certificate verify" |
| 4814 | |
| 4815 | run_test "SNI: client auth override: none -> optional" \ |
| 4816 | "$P_SRV debug_level=3 auth_mode=none \ |
| 4817 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4818 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4819 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4820 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4821 | -S "skip write certificate request" \ |
| 4822 | -C "skip parse certificate request" \ |
| 4823 | -c "got a certificate request" \ |
| 4824 | -C "skip write certificate" \ |
| 4825 | -C "skip write certificate verify" \ |
| 4826 | -S "skip parse certificate verify" |
| 4827 | |
| 4828 | run_test "SNI: client auth override: optional -> none" \ |
| 4829 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4830 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4831 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4832 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4833 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4834 | -s "skip write certificate request" \ |
| 4835 | -C "skip parse certificate request" \ |
| 4836 | -c "got no certificate request" \ |
| 4837 | -c "skip write certificate" \ |
| 4838 | -c "skip write certificate verify" \ |
| 4839 | -s "skip parse certificate verify" |
| 4840 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4841 | run_test "SNI: CA no override" \ |
| 4842 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4843 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4844 | ca_file=data_files/test-ca.crt \ |
| 4845 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4846 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4847 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4848 | 1 \ |
| 4849 | -S "skip write certificate request" \ |
| 4850 | -C "skip parse certificate request" \ |
| 4851 | -c "got a certificate request" \ |
| 4852 | -C "skip write certificate" \ |
| 4853 | -C "skip write certificate verify" \ |
| 4854 | -S "skip parse certificate verify" \ |
| 4855 | -s "x509_verify_cert() returned" \ |
| 4856 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4857 | -S "The certificate has been revoked (is on a CRL)" |
| 4858 | |
| 4859 | run_test "SNI: CA override" \ |
| 4860 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4861 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4862 | ca_file=data_files/test-ca.crt \ |
| 4863 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4864 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4865 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4866 | 0 \ |
| 4867 | -S "skip write certificate request" \ |
| 4868 | -C "skip parse certificate request" \ |
| 4869 | -c "got a certificate request" \ |
| 4870 | -C "skip write certificate" \ |
| 4871 | -C "skip write certificate verify" \ |
| 4872 | -S "skip parse certificate verify" \ |
| 4873 | -S "x509_verify_cert() returned" \ |
| 4874 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4875 | -S "The certificate has been revoked (is on a CRL)" |
| 4876 | |
| 4877 | run_test "SNI: CA override with CRL" \ |
| 4878 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4879 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4880 | ca_file=data_files/test-ca.crt \ |
| 4881 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4882 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4883 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4884 | 1 \ |
| 4885 | -S "skip write certificate request" \ |
| 4886 | -C "skip parse certificate request" \ |
| 4887 | -c "got a certificate request" \ |
| 4888 | -C "skip write certificate" \ |
| 4889 | -C "skip write certificate verify" \ |
| 4890 | -S "skip parse certificate verify" \ |
| 4891 | -s "x509_verify_cert() returned" \ |
| 4892 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4893 | -s "The certificate has been revoked (is on a CRL)" |
| 4894 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4895 | # Tests for SNI and DTLS |
| 4896 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4897 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4898 | run_test "SNI: DTLS, no SNI callback" \ |
| 4899 | "$P_SRV debug_level=3 dtls=1 \ |
| 4900 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 4901 | "$P_CLI server_name=localhost dtls=1" \ |
| 4902 | 0 \ |
| 4903 | -S "parse ServerName extension" \ |
| 4904 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4905 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4906 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4907 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4908 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4909 | "$P_SRV debug_level=3 dtls=1 \ |
| 4910 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4911 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4912 | "$P_CLI server_name=localhost dtls=1" \ |
| 4913 | 0 \ |
| 4914 | -s "parse ServerName extension" \ |
| 4915 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4916 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4917 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4918 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4919 | run_test "SNI: DTLS, matching cert 2" \ |
| 4920 | "$P_SRV debug_level=3 dtls=1 \ |
| 4921 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4922 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4923 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 4924 | 0 \ |
| 4925 | -s "parse ServerName extension" \ |
| 4926 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4927 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 4928 | |
| 4929 | run_test "SNI: DTLS, no matching cert" \ |
| 4930 | "$P_SRV debug_level=3 dtls=1 \ |
| 4931 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4932 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4933 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 4934 | 1 \ |
| 4935 | -s "parse ServerName extension" \ |
| 4936 | -s "ssl_sni_wrapper() returned" \ |
| 4937 | -s "mbedtls_ssl_handshake returned" \ |
| 4938 | -c "mbedtls_ssl_handshake returned" \ |
| 4939 | -c "SSL - A fatal alert message was received from our peer" |
| 4940 | |
| 4941 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 4942 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4943 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4944 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4945 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4946 | 0 \ |
| 4947 | -S "skip write certificate request" \ |
| 4948 | -C "skip parse certificate request" \ |
| 4949 | -c "got a certificate request" \ |
| 4950 | -C "skip write certificate" \ |
| 4951 | -C "skip write certificate verify" \ |
| 4952 | -S "skip parse certificate verify" |
| 4953 | |
| 4954 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 4955 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 4956 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4957 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4958 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4959 | 0 \ |
| 4960 | -S "skip write certificate request" \ |
| 4961 | -C "skip parse certificate request" \ |
| 4962 | -c "got a certificate request" \ |
| 4963 | -C "skip write certificate" \ |
| 4964 | -C "skip write certificate verify" \ |
| 4965 | -S "skip parse certificate verify" |
| 4966 | |
| 4967 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 4968 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4969 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4970 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4971 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4972 | 0 \ |
| 4973 | -s "skip write certificate request" \ |
| 4974 | -C "skip parse certificate request" \ |
| 4975 | -c "got no certificate request" \ |
| 4976 | -c "skip write certificate" \ |
| 4977 | -c "skip write certificate verify" \ |
| 4978 | -s "skip parse certificate verify" |
| 4979 | |
| 4980 | run_test "SNI: DTLS, CA no override" \ |
| 4981 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4982 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4983 | ca_file=data_files/test-ca.crt \ |
| 4984 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4985 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4986 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4987 | 1 \ |
| 4988 | -S "skip write certificate request" \ |
| 4989 | -C "skip parse certificate request" \ |
| 4990 | -c "got a certificate request" \ |
| 4991 | -C "skip write certificate" \ |
| 4992 | -C "skip write certificate verify" \ |
| 4993 | -S "skip parse certificate verify" \ |
| 4994 | -s "x509_verify_cert() returned" \ |
| 4995 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4996 | -S "The certificate has been revoked (is on a CRL)" |
| 4997 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4998 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4999 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5000 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5001 | ca_file=data_files/test-ca.crt \ |
| 5002 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 5003 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5004 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5005 | 0 \ |
| 5006 | -S "skip write certificate request" \ |
| 5007 | -C "skip parse certificate request" \ |
| 5008 | -c "got a certificate request" \ |
| 5009 | -C "skip write certificate" \ |
| 5010 | -C "skip write certificate verify" \ |
| 5011 | -S "skip parse certificate verify" \ |
| 5012 | -S "x509_verify_cert() returned" \ |
| 5013 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5014 | -S "The certificate has been revoked (is on a CRL)" |
| 5015 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5016 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5017 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5018 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 5019 | ca_file=data_files/test-ca.crt \ |
| 5020 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 5021 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5022 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5023 | 1 \ |
| 5024 | -S "skip write certificate request" \ |
| 5025 | -C "skip parse certificate request" \ |
| 5026 | -c "got a certificate request" \ |
| 5027 | -C "skip write certificate" \ |
| 5028 | -C "skip write certificate verify" \ |
| 5029 | -S "skip parse certificate verify" \ |
| 5030 | -s "x509_verify_cert() returned" \ |
| 5031 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5032 | -s "The certificate has been revoked (is on a CRL)" |
| 5033 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5034 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 5035 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5036 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5037 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 5038 | "$P_CLI nbio=2 tickets=0" \ |
| 5039 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5040 | -S "mbedtls_ssl_handshake returned" \ |
| 5041 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5042 | -c "Read from server: .* bytes read" |
| 5043 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5044 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5045 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 5046 | "$P_CLI nbio=2 tickets=0" \ |
| 5047 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5048 | -S "mbedtls_ssl_handshake returned" \ |
| 5049 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5050 | -c "Read from server: .* bytes read" |
| 5051 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5052 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5053 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 5054 | "$P_CLI nbio=2 tickets=1" \ |
| 5055 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5056 | -S "mbedtls_ssl_handshake returned" \ |
| 5057 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5058 | -c "Read from server: .* bytes read" |
| 5059 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5060 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5061 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 5062 | "$P_CLI nbio=2 tickets=1" \ |
| 5063 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5064 | -S "mbedtls_ssl_handshake returned" \ |
| 5065 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5066 | -c "Read from server: .* bytes read" |
| 5067 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5068 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5069 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 5070 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 5071 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5072 | -S "mbedtls_ssl_handshake returned" \ |
| 5073 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5074 | -c "Read from server: .* bytes read" |
| 5075 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5076 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5077 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 5078 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 5079 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5080 | -S "mbedtls_ssl_handshake returned" \ |
| 5081 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5082 | -c "Read from server: .* bytes read" |
| 5083 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5084 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5085 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 5086 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 5087 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5088 | -S "mbedtls_ssl_handshake returned" \ |
| 5089 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5090 | -c "Read from server: .* bytes read" |
| 5091 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5092 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 5093 | |
| 5094 | run_test "Event-driven I/O: basic handshake" \ |
| 5095 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 5096 | "$P_CLI event=1 tickets=0" \ |
| 5097 | 0 \ |
| 5098 | -S "mbedtls_ssl_handshake returned" \ |
| 5099 | -C "mbedtls_ssl_handshake returned" \ |
| 5100 | -c "Read from server: .* bytes read" |
| 5101 | |
| 5102 | run_test "Event-driven I/O: client auth" \ |
| 5103 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 5104 | "$P_CLI event=1 tickets=0" \ |
| 5105 | 0 \ |
| 5106 | -S "mbedtls_ssl_handshake returned" \ |
| 5107 | -C "mbedtls_ssl_handshake returned" \ |
| 5108 | -c "Read from server: .* bytes read" |
| 5109 | |
| 5110 | run_test "Event-driven I/O: ticket" \ |
| 5111 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 5112 | "$P_CLI event=1 tickets=1" \ |
| 5113 | 0 \ |
| 5114 | -S "mbedtls_ssl_handshake returned" \ |
| 5115 | -C "mbedtls_ssl_handshake returned" \ |
| 5116 | -c "Read from server: .* bytes read" |
| 5117 | |
| 5118 | run_test "Event-driven I/O: ticket + client auth" \ |
| 5119 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 5120 | "$P_CLI event=1 tickets=1" \ |
| 5121 | 0 \ |
| 5122 | -S "mbedtls_ssl_handshake returned" \ |
| 5123 | -C "mbedtls_ssl_handshake returned" \ |
| 5124 | -c "Read from server: .* bytes read" |
| 5125 | |
| 5126 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 5127 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 5128 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 5129 | 0 \ |
| 5130 | -S "mbedtls_ssl_handshake returned" \ |
| 5131 | -C "mbedtls_ssl_handshake returned" \ |
| 5132 | -c "Read from server: .* bytes read" |
| 5133 | |
| 5134 | run_test "Event-driven I/O: ticket + resume" \ |
| 5135 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 5136 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 5137 | 0 \ |
| 5138 | -S "mbedtls_ssl_handshake returned" \ |
| 5139 | -C "mbedtls_ssl_handshake returned" \ |
| 5140 | -c "Read from server: .* bytes read" |
| 5141 | |
| 5142 | run_test "Event-driven I/O: session-id resume" \ |
| 5143 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 5144 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 5145 | 0 \ |
| 5146 | -S "mbedtls_ssl_handshake returned" \ |
| 5147 | -C "mbedtls_ssl_handshake returned" \ |
| 5148 | -c "Read from server: .* bytes read" |
| 5149 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5150 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 5151 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 5152 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 5153 | 0 \ |
| 5154 | -c "Read from server: .* bytes read" |
| 5155 | |
| 5156 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 5157 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 5158 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 5159 | 0 \ |
| 5160 | -c "Read from server: .* bytes read" |
| 5161 | |
| 5162 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 5163 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 5164 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 5165 | 0 \ |
| 5166 | -c "Read from server: .* bytes read" |
| 5167 | |
| 5168 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 5169 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 5170 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 5171 | 0 \ |
| 5172 | -c "Read from server: .* bytes read" |
| 5173 | |
| 5174 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 5175 | "$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] | 5176 | "$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] | 5177 | 0 \ |
| 5178 | -c "Read from server: .* bytes read" |
| 5179 | |
| 5180 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 5181 | "$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] | 5182 | "$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] | 5183 | 0 \ |
| 5184 | -c "Read from server: .* bytes read" |
| 5185 | |
| 5186 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 5187 | "$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] | 5188 | "$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] | 5189 | 0 \ |
| 5190 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5191 | |
| 5192 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 5193 | # During session resumption, the client will send its ApplicationData record |
| 5194 | # within the same datagram as the Finished messages. In this situation, the |
| 5195 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 5196 | # because the ApplicationData request has already been queued internally. |
| 5197 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 5198 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5199 | "$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] | 5200 | "$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] | 5201 | 0 \ |
| 5202 | -c "Read from server: .* bytes read" |
| 5203 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5204 | # Tests for version negotiation |
| 5205 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5206 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5207 | "$P_SRV" \ |
| 5208 | "$P_CLI" \ |
| 5209 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5210 | -S "mbedtls_ssl_handshake returned" \ |
| 5211 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5212 | -s "Protocol is TLSv1.2" \ |
| 5213 | -c "Protocol is TLSv1.2" |
| 5214 | |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 5215 | run_test "Not supported version check: cli TLS 1.0" \ |
| 5216 | "$P_SRV" \ |
| 5217 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 5218 | 1 \ |
| 5219 | -s "Handshake protocol not within min/max boundaries" \ |
| 5220 | -c "Error in protocol version" \ |
| 5221 | -S "Protocol is TLSv1.0" \ |
| 5222 | -C "Handshake was completed" |
| 5223 | |
| 5224 | run_test "Not supported version check: cli TLS 1.1" \ |
| 5225 | "$P_SRV" \ |
| 5226 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 5227 | 1 \ |
| 5228 | -s "Handshake protocol not within min/max boundaries" \ |
| 5229 | -c "Error in protocol version" \ |
| 5230 | -S "Protocol is TLSv1.1" \ |
| 5231 | -C "Handshake was completed" |
| 5232 | |
| 5233 | run_test "Not supported version check: srv max TLS 1.0" \ |
| 5234 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 5235 | "$P_CLI" \ |
| 5236 | 1 \ |
| 5237 | -s "Error in protocol version" \ |
| 5238 | -c "Handshake protocol not within min/max boundaries" \ |
| 5239 | -S "Version: TLS1.0" \ |
| 5240 | -C "Protocol is TLSv1.0" |
| 5241 | |
| 5242 | run_test "Not supported version check: srv max TLS 1.1" \ |
| 5243 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 5244 | "$P_CLI" \ |
| 5245 | 1 \ |
| 5246 | -s "Error in protocol version" \ |
| 5247 | -c "Handshake protocol not within min/max boundaries" \ |
| 5248 | -S "Version: TLS1.1" \ |
| 5249 | -C "Protocol is TLSv1.1" |
| 5250 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5251 | # Tests for ALPN extension |
| 5252 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5253 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5254 | "$P_SRV debug_level=3" \ |
| 5255 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5256 | 0 \ |
| 5257 | -C "client hello, adding alpn extension" \ |
| 5258 | -S "found alpn extension" \ |
| 5259 | -C "got an alert message, type: \\[2:120]" \ |
| 5260 | -S "server hello, adding alpn extension" \ |
| 5261 | -C "found alpn extension " \ |
| 5262 | -C "Application Layer Protocol is" \ |
| 5263 | -S "Application Layer Protocol is" |
| 5264 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5265 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5266 | "$P_SRV debug_level=3" \ |
| 5267 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5268 | 0 \ |
| 5269 | -c "client hello, adding alpn extension" \ |
| 5270 | -s "found alpn extension" \ |
| 5271 | -C "got an alert message, type: \\[2:120]" \ |
| 5272 | -S "server hello, adding alpn extension" \ |
| 5273 | -C "found alpn extension " \ |
| 5274 | -c "Application Layer Protocol is (none)" \ |
| 5275 | -S "Application Layer Protocol is" |
| 5276 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5277 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5278 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5279 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5280 | 0 \ |
| 5281 | -C "client hello, adding alpn extension" \ |
| 5282 | -S "found alpn extension" \ |
| 5283 | -C "got an alert message, type: \\[2:120]" \ |
| 5284 | -S "server hello, adding alpn extension" \ |
| 5285 | -C "found alpn extension " \ |
| 5286 | -C "Application Layer Protocol is" \ |
| 5287 | -s "Application Layer Protocol is (none)" |
| 5288 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5289 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5290 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5291 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5292 | 0 \ |
| 5293 | -c "client hello, adding alpn extension" \ |
| 5294 | -s "found alpn extension" \ |
| 5295 | -C "got an alert message, type: \\[2:120]" \ |
| 5296 | -s "server hello, adding alpn extension" \ |
| 5297 | -c "found alpn extension" \ |
| 5298 | -c "Application Layer Protocol is abc" \ |
| 5299 | -s "Application Layer Protocol is abc" |
| 5300 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5301 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5302 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5303 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5304 | 0 \ |
| 5305 | -c "client hello, adding alpn extension" \ |
| 5306 | -s "found alpn extension" \ |
| 5307 | -C "got an alert message, type: \\[2:120]" \ |
| 5308 | -s "server hello, adding alpn extension" \ |
| 5309 | -c "found alpn extension" \ |
| 5310 | -c "Application Layer Protocol is abc" \ |
| 5311 | -s "Application Layer Protocol is abc" |
| 5312 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5313 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5314 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5315 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5316 | 0 \ |
| 5317 | -c "client hello, adding alpn extension" \ |
| 5318 | -s "found alpn extension" \ |
| 5319 | -C "got an alert message, type: \\[2:120]" \ |
| 5320 | -s "server hello, adding alpn extension" \ |
| 5321 | -c "found alpn extension" \ |
| 5322 | -c "Application Layer Protocol is 1234" \ |
| 5323 | -s "Application Layer Protocol is 1234" |
| 5324 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5325 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5326 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 5327 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5328 | 1 \ |
| 5329 | -c "client hello, adding alpn extension" \ |
| 5330 | -s "found alpn extension" \ |
| 5331 | -c "got an alert message, type: \\[2:120]" \ |
| 5332 | -S "server hello, adding alpn extension" \ |
| 5333 | -C "found alpn extension" \ |
| 5334 | -C "Application Layer Protocol is 1234" \ |
| 5335 | -S "Application Layer Protocol is 1234" |
| 5336 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 5337 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5338 | # Tests for keyUsage in leaf certificates, part 1: |
| 5339 | # server-side certificate/suite selection |
| 5340 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5341 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5342 | "$P_SRV key_file=data_files/server2.key \ |
| 5343 | crt_file=data_files/server2.ku-ds.crt" \ |
| 5344 | "$P_CLI" \ |
| 5345 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 5346 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5347 | |
| 5348 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5349 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5350 | "$P_SRV key_file=data_files/server2.key \ |
| 5351 | crt_file=data_files/server2.ku-ke.crt" \ |
| 5352 | "$P_CLI" \ |
| 5353 | 0 \ |
| 5354 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 5355 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5356 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5357 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5358 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5359 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5360 | 1 \ |
| 5361 | -C "Ciphersuite is " |
| 5362 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5363 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5364 | "$P_SRV key_file=data_files/server5.key \ |
| 5365 | crt_file=data_files/server5.ku-ds.crt" \ |
| 5366 | "$P_CLI" \ |
| 5367 | 0 \ |
| 5368 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 5369 | |
| 5370 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5371 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5372 | "$P_SRV key_file=data_files/server5.key \ |
| 5373 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5374 | "$P_CLI" \ |
| 5375 | 0 \ |
| 5376 | -c "Ciphersuite is TLS-ECDH-" |
| 5377 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5378 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5379 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5380 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5381 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5382 | 1 \ |
| 5383 | -C "Ciphersuite is " |
| 5384 | |
| 5385 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5386 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5387 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5388 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5389 | "$O_SRV -key data_files/server2.key \ |
| 5390 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5391 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5392 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5393 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5394 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5395 | -C "Processing of the Certificate handshake message failed" \ |
| 5396 | -c "Ciphersuite is TLS-" |
| 5397 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5398 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5399 | "$O_SRV -key data_files/server2.key \ |
| 5400 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5401 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5402 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5403 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5404 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5405 | -C "Processing of the Certificate handshake message failed" \ |
| 5406 | -c "Ciphersuite is TLS-" |
| 5407 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5408 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5409 | "$O_SRV -key data_files/server2.key \ |
| 5410 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5411 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5412 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5413 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5414 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5415 | -C "Processing of the Certificate handshake message failed" \ |
| 5416 | -c "Ciphersuite is TLS-" |
| 5417 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5418 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5419 | "$O_SRV -key data_files/server2.key \ |
| 5420 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5421 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5422 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5423 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5424 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5425 | -c "Processing of the Certificate handshake message failed" \ |
| 5426 | -C "Ciphersuite is TLS-" |
| 5427 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5428 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 5429 | "$O_SRV -key data_files/server2.key \ |
| 5430 | -cert data_files/server2.ku-ke.crt" \ |
| 5431 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5432 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5433 | 0 \ |
| 5434 | -c "bad certificate (usage extensions)" \ |
| 5435 | -C "Processing of the Certificate handshake message failed" \ |
| 5436 | -c "Ciphersuite is TLS-" \ |
| 5437 | -c "! Usage does not match the keyUsage extension" |
| 5438 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5439 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5440 | "$O_SRV -key data_files/server2.key \ |
| 5441 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5442 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5443 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5444 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5445 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5446 | -C "Processing of the Certificate handshake message failed" \ |
| 5447 | -c "Ciphersuite is TLS-" |
| 5448 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5449 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5450 | "$O_SRV -key data_files/server2.key \ |
| 5451 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5452 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5453 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5454 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5455 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5456 | -c "Processing of the Certificate handshake message failed" \ |
| 5457 | -C "Ciphersuite is TLS-" |
| 5458 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5459 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 5460 | "$O_SRV -key data_files/server2.key \ |
| 5461 | -cert data_files/server2.ku-ds.crt" \ |
| 5462 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5463 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5464 | 0 \ |
| 5465 | -c "bad certificate (usage extensions)" \ |
| 5466 | -C "Processing of the Certificate handshake message failed" \ |
| 5467 | -c "Ciphersuite is TLS-" \ |
| 5468 | -c "! Usage does not match the keyUsage extension" |
| 5469 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5470 | # Tests for keyUsage in leaf certificates, part 3: |
| 5471 | # server-side checking of client cert |
| 5472 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5473 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5474 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5475 | "$O_CLI -key data_files/server2.key \ |
| 5476 | -cert data_files/server2.ku-ds.crt" \ |
| 5477 | 0 \ |
| 5478 | -S "bad certificate (usage extensions)" \ |
| 5479 | -S "Processing of the Certificate handshake message failed" |
| 5480 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5481 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5482 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5483 | "$O_CLI -key data_files/server2.key \ |
| 5484 | -cert data_files/server2.ku-ke.crt" \ |
| 5485 | 0 \ |
| 5486 | -s "bad certificate (usage extensions)" \ |
| 5487 | -S "Processing of the Certificate handshake message failed" |
| 5488 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5489 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5490 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5491 | "$O_CLI -key data_files/server2.key \ |
| 5492 | -cert data_files/server2.ku-ke.crt" \ |
| 5493 | 1 \ |
| 5494 | -s "bad certificate (usage extensions)" \ |
| 5495 | -s "Processing of the Certificate handshake message failed" |
| 5496 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5497 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5498 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5499 | "$O_CLI -key data_files/server5.key \ |
| 5500 | -cert data_files/server5.ku-ds.crt" \ |
| 5501 | 0 \ |
| 5502 | -S "bad certificate (usage extensions)" \ |
| 5503 | -S "Processing of the Certificate handshake message failed" |
| 5504 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5505 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5506 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5507 | "$O_CLI -key data_files/server5.key \ |
| 5508 | -cert data_files/server5.ku-ka.crt" \ |
| 5509 | 0 \ |
| 5510 | -s "bad certificate (usage extensions)" \ |
| 5511 | -S "Processing of the Certificate handshake message failed" |
| 5512 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5513 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 5514 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5515 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5516 | "$P_SRV key_file=data_files/server5.key \ |
| 5517 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5518 | "$P_CLI" \ |
| 5519 | 0 |
| 5520 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5521 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5522 | "$P_SRV key_file=data_files/server5.key \ |
| 5523 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5524 | "$P_CLI" \ |
| 5525 | 0 |
| 5526 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5527 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5528 | "$P_SRV key_file=data_files/server5.key \ |
| 5529 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 5530 | "$P_CLI" \ |
| 5531 | 0 |
| 5532 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5533 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5534 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5535 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5536 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5537 | 1 |
| 5538 | |
| 5539 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 5540 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5541 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5542 | "$O_SRV -key data_files/server5.key \ |
| 5543 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5544 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5545 | 0 \ |
| 5546 | -C "bad certificate (usage extensions)" \ |
| 5547 | -C "Processing of the Certificate handshake message failed" \ |
| 5548 | -c "Ciphersuite is TLS-" |
| 5549 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5550 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5551 | "$O_SRV -key data_files/server5.key \ |
| 5552 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5553 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5554 | 0 \ |
| 5555 | -C "bad certificate (usage extensions)" \ |
| 5556 | -C "Processing of the Certificate handshake message failed" \ |
| 5557 | -c "Ciphersuite is TLS-" |
| 5558 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5559 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5560 | "$O_SRV -key data_files/server5.key \ |
| 5561 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5562 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5563 | 0 \ |
| 5564 | -C "bad certificate (usage extensions)" \ |
| 5565 | -C "Processing of the Certificate handshake message failed" \ |
| 5566 | -c "Ciphersuite is TLS-" |
| 5567 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5568 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5569 | "$O_SRV -key data_files/server5.key \ |
| 5570 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5571 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5572 | 1 \ |
| 5573 | -c "bad certificate (usage extensions)" \ |
| 5574 | -c "Processing of the Certificate handshake message failed" \ |
| 5575 | -C "Ciphersuite is TLS-" |
| 5576 | |
| 5577 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 5578 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5579 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5580 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5581 | "$O_CLI -key data_files/server5.key \ |
| 5582 | -cert data_files/server5.eku-cli.crt" \ |
| 5583 | 0 \ |
| 5584 | -S "bad certificate (usage extensions)" \ |
| 5585 | -S "Processing of the Certificate handshake message failed" |
| 5586 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5587 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5588 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5589 | "$O_CLI -key data_files/server5.key \ |
| 5590 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 5591 | 0 \ |
| 5592 | -S "bad certificate (usage extensions)" \ |
| 5593 | -S "Processing of the Certificate handshake message failed" |
| 5594 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5595 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5596 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5597 | "$O_CLI -key data_files/server5.key \ |
| 5598 | -cert data_files/server5.eku-cs_any.crt" \ |
| 5599 | 0 \ |
| 5600 | -S "bad certificate (usage extensions)" \ |
| 5601 | -S "Processing of the Certificate handshake message failed" |
| 5602 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5603 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5604 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5605 | "$O_CLI -key data_files/server5.key \ |
| 5606 | -cert data_files/server5.eku-cs.crt" \ |
| 5607 | 0 \ |
| 5608 | -s "bad certificate (usage extensions)" \ |
| 5609 | -S "Processing of the Certificate handshake message failed" |
| 5610 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5611 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5612 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5613 | "$O_CLI -key data_files/server5.key \ |
| 5614 | -cert data_files/server5.eku-cs.crt" \ |
| 5615 | 1 \ |
| 5616 | -s "bad certificate (usage extensions)" \ |
| 5617 | -s "Processing of the Certificate handshake message failed" |
| 5618 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5619 | # Tests for DHM parameters loading |
| 5620 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5621 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5622 | "$P_SRV" \ |
| 5623 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5624 | debug_level=3" \ |
| 5625 | 0 \ |
| 5626 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 5627 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5628 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5629 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5630 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5631 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5632 | debug_level=3" \ |
| 5633 | 0 \ |
| 5634 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 5635 | -c "value of 'DHM: G ' (2 bits)" |
| 5636 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5637 | # Tests for DHM client-side size checking |
| 5638 | |
| 5639 | run_test "DHM size: server default, client default, OK" \ |
| 5640 | "$P_SRV" \ |
| 5641 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5642 | debug_level=1" \ |
| 5643 | 0 \ |
| 5644 | -C "DHM prime too short:" |
| 5645 | |
| 5646 | run_test "DHM size: server default, client 2048, OK" \ |
| 5647 | "$P_SRV" \ |
| 5648 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5649 | debug_level=1 dhmlen=2048" \ |
| 5650 | 0 \ |
| 5651 | -C "DHM prime too short:" |
| 5652 | |
| 5653 | run_test "DHM size: server 1024, client default, OK" \ |
| 5654 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5655 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5656 | debug_level=1" \ |
| 5657 | 0 \ |
| 5658 | -C "DHM prime too short:" |
| 5659 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5660 | run_test "DHM size: server 999, client 999, OK" \ |
| 5661 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5662 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5663 | debug_level=1 dhmlen=999" \ |
| 5664 | 0 \ |
| 5665 | -C "DHM prime too short:" |
| 5666 | |
| 5667 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 5668 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5669 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5670 | debug_level=1 dhmlen=1000" \ |
| 5671 | 0 \ |
| 5672 | -C "DHM prime too short:" |
| 5673 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5674 | run_test "DHM size: server 1000, client default, rejected" \ |
| 5675 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5676 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5677 | debug_level=1" \ |
| 5678 | 1 \ |
| 5679 | -c "DHM prime too short:" |
| 5680 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5681 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 5682 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5683 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5684 | debug_level=1 dhmlen=1001" \ |
| 5685 | 1 \ |
| 5686 | -c "DHM prime too short:" |
| 5687 | |
| 5688 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 5689 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5690 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5691 | debug_level=1 dhmlen=1000" \ |
| 5692 | 1 \ |
| 5693 | -c "DHM prime too short:" |
| 5694 | |
| 5695 | run_test "DHM size: server 998, client 999, rejected" \ |
| 5696 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 5697 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5698 | debug_level=1 dhmlen=999" \ |
| 5699 | 1 \ |
| 5700 | -c "DHM prime too short:" |
| 5701 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5702 | run_test "DHM size: server default, client 2049, rejected" \ |
| 5703 | "$P_SRV" \ |
| 5704 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5705 | debug_level=1 dhmlen=2049" \ |
| 5706 | 1 \ |
| 5707 | -c "DHM prime too short:" |
| 5708 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5709 | # Tests for PSK callback |
| 5710 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5711 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5712 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 5713 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5714 | psk_identity=foo psk=abc123" \ |
| 5715 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5716 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5717 | -S "SSL - Unknown identity received" \ |
| 5718 | -S "SSL - Verification of the message MAC failed" |
| 5719 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5720 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5721 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 5722 | "$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] | 5723 | "$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] | 5724 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5725 | 0 \ |
| 5726 | -c "skip PMS generation for opaque PSK"\ |
| 5727 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5728 | -C "session hash for extended master secret"\ |
| 5729 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5730 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5731 | -S "SSL - Unknown identity received" \ |
| 5732 | -S "SSL - Verification of the message MAC failed" |
| 5733 | |
| 5734 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5735 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 5736 | "$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] | 5737 | "$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] | 5738 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5739 | 0 \ |
| 5740 | -c "skip PMS generation for opaque PSK"\ |
| 5741 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5742 | -C "session hash for extended master secret"\ |
| 5743 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5744 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5745 | -S "SSL - Unknown identity received" \ |
| 5746 | -S "SSL - Verification of the message MAC failed" |
| 5747 | |
| 5748 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5749 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 5750 | "$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] | 5751 | "$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] | 5752 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5753 | 0 \ |
| 5754 | -c "skip PMS generation for opaque PSK"\ |
| 5755 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5756 | -c "session hash for extended master secret"\ |
| 5757 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5758 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5759 | -S "SSL - Unknown identity received" \ |
| 5760 | -S "SSL - Verification of the message MAC failed" |
| 5761 | |
| 5762 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5763 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 5764 | "$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] | 5765 | "$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] | 5766 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5767 | 0 \ |
| 5768 | -c "skip PMS generation for opaque PSK"\ |
| 5769 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5770 | -c "session hash for extended master secret"\ |
| 5771 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5772 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5773 | -S "SSL - Unknown identity received" \ |
| 5774 | -S "SSL - Verification of the message MAC failed" |
| 5775 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5776 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5777 | 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] | 5778 | "$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" \ |
| 5779 | "$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] | 5780 | psk_identity=foo psk=abc123" \ |
| 5781 | 0 \ |
| 5782 | -C "skip PMS generation for opaque PSK"\ |
| 5783 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5784 | -C "session hash for extended master secret"\ |
| 5785 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5786 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5787 | -S "SSL - Unknown identity received" \ |
| 5788 | -S "SSL - Verification of the message MAC failed" |
| 5789 | |
| 5790 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5791 | 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] | 5792 | "$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" \ |
| 5793 | "$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] | 5794 | psk_identity=foo psk=abc123" \ |
| 5795 | 0 \ |
| 5796 | -C "skip PMS generation for opaque PSK"\ |
| 5797 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5798 | -C "session hash for extended master secret"\ |
| 5799 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5800 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5801 | -S "SSL - Unknown identity received" \ |
| 5802 | -S "SSL - Verification of the message MAC failed" |
| 5803 | |
| 5804 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5805 | 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] | 5806 | "$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] | 5807 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5808 | "$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] | 5809 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5810 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5811 | -c "session hash for extended master secret"\ |
| 5812 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5813 | -C "skip PMS generation for opaque PSK"\ |
| 5814 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5815 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5816 | -S "SSL - Unknown identity received" \ |
| 5817 | -S "SSL - Verification of the message MAC failed" |
| 5818 | |
| 5819 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5820 | 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] | 5821 | "$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] | 5822 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5823 | "$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] | 5824 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5825 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5826 | -c "session hash for extended master secret"\ |
| 5827 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5828 | -C "skip PMS generation for opaque PSK"\ |
| 5829 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5830 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5831 | -S "SSL - Unknown identity received" \ |
| 5832 | -S "SSL - Verification of the message MAC failed" |
| 5833 | |
| 5834 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5835 | 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] | 5836 | "$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" \ |
| 5837 | "$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] | 5838 | psk_identity=def psk=beef" \ |
| 5839 | 0 \ |
| 5840 | -C "skip PMS generation for opaque PSK"\ |
| 5841 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5842 | -C "session hash for extended master secret"\ |
| 5843 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5844 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5845 | -S "SSL - Unknown identity received" \ |
| 5846 | -S "SSL - Verification of the message MAC failed" |
| 5847 | |
| 5848 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5849 | 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] | 5850 | "$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" \ |
| 5851 | "$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] | 5852 | psk_identity=def psk=beef" \ |
| 5853 | 0 \ |
| 5854 | -C "skip PMS generation for opaque PSK"\ |
| 5855 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5856 | -C "session hash for extended master secret"\ |
| 5857 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5858 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5859 | -S "SSL - Unknown identity received" \ |
| 5860 | -S "SSL - Verification of the message MAC failed" |
| 5861 | |
| 5862 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5863 | 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] | 5864 | "$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] | 5865 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5866 | "$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] | 5867 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5868 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5869 | -c "session hash for extended master secret"\ |
| 5870 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5871 | -C "skip PMS generation for opaque PSK"\ |
| 5872 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5873 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5874 | -S "SSL - Unknown identity received" \ |
| 5875 | -S "SSL - Verification of the message MAC failed" |
| 5876 | |
| 5877 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5878 | 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] | 5879 | "$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] | 5880 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5881 | "$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] | 5882 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5883 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5884 | -c "session hash for extended master secret"\ |
| 5885 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5886 | -C "skip PMS generation for opaque PSK"\ |
| 5887 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5888 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5889 | -S "SSL - Unknown identity received" \ |
| 5890 | -S "SSL - Verification of the message MAC failed" |
| 5891 | |
| 5892 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5893 | 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] | 5894 | "$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" \ |
| 5895 | "$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] | 5896 | psk_identity=def psk=beef" \ |
| 5897 | 0 \ |
| 5898 | -C "skip PMS generation for opaque PSK"\ |
| 5899 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5900 | -C "session hash for extended master secret"\ |
| 5901 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5902 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5903 | -S "SSL - Unknown identity received" \ |
| 5904 | -S "SSL - Verification of the message MAC failed" |
| 5905 | |
| 5906 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5907 | 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] | 5908 | "$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" \ |
| 5909 | "$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] | 5910 | psk_identity=def psk=beef" \ |
| 5911 | 0 \ |
| 5912 | -C "skip PMS generation for opaque PSK"\ |
| 5913 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5914 | -C "session hash for extended master secret"\ |
| 5915 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5916 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5917 | -S "SSL - Unknown identity received" \ |
| 5918 | -S "SSL - Verification of the message MAC failed" |
| 5919 | |
| 5920 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5921 | 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] | 5922 | "$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" \ |
| 5923 | "$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] | 5924 | psk_identity=def psk=beef" \ |
| 5925 | 0 \ |
| 5926 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5927 | -C "session hash for extended master secret"\ |
| 5928 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5929 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5930 | -S "SSL - Unknown identity received" \ |
| 5931 | -S "SSL - Verification of the message MAC failed" |
| 5932 | |
| 5933 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5934 | 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] | 5935 | "$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" \ |
| 5936 | "$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] | 5937 | psk_identity=def psk=beef" \ |
| 5938 | 0 \ |
| 5939 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5940 | -C "session hash for extended master secret"\ |
| 5941 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5942 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5943 | -S "SSL - Unknown identity received" \ |
| 5944 | -S "SSL - Verification of the message MAC failed" |
| 5945 | |
| 5946 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5947 | 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] | 5948 | "$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" \ |
| 5949 | "$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] | 5950 | psk_identity=def psk=beef" \ |
| 5951 | 1 \ |
| 5952 | -s "SSL - Verification of the message MAC failed" |
| 5953 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5954 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5955 | "$P_SRV" \ |
| 5956 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5957 | psk_identity=foo psk=abc123" \ |
| 5958 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 5959 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5960 | -S "SSL - Unknown identity received" \ |
| 5961 | -S "SSL - Verification of the message MAC failed" |
| 5962 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5963 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5964 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 5965 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5966 | psk_identity=foo psk=abc123" \ |
| 5967 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5968 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5969 | -s "SSL - Unknown identity received" \ |
| 5970 | -S "SSL - Verification of the message MAC failed" |
| 5971 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5972 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5973 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5974 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5975 | psk_identity=abc psk=dead" \ |
| 5976 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5977 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5978 | -S "SSL - Unknown identity received" \ |
| 5979 | -S "SSL - Verification of the message MAC failed" |
| 5980 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5981 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5982 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5983 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5984 | psk_identity=def psk=beef" \ |
| 5985 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5986 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5987 | -S "SSL - Unknown identity received" \ |
| 5988 | -S "SSL - Verification of the message MAC failed" |
| 5989 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5990 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5991 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5992 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5993 | psk_identity=ghi psk=beef" \ |
| 5994 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5995 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5996 | -s "SSL - Unknown identity received" \ |
| 5997 | -S "SSL - Verification of the message MAC failed" |
| 5998 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5999 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6000 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6001 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6002 | psk_identity=abc psk=beef" \ |
| 6003 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6004 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6005 | -S "SSL - Unknown identity received" \ |
| 6006 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6007 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6008 | # Tests for EC J-PAKE |
| 6009 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6010 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6011 | run_test "ECJPAKE: client not configured" \ |
| 6012 | "$P_SRV debug_level=3" \ |
| 6013 | "$P_CLI debug_level=3" \ |
| 6014 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6015 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6016 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6017 | -S "found ecjpake kkpp extension" \ |
| 6018 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6019 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6020 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6021 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 6022 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6023 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6024 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6025 | run_test "ECJPAKE: server not configured" \ |
| 6026 | "$P_SRV debug_level=3" \ |
| 6027 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 6028 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6029 | 1 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6030 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6031 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6032 | -s "found ecjpake kkpp extension" \ |
| 6033 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6034 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6035 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6036 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 6037 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6038 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6039 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6040 | run_test "ECJPAKE: working, TLS" \ |
| 6041 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 6042 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 6043 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 6044 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6045 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6046 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6047 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6048 | -s "found ecjpake kkpp extension" \ |
| 6049 | -S "skip ecjpake kkpp extension" \ |
| 6050 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6051 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6052 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 6053 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6054 | -S "SSL - Verification of the message MAC failed" |
| 6055 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6056 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6057 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6058 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 6059 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 6060 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 6061 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6062 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6063 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6064 | -s "SSL - Verification of the message MAC failed" |
| 6065 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6066 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6067 | run_test "ECJPAKE: working, DTLS" \ |
| 6068 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 6069 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 6070 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6071 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6072 | -c "re-using cached ecjpake parameters" \ |
| 6073 | -S "SSL - Verification of the message MAC failed" |
| 6074 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6075 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6076 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 6077 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 6078 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 6079 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6080 | 0 \ |
| 6081 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6082 | -S "SSL - Verification of the message MAC failed" |
| 6083 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6084 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6085 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6086 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 6087 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 6088 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 6089 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6090 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6091 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6092 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6093 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 6094 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6095 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 6096 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 6097 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 6098 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 6099 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6100 | 0 |
| 6101 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 6102 | # Test for ClientHello without extensions |
| 6103 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 6104 | requires_gnutls |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 6105 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 6106 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6107 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 6108 | 0 \ |
| 6109 | -s "dumping 'client hello extensions' (0 bytes)" |
| 6110 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6111 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6112 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6113 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6114 | "$P_SRV" \ |
| 6115 | "$P_CLI request_size=100" \ |
| 6116 | 0 \ |
| 6117 | -s "Read from client: 100 bytes read$" |
| 6118 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6119 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6120 | "$P_SRV" \ |
| 6121 | "$P_CLI request_size=500" \ |
| 6122 | 0 \ |
| 6123 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6124 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6125 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6126 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6127 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6128 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6129 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6130 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6131 | 0 \ |
| 6132 | -s "Read from client: 1 bytes read" |
| 6133 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6134 | 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] | 6135 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6136 | "$P_CLI request_size=1 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6137 | 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] | 6138 | 0 \ |
| 6139 | -s "Read from client: 1 bytes read" |
| 6140 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6141 | 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] | 6142 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6143 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6144 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6145 | 0 \ |
| 6146 | -s "Read from client: 1 bytes read" |
| 6147 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6148 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6149 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6150 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6151 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6152 | 0 \ |
| 6153 | -s "Read from client: 1 bytes read" |
| 6154 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6155 | 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] | 6156 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6157 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6158 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6159 | 0 \ |
| 6160 | -s "Read from client: 1 bytes read" |
| 6161 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6162 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6163 | |
| 6164 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6165 | run_test "Small client packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6166 | "$P_SRV dtls=1 force_version=dtls12" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6167 | "$P_CLI dtls=1 request_size=1 \ |
| 6168 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6169 | 0 \ |
| 6170 | -s "Read from client: 1 bytes read" |
| 6171 | |
| 6172 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6173 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6174 | "$P_SRV dtls=1 force_version=dtls12 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6175 | "$P_CLI dtls=1 request_size=1 \ |
| 6176 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6177 | 0 \ |
| 6178 | -s "Read from client: 1 bytes read" |
| 6179 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6180 | # Tests for small server packets |
| 6181 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6182 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 6183 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6184 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6185 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6186 | 0 \ |
| 6187 | -c "Read from server: 1 bytes read" |
| 6188 | |
| 6189 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6190 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6191 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6192 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 6193 | 0 \ |
| 6194 | -c "Read from server: 1 bytes read" |
| 6195 | |
| 6196 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6197 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6198 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6199 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6200 | 0 \ |
| 6201 | -c "Read from server: 1 bytes read" |
| 6202 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6203 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 6204 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6205 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6206 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6207 | 0 \ |
| 6208 | -c "Read from server: 1 bytes read" |
| 6209 | |
| 6210 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 6211 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6212 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6213 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6214 | 0 \ |
| 6215 | -c "Read from server: 1 bytes read" |
| 6216 | |
| 6217 | # Tests for small server packets in DTLS |
| 6218 | |
| 6219 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6220 | run_test "Small server packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6221 | "$P_SRV dtls=1 response_size=1 force_version=dtls12" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6222 | "$P_CLI dtls=1 \ |
| 6223 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6224 | 0 \ |
| 6225 | -c "Read from server: 1 bytes read" |
| 6226 | |
| 6227 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6228 | run_test "Small server packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6229 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6230 | "$P_CLI dtls=1 \ |
| 6231 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6232 | 0 \ |
| 6233 | -c "Read from server: 1 bytes read" |
| 6234 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6235 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6236 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6237 | # How many fragments do we expect to write $1 bytes? |
| 6238 | fragments_for_write() { |
| 6239 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 6240 | } |
| 6241 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6242 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6243 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6244 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6245 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6246 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6247 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6248 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6249 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6250 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6251 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6252 | "$P_CLI request_size=16384 force_version=tls12 etm=0 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6253 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6254 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6255 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6256 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6257 | 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] | 6258 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6259 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6260 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6261 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6262 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6263 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6264 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6265 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6266 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6267 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6268 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6269 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6270 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6271 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6272 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6273 | 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] | 6274 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6275 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6276 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6277 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6278 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6279 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6280 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6281 | # 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] | 6282 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 6283 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6284 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6285 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6286 | 0 \ |
| 6287 | -c "Read from server: 16384 bytes read" |
| 6288 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6289 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6290 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6291 | "$P_CLI force_version=tls12 etm=0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6292 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6293 | 0 \ |
| 6294 | -s "16384 bytes written in 1 fragments" \ |
| 6295 | -c "Read from server: 16384 bytes read" |
| 6296 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6297 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6298 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6299 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6300 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6301 | 0 \ |
| 6302 | -c "Read from server: 16384 bytes read" |
| 6303 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6304 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 6305 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6306 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6307 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6308 | 0 \ |
| 6309 | -s "16384 bytes written in 1 fragments" \ |
| 6310 | -c "Read from server: 16384 bytes read" |
| 6311 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6312 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 6313 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6314 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6315 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6316 | 0 \ |
| 6317 | -c "Read from server: 16384 bytes read" |
| 6318 | |
| 6319 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 6320 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6321 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6322 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6323 | 0 \ |
| 6324 | -c "Read from server: 16384 bytes read" |
| 6325 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6326 | # Tests for restartable ECC |
| 6327 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6328 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 6329 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6330 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6331 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6332 | run_test "EC restart: TLS, default" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6333 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6334 | "$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] | 6335 | 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] | 6336 | debug_level=1" \ |
| 6337 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6338 | -C "x509_verify_cert.*4b00" \ |
| 6339 | -C "mbedtls_pk_verify.*4b00" \ |
| 6340 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6341 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6342 | |
| 6343 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6344 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6345 | run_test "EC restart: TLS, max_ops=0" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6346 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6347 | "$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] | 6348 | 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] | 6349 | debug_level=1 ec_max_ops=0" \ |
| 6350 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6351 | -C "x509_verify_cert.*4b00" \ |
| 6352 | -C "mbedtls_pk_verify.*4b00" \ |
| 6353 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6354 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6355 | |
| 6356 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6357 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6358 | run_test "EC restart: TLS, max_ops=65535" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6359 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6360 | "$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] | 6361 | 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] | 6362 | debug_level=1 ec_max_ops=65535" \ |
| 6363 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6364 | -C "x509_verify_cert.*4b00" \ |
| 6365 | -C "mbedtls_pk_verify.*4b00" \ |
| 6366 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6367 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6368 | |
| 6369 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6370 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6371 | run_test "EC restart: TLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6372 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6373 | "$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] | 6374 | 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] | 6375 | debug_level=1 ec_max_ops=1000" \ |
| 6376 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6377 | -c "x509_verify_cert.*4b00" \ |
| 6378 | -c "mbedtls_pk_verify.*4b00" \ |
| 6379 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6380 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6381 | |
| 6382 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6383 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6384 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6385 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6386 | crt_file=data_files/server5-badsign.crt \ |
| 6387 | key_file=data_files/server5.key" \ |
| 6388 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6389 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6390 | debug_level=1 ec_max_ops=1000" \ |
| 6391 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6392 | -c "x509_verify_cert.*4b00" \ |
| 6393 | -C "mbedtls_pk_verify.*4b00" \ |
| 6394 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6395 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6396 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6397 | -c "! mbedtls_ssl_handshake returned" \ |
| 6398 | -c "X509 - Certificate verification failed" |
| 6399 | |
| 6400 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6401 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6402 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6403 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6404 | crt_file=data_files/server5-badsign.crt \ |
| 6405 | key_file=data_files/server5.key" \ |
| 6406 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6407 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6408 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 6409 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6410 | -c "x509_verify_cert.*4b00" \ |
| 6411 | -c "mbedtls_pk_verify.*4b00" \ |
| 6412 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6413 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6414 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6415 | -C "! mbedtls_ssl_handshake returned" \ |
| 6416 | -C "X509 - Certificate verification failed" |
| 6417 | |
| 6418 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6419 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6420 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6421 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6422 | crt_file=data_files/server5-badsign.crt \ |
| 6423 | key_file=data_files/server5.key" \ |
| 6424 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6425 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6426 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 6427 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6428 | -C "x509_verify_cert.*4b00" \ |
| 6429 | -c "mbedtls_pk_verify.*4b00" \ |
| 6430 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6431 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6432 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6433 | -C "! mbedtls_ssl_handshake returned" \ |
| 6434 | -C "X509 - Certificate verification failed" |
| 6435 | |
| 6436 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6437 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6438 | run_test "EC restart: DTLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6439 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6440 | "$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] | 6441 | 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] | 6442 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 6443 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6444 | -c "x509_verify_cert.*4b00" \ |
| 6445 | -c "mbedtls_pk_verify.*4b00" \ |
| 6446 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6447 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6448 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6449 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6450 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6451 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6452 | "$P_SRV curves=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6453 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6454 | debug_level=1 ec_max_ops=1000" \ |
| 6455 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6456 | -c "x509_verify_cert.*4b00" \ |
| 6457 | -c "mbedtls_pk_verify.*4b00" \ |
| 6458 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6459 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6460 | |
| 6461 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6462 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6463 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6464 | "$P_SRV curves=secp256r1 psk=abc123" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6465 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 6466 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 6467 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6468 | -C "x509_verify_cert.*4b00" \ |
| 6469 | -C "mbedtls_pk_verify.*4b00" \ |
| 6470 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6471 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6472 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6473 | # Tests of asynchronous private key support in SSL |
| 6474 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6475 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6476 | run_test "SSL async private: sign, delay=0" \ |
| 6477 | "$P_SRV \ |
| 6478 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6479 | "$P_CLI" \ |
| 6480 | 0 \ |
| 6481 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6482 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6483 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6484 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6485 | run_test "SSL async private: sign, delay=1" \ |
| 6486 | "$P_SRV \ |
| 6487 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6488 | "$P_CLI" \ |
| 6489 | 0 \ |
| 6490 | -s "Async sign callback: using key slot " \ |
| 6491 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6492 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6493 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 6494 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6495 | run_test "SSL async private: sign, delay=2" \ |
| 6496 | "$P_SRV \ |
| 6497 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 6498 | "$P_CLI" \ |
| 6499 | 0 \ |
| 6500 | -s "Async sign callback: using key slot " \ |
| 6501 | -U "Async sign callback: using key slot " \ |
| 6502 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 6503 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6504 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6505 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6506 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6507 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 6508 | run_test "SSL async private: sign, SNI" \ |
| 6509 | "$P_SRV debug_level=3 \ |
| 6510 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 6511 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6512 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6513 | "$P_CLI server_name=polarssl.example" \ |
| 6514 | 0 \ |
| 6515 | -s "Async sign callback: using key slot " \ |
| 6516 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6517 | -s "parse ServerName extension" \ |
| 6518 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6519 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6520 | |
| 6521 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6522 | run_test "SSL async private: decrypt, delay=0" \ |
| 6523 | "$P_SRV \ |
| 6524 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6525 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6526 | 0 \ |
| 6527 | -s "Async decrypt callback: using key slot " \ |
| 6528 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6529 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6530 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6531 | run_test "SSL async private: decrypt, delay=1" \ |
| 6532 | "$P_SRV \ |
| 6533 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6534 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6535 | 0 \ |
| 6536 | -s "Async decrypt callback: using key slot " \ |
| 6537 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6538 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6539 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6540 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6541 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 6542 | "$P_SRV psk=abc123 \ |
| 6543 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6544 | "$P_CLI psk=abc123 \ |
| 6545 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6546 | 0 \ |
| 6547 | -s "Async decrypt callback: using key slot " \ |
| 6548 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6549 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6550 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6551 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 6552 | "$P_SRV psk=abc123 \ |
| 6553 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6554 | "$P_CLI psk=abc123 \ |
| 6555 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6556 | 0 \ |
| 6557 | -s "Async decrypt callback: using key slot " \ |
| 6558 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6559 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6560 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6561 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6562 | run_test "SSL async private: sign callback not present" \ |
| 6563 | "$P_SRV \ |
| 6564 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6565 | "$P_CLI; [ \$? -eq 1 ] && |
| 6566 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6567 | 0 \ |
| 6568 | -S "Async sign callback" \ |
| 6569 | -s "! mbedtls_ssl_handshake returned" \ |
| 6570 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 6571 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 6572 | -s "Successful connection" |
| 6573 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6574 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6575 | run_test "SSL async private: decrypt callback not present" \ |
| 6576 | "$P_SRV debug_level=1 \ |
| 6577 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 6578 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 6579 | [ \$? -eq 1 ] && $P_CLI" \ |
| 6580 | 0 \ |
| 6581 | -S "Async decrypt callback" \ |
| 6582 | -s "! mbedtls_ssl_handshake returned" \ |
| 6583 | -s "got no RSA private key" \ |
| 6584 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6585 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6586 | |
| 6587 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6588 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6589 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6590 | "$P_SRV \ |
| 6591 | async_operations=s async_private_delay1=1 \ |
| 6592 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6593 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6594 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6595 | 0 \ |
| 6596 | -s "Async sign callback: using key slot 0," \ |
| 6597 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6598 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6599 | |
| 6600 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6601 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6602 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6603 | "$P_SRV \ |
| 6604 | async_operations=s async_private_delay2=1 \ |
| 6605 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6606 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6607 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6608 | 0 \ |
| 6609 | -s "Async sign callback: using key slot 0," \ |
| 6610 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6611 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6612 | |
| 6613 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6614 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 6615 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6616 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 6617 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6618 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6619 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6620 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6621 | 0 \ |
| 6622 | -s "Async sign callback: using key slot 1," \ |
| 6623 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6624 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6625 | |
| 6626 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6627 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6628 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6629 | "$P_SRV \ |
| 6630 | async_operations=s async_private_delay1=1 \ |
| 6631 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6632 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6633 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6634 | 0 \ |
| 6635 | -s "Async sign callback: no key matches this certificate." |
| 6636 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6637 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6638 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6639 | "$P_SRV \ |
| 6640 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6641 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6642 | "$P_CLI" \ |
| 6643 | 1 \ |
| 6644 | -s "Async sign callback: injected error" \ |
| 6645 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6646 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6647 | -s "! mbedtls_ssl_handshake returned" |
| 6648 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6649 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6650 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6651 | "$P_SRV \ |
| 6652 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6653 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6654 | "$P_CLI" \ |
| 6655 | 1 \ |
| 6656 | -s "Async sign callback: using key slot " \ |
| 6657 | -S "Async resume" \ |
| 6658 | -s "Async cancel" |
| 6659 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6660 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6661 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6662 | "$P_SRV \ |
| 6663 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6664 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6665 | "$P_CLI" \ |
| 6666 | 1 \ |
| 6667 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6668 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6669 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6670 | -s "! mbedtls_ssl_handshake returned" |
| 6671 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6672 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6673 | run_test "SSL async private: decrypt, error in start" \ |
| 6674 | "$P_SRV \ |
| 6675 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6676 | async_private_error=1" \ |
| 6677 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6678 | 1 \ |
| 6679 | -s "Async decrypt callback: injected error" \ |
| 6680 | -S "Async resume" \ |
| 6681 | -S "Async cancel" \ |
| 6682 | -s "! mbedtls_ssl_handshake returned" |
| 6683 | |
| 6684 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6685 | run_test "SSL async private: decrypt, cancel after start" \ |
| 6686 | "$P_SRV \ |
| 6687 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6688 | async_private_error=2" \ |
| 6689 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6690 | 1 \ |
| 6691 | -s "Async decrypt callback: using key slot " \ |
| 6692 | -S "Async resume" \ |
| 6693 | -s "Async cancel" |
| 6694 | |
| 6695 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6696 | run_test "SSL async private: decrypt, error in resume" \ |
| 6697 | "$P_SRV \ |
| 6698 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6699 | async_private_error=3" \ |
| 6700 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6701 | 1 \ |
| 6702 | -s "Async decrypt callback: using key slot " \ |
| 6703 | -s "Async resume callback: decrypt done but injected error" \ |
| 6704 | -S "Async cancel" \ |
| 6705 | -s "! mbedtls_ssl_handshake returned" |
| 6706 | |
| 6707 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6708 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6709 | "$P_SRV \ |
| 6710 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6711 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6712 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6713 | 0 \ |
| 6714 | -s "Async cancel" \ |
| 6715 | -s "! mbedtls_ssl_handshake returned" \ |
| 6716 | -s "Async resume" \ |
| 6717 | -s "Successful connection" |
| 6718 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6719 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6720 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6721 | "$P_SRV \ |
| 6722 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6723 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6724 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6725 | 0 \ |
| 6726 | -s "! mbedtls_ssl_handshake returned" \ |
| 6727 | -s "Async resume" \ |
| 6728 | -s "Successful connection" |
| 6729 | |
| 6730 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6731 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6732 | 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] | 6733 | "$P_SRV \ |
| 6734 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 6735 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6736 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6737 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6738 | [ \$? -eq 1 ] && |
| 6739 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6740 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 6741 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6742 | -S "Async resume" \ |
| 6743 | -s "Async cancel" \ |
| 6744 | -s "! mbedtls_ssl_handshake returned" \ |
| 6745 | -s "Async sign callback: no key matches this certificate." \ |
| 6746 | -s "Successful connection" |
| 6747 | |
| 6748 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6749 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6750 | 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] | 6751 | "$P_SRV \ |
| 6752 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 6753 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6754 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6755 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6756 | [ \$? -eq 1 ] && |
| 6757 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6758 | 0 \ |
| 6759 | -s "Async resume" \ |
| 6760 | -s "! mbedtls_ssl_handshake returned" \ |
| 6761 | -s "Async sign callback: no key matches this certificate." \ |
| 6762 | -s "Successful connection" |
| 6763 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6764 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6765 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6766 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6767 | "$P_SRV \ |
| 6768 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6769 | exchanges=2 renegotiation=1" \ |
| 6770 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6771 | 0 \ |
| 6772 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6773 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6774 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6775 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6776 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6777 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6778 | "$P_SRV \ |
| 6779 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6780 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6781 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 6782 | 0 \ |
| 6783 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6784 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6785 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6786 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6787 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6788 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6789 | "$P_SRV \ |
| 6790 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6791 | exchanges=2 renegotiation=1" \ |
| 6792 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 6793 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6794 | 0 \ |
| 6795 | -s "Async decrypt callback: using key slot " \ |
| 6796 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6797 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6798 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6799 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6800 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6801 | "$P_SRV \ |
| 6802 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6803 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6804 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 6805 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6806 | 0 \ |
| 6807 | -s "Async decrypt callback: using key slot " \ |
| 6808 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6809 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6810 | # Tests for ECC extensions (rfc 4492) |
| 6811 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6812 | requires_config_enabled MBEDTLS_AES_C |
| 6813 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6814 | requires_config_enabled MBEDTLS_SHA256_C |
| 6815 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6816 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 6817 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6818 | "$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] | 6819 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 6820 | -C "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6821 | -C "client hello, adding supported_point_formats extension" \ |
| 6822 | -S "found supported elliptic curves extension" \ |
| 6823 | -S "found supported point formats extension" |
| 6824 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6825 | requires_config_enabled MBEDTLS_AES_C |
| 6826 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6827 | requires_config_enabled MBEDTLS_SHA256_C |
| 6828 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6829 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6830 | "$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] | 6831 | "$P_CLI debug_level=3" \ |
| 6832 | 0 \ |
| 6833 | -C "found supported_point_formats extension" \ |
| 6834 | -S "server hello, supported_point_formats extension" |
| 6835 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6836 | requires_config_enabled MBEDTLS_AES_C |
| 6837 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6838 | requires_config_enabled MBEDTLS_SHA256_C |
| 6839 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6840 | run_test "Force an ECC ciphersuite in the client side" \ |
| 6841 | "$P_SRV debug_level=3" \ |
| 6842 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6843 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 6844 | -c "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6845 | -c "client hello, adding supported_point_formats extension" \ |
| 6846 | -s "found supported elliptic curves extension" \ |
| 6847 | -s "found supported point formats extension" |
| 6848 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6849 | requires_config_enabled MBEDTLS_AES_C |
| 6850 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6851 | requires_config_enabled MBEDTLS_SHA256_C |
| 6852 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6853 | run_test "Force an ECC ciphersuite in the server side" \ |
| 6854 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6855 | "$P_CLI debug_level=3" \ |
| 6856 | 0 \ |
| 6857 | -c "found supported_point_formats extension" \ |
| 6858 | -s "server hello, supported_point_formats extension" |
| 6859 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6860 | # Tests for DTLS HelloVerifyRequest |
| 6861 | |
| 6862 | run_test "DTLS cookie: enabled" \ |
| 6863 | "$P_SRV dtls=1 debug_level=2" \ |
| 6864 | "$P_CLI dtls=1 debug_level=2" \ |
| 6865 | 0 \ |
| 6866 | -s "cookie verification failed" \ |
| 6867 | -s "cookie verification passed" \ |
| 6868 | -S "cookie verification skipped" \ |
| 6869 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6870 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6871 | -S "SSL - The requested feature is not available" |
| 6872 | |
| 6873 | run_test "DTLS cookie: disabled" \ |
| 6874 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 6875 | "$P_CLI dtls=1 debug_level=2" \ |
| 6876 | 0 \ |
| 6877 | -S "cookie verification failed" \ |
| 6878 | -S "cookie verification passed" \ |
| 6879 | -s "cookie verification skipped" \ |
| 6880 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6881 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6882 | -S "SSL - The requested feature is not available" |
| 6883 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6884 | run_test "DTLS cookie: default (failing)" \ |
| 6885 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 6886 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 6887 | 1 \ |
| 6888 | -s "cookie verification failed" \ |
| 6889 | -S "cookie verification passed" \ |
| 6890 | -S "cookie verification skipped" \ |
| 6891 | -C "received hello verify request" \ |
| 6892 | -S "hello verification requested" \ |
| 6893 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6894 | |
| 6895 | requires_ipv6 |
| 6896 | run_test "DTLS cookie: enabled, IPv6" \ |
| 6897 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 6898 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 6899 | 0 \ |
| 6900 | -s "cookie verification failed" \ |
| 6901 | -s "cookie verification passed" \ |
| 6902 | -S "cookie verification skipped" \ |
| 6903 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6904 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6905 | -S "SSL - The requested feature is not available" |
| 6906 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6907 | run_test "DTLS cookie: enabled, nbio" \ |
| 6908 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 6909 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6910 | 0 \ |
| 6911 | -s "cookie verification failed" \ |
| 6912 | -s "cookie verification passed" \ |
| 6913 | -S "cookie verification skipped" \ |
| 6914 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6915 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6916 | -S "SSL - The requested feature is not available" |
| 6917 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6918 | # Tests for client reconnecting from the same port with DTLS |
| 6919 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6920 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6921 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 6922 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 6923 | "$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] | 6924 | 0 \ |
| 6925 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6926 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6927 | -S "Client initiated reconnection from same port" |
| 6928 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6929 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6930 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 6931 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 6932 | "$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] | 6933 | 0 \ |
| 6934 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6935 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6936 | -s "Client initiated reconnection from same port" |
| 6937 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6938 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 6939 | 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] | 6940 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 6941 | "$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] | 6942 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6943 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6944 | -s "Client initiated reconnection from same port" |
| 6945 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6946 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 6947 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 6948 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 6949 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 6950 | 0 \ |
| 6951 | -S "The operation timed out" \ |
| 6952 | -s "Client initiated reconnection from same port" |
| 6953 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6954 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 6955 | "$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] | 6956 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 6957 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6958 | -s "The operation timed out" \ |
| 6959 | -S "Client initiated reconnection from same port" |
| 6960 | |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 6961 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 6962 | -p "$P_PXY inject_clihlo=1" \ |
| 6963 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 6964 | "$P_CLI dtls=1 exchanges=2" \ |
| 6965 | 0 \ |
| 6966 | -s "possible client reconnect from the same port" \ |
| 6967 | -S "Client initiated reconnection from same port" |
| 6968 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6969 | # Tests for various cases of client authentication with DTLS |
| 6970 | # (focused on handshake flows and message parsing) |
| 6971 | |
| 6972 | run_test "DTLS client auth: required" \ |
| 6973 | "$P_SRV dtls=1 auth_mode=required" \ |
| 6974 | "$P_CLI dtls=1" \ |
| 6975 | 0 \ |
| 6976 | -s "Verifying peer X.509 certificate... ok" |
| 6977 | |
| 6978 | run_test "DTLS client auth: optional, client has no cert" \ |
| 6979 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 6980 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 6981 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6982 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6983 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6984 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6985 | "$P_SRV dtls=1 auth_mode=none" \ |
| 6986 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 6987 | 0 \ |
| 6988 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6989 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6990 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 6991 | run_test "DTLS wrong PSK: badmac alert" \ |
| 6992 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 6993 | "$P_CLI dtls=1 psk=abc124" \ |
| 6994 | 1 \ |
| 6995 | -s "SSL - Verification of the message MAC failed" \ |
| 6996 | -c "SSL - A fatal alert message was received from our peer" |
| 6997 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 6998 | # Tests for receiving fragmented handshake messages with DTLS |
| 6999 | |
| 7000 | requires_gnutls |
| 7001 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 7002 | "$G_SRV -u --mtu 2048 -a" \ |
| 7003 | "$P_CLI dtls=1 debug_level=2" \ |
| 7004 | 0 \ |
| 7005 | -C "found fragmented DTLS handshake message" \ |
| 7006 | -C "error" |
| 7007 | |
| 7008 | requires_gnutls |
| 7009 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 7010 | "$G_SRV -u --mtu 512" \ |
| 7011 | "$P_CLI dtls=1 debug_level=2" \ |
| 7012 | 0 \ |
| 7013 | -c "found fragmented DTLS handshake message" \ |
| 7014 | -C "error" |
| 7015 | |
| 7016 | requires_gnutls |
| 7017 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 7018 | "$G_SRV -u --mtu 128" \ |
| 7019 | "$P_CLI dtls=1 debug_level=2" \ |
| 7020 | 0 \ |
| 7021 | -c "found fragmented DTLS handshake message" \ |
| 7022 | -C "error" |
| 7023 | |
| 7024 | requires_gnutls |
| 7025 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 7026 | "$G_SRV -u --mtu 128" \ |
| 7027 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7028 | 0 \ |
| 7029 | -c "found fragmented DTLS handshake message" \ |
| 7030 | -C "error" |
| 7031 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7032 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7033 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7034 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 7035 | "$G_SRV -u --mtu 256" \ |
| 7036 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 7037 | 0 \ |
| 7038 | -c "found fragmented DTLS handshake message" \ |
| 7039 | -c "client hello, adding renegotiation extension" \ |
| 7040 | -c "found renegotiation extension" \ |
| 7041 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7042 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7043 | -C "error" \ |
| 7044 | -s "Extra-header:" |
| 7045 | |
| 7046 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7047 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7048 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 7049 | "$G_SRV -u --mtu 256" \ |
| 7050 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 7051 | 0 \ |
| 7052 | -c "found fragmented DTLS handshake message" \ |
| 7053 | -c "client hello, adding renegotiation extension" \ |
| 7054 | -c "found renegotiation extension" \ |
| 7055 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7056 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7057 | -C "error" \ |
| 7058 | -s "Extra-header:" |
| 7059 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 7060 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 7061 | "$O_SRV -dtls -mtu 2048" \ |
| 7062 | "$P_CLI dtls=1 debug_level=2" \ |
| 7063 | 0 \ |
| 7064 | -C "found fragmented DTLS handshake message" \ |
| 7065 | -C "error" |
| 7066 | |
| 7067 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 7068 | "$O_SRV -dtls -mtu 768" \ |
| 7069 | "$P_CLI dtls=1 debug_level=2" \ |
| 7070 | 0 \ |
| 7071 | -c "found fragmented DTLS handshake message" \ |
| 7072 | -C "error" |
| 7073 | |
| 7074 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 7075 | "$O_SRV -dtls -mtu 256" \ |
| 7076 | "$P_CLI dtls=1 debug_level=2" \ |
| 7077 | 0 \ |
| 7078 | -c "found fragmented DTLS handshake message" \ |
| 7079 | -C "error" |
| 7080 | |
| 7081 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 7082 | "$O_SRV -dtls -mtu 256" \ |
| 7083 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7084 | 0 \ |
| 7085 | -c "found fragmented DTLS handshake message" \ |
| 7086 | -C "error" |
| 7087 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7088 | # Tests for sending fragmented handshake messages with DTLS |
| 7089 | # |
| 7090 | # Use client auth when we need the client to send large messages, |
| 7091 | # and use large cert chains on both sides too (the long chains we have all use |
| 7092 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 7093 | # Sizes reached (UDP payload): |
| 7094 | # - 2037B for server certificate |
| 7095 | # - 1542B for client certificate |
| 7096 | # - 1013B for newsessionticket |
| 7097 | # - all others below 512B |
| 7098 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 7099 | |
| 7100 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7101 | requires_config_enabled MBEDTLS_RSA_C |
| 7102 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7103 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7104 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7105 | run_test "DTLS fragmenting: none (for reference)" \ |
| 7106 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7107 | crt_file=data_files/server7_int-ca.crt \ |
| 7108 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7109 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7110 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7111 | "$P_CLI dtls=1 debug_level=2 \ |
| 7112 | crt_file=data_files/server8_int-ca2.crt \ |
| 7113 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7114 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7115 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7116 | 0 \ |
| 7117 | -S "found fragmented DTLS handshake message" \ |
| 7118 | -C "found fragmented DTLS handshake message" \ |
| 7119 | -C "error" |
| 7120 | |
| 7121 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7122 | requires_config_enabled MBEDTLS_RSA_C |
| 7123 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7124 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7125 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7126 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7127 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7128 | crt_file=data_files/server7_int-ca.crt \ |
| 7129 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7130 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7131 | max_frag_len=1024" \ |
| 7132 | "$P_CLI dtls=1 debug_level=2 \ |
| 7133 | crt_file=data_files/server8_int-ca2.crt \ |
| 7134 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7135 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7136 | max_frag_len=2048" \ |
| 7137 | 0 \ |
| 7138 | -S "found fragmented DTLS handshake message" \ |
| 7139 | -c "found fragmented DTLS handshake message" \ |
| 7140 | -C "error" |
| 7141 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7142 | # With the MFL extension, the server has no way of forcing |
| 7143 | # the client to not exceed a certain MTU; hence, the following |
| 7144 | # test can't be replicated with an MTU proxy such as the one |
| 7145 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7146 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7147 | requires_config_enabled MBEDTLS_RSA_C |
| 7148 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7149 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7150 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7151 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7152 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7153 | crt_file=data_files/server7_int-ca.crt \ |
| 7154 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7155 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7156 | max_frag_len=512" \ |
| 7157 | "$P_CLI dtls=1 debug_level=2 \ |
| 7158 | crt_file=data_files/server8_int-ca2.crt \ |
| 7159 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7160 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7161 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7162 | 0 \ |
| 7163 | -S "found fragmented DTLS handshake message" \ |
| 7164 | -c "found fragmented DTLS handshake message" \ |
| 7165 | -C "error" |
| 7166 | |
| 7167 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7168 | requires_config_enabled MBEDTLS_RSA_C |
| 7169 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7170 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7171 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7172 | 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] | 7173 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 7174 | crt_file=data_files/server7_int-ca.crt \ |
| 7175 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7176 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7177 | max_frag_len=2048" \ |
| 7178 | "$P_CLI dtls=1 debug_level=2 \ |
| 7179 | crt_file=data_files/server8_int-ca2.crt \ |
| 7180 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7181 | hs_timeout=2500-60000 \ |
| 7182 | max_frag_len=1024" \ |
| 7183 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7184 | -S "found fragmented DTLS handshake message" \ |
| 7185 | -c "found fragmented DTLS handshake message" \ |
| 7186 | -C "error" |
| 7187 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7188 | # While not required by the standard defining the MFL extension |
| 7189 | # (according to which it only applies to records, not to datagrams), |
| 7190 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7191 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7192 | # to the peer. |
| 7193 | # The next test checks that no datagrams significantly larger than the |
| 7194 | # negotiated MFL are sent. |
| 7195 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7196 | requires_config_enabled MBEDTLS_RSA_C |
| 7197 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7198 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7199 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7200 | 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] | 7201 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7202 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 7203 | crt_file=data_files/server7_int-ca.crt \ |
| 7204 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7205 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7206 | max_frag_len=2048" \ |
| 7207 | "$P_CLI dtls=1 debug_level=2 \ |
| 7208 | crt_file=data_files/server8_int-ca2.crt \ |
| 7209 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7210 | hs_timeout=2500-60000 \ |
| 7211 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7212 | 0 \ |
| 7213 | -S "found fragmented DTLS handshake message" \ |
| 7214 | -c "found fragmented DTLS handshake message" \ |
| 7215 | -C "error" |
| 7216 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7217 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7218 | requires_config_enabled MBEDTLS_RSA_C |
| 7219 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7220 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7221 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7222 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7223 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7224 | crt_file=data_files/server7_int-ca.crt \ |
| 7225 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7226 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7227 | max_frag_len=2048" \ |
| 7228 | "$P_CLI dtls=1 debug_level=2 \ |
| 7229 | crt_file=data_files/server8_int-ca2.crt \ |
| 7230 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7231 | hs_timeout=2500-60000 \ |
| 7232 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7233 | 0 \ |
| 7234 | -s "found fragmented DTLS handshake message" \ |
| 7235 | -c "found fragmented DTLS handshake message" \ |
| 7236 | -C "error" |
| 7237 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7238 | # While not required by the standard defining the MFL extension |
| 7239 | # (according to which it only applies to records, not to datagrams), |
| 7240 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7241 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7242 | # to the peer. |
| 7243 | # The next test checks that no datagrams significantly larger than the |
| 7244 | # negotiated MFL are sent. |
| 7245 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7246 | requires_config_enabled MBEDTLS_RSA_C |
| 7247 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7248 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7249 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7250 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 7251 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7252 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7253 | crt_file=data_files/server7_int-ca.crt \ |
| 7254 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7255 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7256 | max_frag_len=2048" \ |
| 7257 | "$P_CLI dtls=1 debug_level=2 \ |
| 7258 | crt_file=data_files/server8_int-ca2.crt \ |
| 7259 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7260 | hs_timeout=2500-60000 \ |
| 7261 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7262 | 0 \ |
| 7263 | -s "found fragmented DTLS handshake message" \ |
| 7264 | -c "found fragmented DTLS handshake message" \ |
| 7265 | -C "error" |
| 7266 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7267 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7268 | requires_config_enabled MBEDTLS_RSA_C |
| 7269 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7270 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7271 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 7272 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7273 | crt_file=data_files/server7_int-ca.crt \ |
| 7274 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7275 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7276 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7277 | "$P_CLI dtls=1 debug_level=2 \ |
| 7278 | crt_file=data_files/server8_int-ca2.crt \ |
| 7279 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7280 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7281 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7282 | 0 \ |
| 7283 | -S "found fragmented DTLS handshake message" \ |
| 7284 | -C "found fragmented DTLS handshake message" \ |
| 7285 | -C "error" |
| 7286 | |
| 7287 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7288 | requires_config_enabled MBEDTLS_RSA_C |
| 7289 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7290 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7291 | run_test "DTLS fragmenting: client (MTU)" \ |
| 7292 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7293 | crt_file=data_files/server7_int-ca.crt \ |
| 7294 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7295 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7296 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7297 | "$P_CLI dtls=1 debug_level=2 \ |
| 7298 | crt_file=data_files/server8_int-ca2.crt \ |
| 7299 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7300 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7301 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7302 | 0 \ |
| 7303 | -s "found fragmented DTLS handshake message" \ |
| 7304 | -C "found fragmented DTLS handshake message" \ |
| 7305 | -C "error" |
| 7306 | |
| 7307 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7308 | requires_config_enabled MBEDTLS_RSA_C |
| 7309 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7310 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7311 | run_test "DTLS fragmenting: server (MTU)" \ |
| 7312 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7313 | crt_file=data_files/server7_int-ca.crt \ |
| 7314 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7315 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7316 | mtu=512" \ |
| 7317 | "$P_CLI dtls=1 debug_level=2 \ |
| 7318 | crt_file=data_files/server8_int-ca2.crt \ |
| 7319 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7320 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7321 | mtu=2048" \ |
| 7322 | 0 \ |
| 7323 | -S "found fragmented DTLS handshake message" \ |
| 7324 | -c "found fragmented DTLS handshake message" \ |
| 7325 | -C "error" |
| 7326 | |
| 7327 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7328 | requires_config_enabled MBEDTLS_RSA_C |
| 7329 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7330 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7331 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7332 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7333 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7334 | crt_file=data_files/server7_int-ca.crt \ |
| 7335 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7336 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 7337 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7338 | "$P_CLI dtls=1 debug_level=2 \ |
| 7339 | crt_file=data_files/server8_int-ca2.crt \ |
| 7340 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7341 | hs_timeout=2500-60000 \ |
| 7342 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7343 | 0 \ |
| 7344 | -s "found fragmented DTLS handshake message" \ |
| 7345 | -c "found fragmented DTLS handshake message" \ |
| 7346 | -C "error" |
| 7347 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7348 | # 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] | 7349 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7350 | requires_config_enabled MBEDTLS_RSA_C |
| 7351 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7352 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7353 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7354 | requires_config_enabled MBEDTLS_AES_C |
| 7355 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7356 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7357 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 7358 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7359 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7360 | crt_file=data_files/server7_int-ca.crt \ |
| 7361 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7362 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7363 | mtu=512" \ |
| 7364 | "$P_CLI dtls=1 debug_level=2 \ |
| 7365 | crt_file=data_files/server8_int-ca2.crt \ |
| 7366 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7367 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7368 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7369 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7370 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7371 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7372 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7373 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7374 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7375 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7376 | # 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] | 7377 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 7378 | # retransmissions, but in some cases (like both the server and client using |
| 7379 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 7380 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 7381 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7382 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7383 | requires_config_enabled MBEDTLS_RSA_C |
| 7384 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7385 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7386 | requires_config_enabled MBEDTLS_AES_C |
| 7387 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7388 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7389 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7390 | -p "$P_PXY mtu=508" \ |
| 7391 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7392 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7393 | key_file=data_files/server7.key \ |
| 7394 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7395 | "$P_CLI dtls=1 debug_level=2 \ |
| 7396 | crt_file=data_files/server8_int-ca2.crt \ |
| 7397 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7398 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7399 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7400 | 0 \ |
| 7401 | -s "found fragmented DTLS handshake message" \ |
| 7402 | -c "found fragmented DTLS handshake message" \ |
| 7403 | -C "error" |
| 7404 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7405 | # 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] | 7406 | only_with_valgrind |
| 7407 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7408 | requires_config_enabled MBEDTLS_RSA_C |
| 7409 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7410 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7411 | requires_config_enabled MBEDTLS_AES_C |
| 7412 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7413 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7414 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7415 | -p "$P_PXY mtu=508" \ |
| 7416 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7417 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7418 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7419 | hs_timeout=250-10000" \ |
| 7420 | "$P_CLI dtls=1 debug_level=2 \ |
| 7421 | crt_file=data_files/server8_int-ca2.crt \ |
| 7422 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7423 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7424 | hs_timeout=250-10000" \ |
| 7425 | 0 \ |
| 7426 | -s "found fragmented DTLS handshake message" \ |
| 7427 | -c "found fragmented DTLS handshake message" \ |
| 7428 | -C "error" |
| 7429 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7430 | # 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] | 7431 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7432 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7433 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7434 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7435 | requires_config_enabled MBEDTLS_RSA_C |
| 7436 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7437 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7438 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7439 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7440 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7441 | crt_file=data_files/server7_int-ca.crt \ |
| 7442 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7443 | hs_timeout=10000-60000 \ |
| 7444 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7445 | "$P_CLI dtls=1 debug_level=2 \ |
| 7446 | crt_file=data_files/server8_int-ca2.crt \ |
| 7447 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7448 | hs_timeout=10000-60000 \ |
| 7449 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7450 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7451 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7452 | -s "found fragmented DTLS handshake message" \ |
| 7453 | -c "found fragmented DTLS handshake message" \ |
| 7454 | -C "error" |
| 7455 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7456 | # 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] | 7457 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 7458 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7459 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7460 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7461 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7462 | requires_config_enabled MBEDTLS_RSA_C |
| 7463 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7464 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7465 | requires_config_enabled MBEDTLS_AES_C |
| 7466 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7467 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7468 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7469 | -p "$P_PXY mtu=512" \ |
| 7470 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7471 | crt_file=data_files/server7_int-ca.crt \ |
| 7472 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7473 | hs_timeout=10000-60000 \ |
| 7474 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7475 | "$P_CLI dtls=1 debug_level=2 \ |
| 7476 | crt_file=data_files/server8_int-ca2.crt \ |
| 7477 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7478 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7479 | hs_timeout=10000-60000 \ |
| 7480 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7481 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7482 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7483 | -s "found fragmented DTLS handshake message" \ |
| 7484 | -c "found fragmented DTLS handshake message" \ |
| 7485 | -C "error" |
| 7486 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7487 | not_with_valgrind # spurious autoreduction due to timeout |
| 7488 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7489 | requires_config_enabled MBEDTLS_RSA_C |
| 7490 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7491 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7492 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7493 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7494 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7495 | crt_file=data_files/server7_int-ca.crt \ |
| 7496 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7497 | hs_timeout=10000-60000 \ |
| 7498 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7499 | "$P_CLI dtls=1 debug_level=2 \ |
| 7500 | crt_file=data_files/server8_int-ca2.crt \ |
| 7501 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7502 | hs_timeout=10000-60000 \ |
| 7503 | mtu=1024 nbio=2" \ |
| 7504 | 0 \ |
| 7505 | -S "autoreduction" \ |
| 7506 | -s "found fragmented DTLS handshake message" \ |
| 7507 | -c "found fragmented DTLS handshake message" \ |
| 7508 | -C "error" |
| 7509 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7510 | # 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] | 7511 | not_with_valgrind # spurious autoreduction due to timeout |
| 7512 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7513 | requires_config_enabled MBEDTLS_RSA_C |
| 7514 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7515 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7516 | requires_config_enabled MBEDTLS_AES_C |
| 7517 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7518 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7519 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 7520 | -p "$P_PXY mtu=512" \ |
| 7521 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7522 | crt_file=data_files/server7_int-ca.crt \ |
| 7523 | key_file=data_files/server7.key \ |
| 7524 | hs_timeout=10000-60000 \ |
| 7525 | mtu=512 nbio=2" \ |
| 7526 | "$P_CLI dtls=1 debug_level=2 \ |
| 7527 | crt_file=data_files/server8_int-ca2.crt \ |
| 7528 | key_file=data_files/server8.key \ |
| 7529 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7530 | hs_timeout=10000-60000 \ |
| 7531 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7532 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7533 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7534 | -s "found fragmented DTLS handshake message" \ |
| 7535 | -c "found fragmented DTLS handshake message" \ |
| 7536 | -C "error" |
| 7537 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7538 | # 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] | 7539 | # This ensures things still work after session_reset(). |
| 7540 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7541 | # Since we don't support reading fragmented ClientHello yet, |
| 7542 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 7543 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7544 | # An autoreduction on the client-side might happen if the server is |
| 7545 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 7546 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7547 | # resumed listening, which would result in a spurious autoreduction. |
| 7548 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7549 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7550 | requires_config_enabled MBEDTLS_RSA_C |
| 7551 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7552 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7553 | requires_config_enabled MBEDTLS_AES_C |
| 7554 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7555 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7556 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 7557 | -p "$P_PXY mtu=1450" \ |
| 7558 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7559 | crt_file=data_files/server7_int-ca.crt \ |
| 7560 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7561 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7562 | mtu=1450" \ |
| 7563 | "$P_CLI dtls=1 debug_level=2 \ |
| 7564 | crt_file=data_files/server8_int-ca2.crt \ |
| 7565 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7566 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7567 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 7568 | 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] | 7569 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7570 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7571 | -s "found fragmented DTLS handshake message" \ |
| 7572 | -c "found fragmented DTLS handshake message" \ |
| 7573 | -C "error" |
| 7574 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7575 | # An autoreduction on the client-side might happen if the server is |
| 7576 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7577 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7578 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7579 | requires_config_enabled MBEDTLS_RSA_C |
| 7580 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7581 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7582 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7583 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7584 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7585 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7586 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 7587 | -p "$P_PXY mtu=512" \ |
| 7588 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7589 | crt_file=data_files/server7_int-ca.crt \ |
| 7590 | key_file=data_files/server7.key \ |
| 7591 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7592 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7593 | mtu=512" \ |
| 7594 | "$P_CLI dtls=1 debug_level=2 \ |
| 7595 | crt_file=data_files/server8_int-ca2.crt \ |
| 7596 | key_file=data_files/server8.key \ |
| 7597 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7598 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7599 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7600 | mtu=512" \ |
| 7601 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7602 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7603 | -s "found fragmented DTLS handshake message" \ |
| 7604 | -c "found fragmented DTLS handshake message" \ |
| 7605 | -C "error" |
| 7606 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7607 | # An autoreduction on the client-side might happen if the server is |
| 7608 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7609 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7610 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7611 | requires_config_enabled MBEDTLS_RSA_C |
| 7612 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7613 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7614 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7615 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7616 | requires_config_enabled MBEDTLS_AES_C |
| 7617 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7618 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7619 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 7620 | -p "$P_PXY mtu=512" \ |
| 7621 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7622 | crt_file=data_files/server7_int-ca.crt \ |
| 7623 | key_file=data_files/server7.key \ |
| 7624 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7625 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7626 | mtu=512" \ |
| 7627 | "$P_CLI dtls=1 debug_level=2 \ |
| 7628 | crt_file=data_files/server8_int-ca2.crt \ |
| 7629 | key_file=data_files/server8.key \ |
| 7630 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7631 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7632 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7633 | mtu=512" \ |
| 7634 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7635 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7636 | -s "found fragmented DTLS handshake message" \ |
| 7637 | -c "found fragmented DTLS handshake message" \ |
| 7638 | -C "error" |
| 7639 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7640 | # An autoreduction on the client-side might happen if the server is |
| 7641 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7642 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7643 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7644 | requires_config_enabled MBEDTLS_RSA_C |
| 7645 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7646 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7647 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7648 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7649 | requires_config_enabled MBEDTLS_AES_C |
| 7650 | requires_config_enabled MBEDTLS_CCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7651 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7652 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7653 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7654 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7655 | crt_file=data_files/server7_int-ca.crt \ |
| 7656 | key_file=data_files/server7.key \ |
| 7657 | exchanges=2 renegotiation=1 \ |
| 7658 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7659 | hs_timeout=10000-60000 \ |
| 7660 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7661 | "$P_CLI dtls=1 debug_level=2 \ |
| 7662 | crt_file=data_files/server8_int-ca2.crt \ |
| 7663 | key_file=data_files/server8.key \ |
| 7664 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7665 | hs_timeout=10000-60000 \ |
| 7666 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7667 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7668 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7669 | -s "found fragmented DTLS handshake message" \ |
| 7670 | -c "found fragmented DTLS handshake message" \ |
| 7671 | -C "error" |
| 7672 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7673 | # An autoreduction on the client-side might happen if the server is |
| 7674 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7675 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7676 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7677 | requires_config_enabled MBEDTLS_RSA_C |
| 7678 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7679 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7680 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7681 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7682 | requires_config_enabled MBEDTLS_AES_C |
| 7683 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7684 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7685 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7686 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7687 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7688 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7689 | crt_file=data_files/server7_int-ca.crt \ |
| 7690 | key_file=data_files/server7.key \ |
| 7691 | exchanges=2 renegotiation=1 \ |
| 7692 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7693 | hs_timeout=10000-60000 \ |
| 7694 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7695 | "$P_CLI dtls=1 debug_level=2 \ |
| 7696 | crt_file=data_files/server8_int-ca2.crt \ |
| 7697 | key_file=data_files/server8.key \ |
| 7698 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7699 | hs_timeout=10000-60000 \ |
| 7700 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7701 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7702 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7703 | -s "found fragmented DTLS handshake message" \ |
| 7704 | -c "found fragmented DTLS handshake message" \ |
| 7705 | -C "error" |
| 7706 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7707 | # An autoreduction on the client-side might happen if the server is |
| 7708 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7709 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7710 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7711 | requires_config_enabled MBEDTLS_RSA_C |
| 7712 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7713 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7714 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7715 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7716 | requires_config_enabled MBEDTLS_AES_C |
| 7717 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7718 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7719 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7720 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7721 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7722 | crt_file=data_files/server7_int-ca.crt \ |
| 7723 | key_file=data_files/server7.key \ |
| 7724 | exchanges=2 renegotiation=1 \ |
| 7725 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7726 | hs_timeout=10000-60000 \ |
| 7727 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7728 | "$P_CLI dtls=1 debug_level=2 \ |
| 7729 | crt_file=data_files/server8_int-ca2.crt \ |
| 7730 | key_file=data_files/server8.key \ |
| 7731 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7732 | hs_timeout=10000-60000 \ |
| 7733 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7734 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7735 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7736 | -s "found fragmented DTLS handshake message" \ |
| 7737 | -c "found fragmented DTLS handshake message" \ |
| 7738 | -C "error" |
| 7739 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7740 | # 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] | 7741 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7742 | requires_config_enabled MBEDTLS_RSA_C |
| 7743 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7744 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7745 | requires_config_enabled MBEDTLS_AES_C |
| 7746 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7747 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7748 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7749 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 7750 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7751 | "$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] | 7752 | crt_file=data_files/server7_int-ca.crt \ |
| 7753 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7754 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7755 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7756 | crt_file=data_files/server8_int-ca2.crt \ |
| 7757 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7758 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7759 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7760 | 0 \ |
| 7761 | -s "found fragmented DTLS handshake message" \ |
| 7762 | -c "found fragmented DTLS handshake message" \ |
| 7763 | -C "error" |
| 7764 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7765 | # 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] | 7766 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7767 | requires_config_enabled MBEDTLS_RSA_C |
| 7768 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7769 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7770 | requires_config_enabled MBEDTLS_AES_C |
| 7771 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7772 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7773 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7774 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 7775 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 7776 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7777 | crt_file=data_files/server7_int-ca.crt \ |
| 7778 | key_file=data_files/server7.key \ |
| 7779 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7780 | "$P_CLI dtls=1 debug_level=2 \ |
| 7781 | crt_file=data_files/server8_int-ca2.crt \ |
| 7782 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7783 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7784 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7785 | 0 \ |
| 7786 | -s "found fragmented DTLS handshake message" \ |
| 7787 | -c "found fragmented DTLS handshake message" \ |
| 7788 | -C "error" |
| 7789 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7790 | # interop tests for DTLS fragmentating with reliable connection |
| 7791 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7792 | # here and below we just want to test that the we fragment in a way that |
| 7793 | # pleases other implementations, so we don't need the peer to fragment |
| 7794 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7795 | requires_config_enabled MBEDTLS_RSA_C |
| 7796 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7797 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7798 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7799 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7800 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 7801 | "$G_SRV -u" \ |
| 7802 | "$P_CLI dtls=1 debug_level=2 \ |
| 7803 | crt_file=data_files/server8_int-ca2.crt \ |
| 7804 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7805 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7806 | 0 \ |
| 7807 | -c "fragmenting handshake message" \ |
| 7808 | -C "error" |
| 7809 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 7810 | # We use --insecure for the GnuTLS client because it expects |
| 7811 | # the hostname / IP it connects to to be the name used in the |
| 7812 | # certificate obtained from the server. Here, however, it |
| 7813 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 7814 | # as the server name in the certificate. This will make the |
| 7815 | # certifiate validation fail, but passing --insecure makes |
| 7816 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7817 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7818 | requires_config_enabled MBEDTLS_RSA_C |
| 7819 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7820 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7821 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 7822 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7823 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7824 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7825 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7826 | crt_file=data_files/server7_int-ca.crt \ |
| 7827 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7828 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7829 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7830 | 0 \ |
| 7831 | -s "fragmenting handshake message" |
| 7832 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7833 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7834 | requires_config_enabled MBEDTLS_RSA_C |
| 7835 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7836 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7837 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7838 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 7839 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7840 | "$P_CLI dtls=1 debug_level=2 \ |
| 7841 | crt_file=data_files/server8_int-ca2.crt \ |
| 7842 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7843 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7844 | 0 \ |
| 7845 | -c "fragmenting handshake message" \ |
| 7846 | -C "error" |
| 7847 | |
| 7848 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7849 | requires_config_enabled MBEDTLS_RSA_C |
| 7850 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7851 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7852 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7853 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 7854 | "$P_SRV dtls=1 debug_level=2 \ |
| 7855 | crt_file=data_files/server7_int-ca.crt \ |
| 7856 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7857 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7858 | "$O_CLI -dtls1_2" \ |
| 7859 | 0 \ |
| 7860 | -s "fragmenting handshake message" |
| 7861 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7862 | # interop tests for DTLS fragmentating with unreliable connection |
| 7863 | # |
| 7864 | # again we just want to test that the we fragment in a way that |
| 7865 | # pleases other implementations, so we don't need the peer to fragment |
| 7866 | requires_gnutls_next |
| 7867 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7868 | requires_config_enabled MBEDTLS_RSA_C |
| 7869 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7870 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7871 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7872 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7873 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 7874 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7875 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7876 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7877 | crt_file=data_files/server8_int-ca2.crt \ |
| 7878 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7879 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7880 | 0 \ |
| 7881 | -c "fragmenting handshake message" \ |
| 7882 | -C "error" |
| 7883 | |
| 7884 | requires_gnutls_next |
| 7885 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7886 | requires_config_enabled MBEDTLS_RSA_C |
| 7887 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7888 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7889 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7890 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7891 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 7892 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7893 | "$P_SRV dtls=1 debug_level=2 \ |
| 7894 | crt_file=data_files/server7_int-ca.crt \ |
| 7895 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7896 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 7897 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7898 | 0 \ |
| 7899 | -s "fragmenting handshake message" |
| 7900 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7901 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 7902 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7903 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7904 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 7905 | ## (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] | 7906 | skip_next_test |
| 7907 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7908 | requires_config_enabled MBEDTLS_RSA_C |
| 7909 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7910 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7911 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7912 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7913 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 7914 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7915 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7916 | "$P_CLI dtls=1 debug_level=2 \ |
| 7917 | crt_file=data_files/server8_int-ca2.crt \ |
| 7918 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7919 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7920 | 0 \ |
| 7921 | -c "fragmenting handshake message" \ |
| 7922 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7923 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7924 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7925 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7926 | requires_config_enabled MBEDTLS_RSA_C |
| 7927 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7928 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7929 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7930 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7931 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 7932 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7933 | "$P_SRV dtls=1 debug_level=2 \ |
| 7934 | crt_file=data_files/server7_int-ca.crt \ |
| 7935 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7936 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7937 | "$O_CLI -dtls1_2" \ |
| 7938 | 0 \ |
| 7939 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7940 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7941 | # Tests for DTLS-SRTP (RFC 5764) |
| 7942 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7943 | run_test "DTLS-SRTP all profiles supported" \ |
| 7944 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7945 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7946 | 0 \ |
| 7947 | -s "found use_srtp extension" \ |
| 7948 | -s "found srtp profile" \ |
| 7949 | -s "selected srtp profile" \ |
| 7950 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7951 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7952 | -c "client hello, adding use_srtp extension" \ |
| 7953 | -c "found use_srtp extension" \ |
| 7954 | -c "found srtp profile" \ |
| 7955 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7956 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7957 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7958 | -C "error" |
| 7959 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7960 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7961 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7962 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 7963 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7964 | "$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] | 7965 | 0 \ |
| 7966 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7967 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 7968 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7969 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7970 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7971 | -c "client hello, adding use_srtp extension" \ |
| 7972 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7973 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7974 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7975 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7976 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7977 | -C "error" |
| 7978 | |
| 7979 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7980 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7981 | "$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] | 7982 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7983 | 0 \ |
| 7984 | -s "found use_srtp extension" \ |
| 7985 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7986 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7987 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7988 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7989 | -c "client hello, adding use_srtp extension" \ |
| 7990 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7991 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7992 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7993 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7994 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7995 | -C "error" |
| 7996 | |
| 7997 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7998 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 7999 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8000 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8001 | 0 \ |
| 8002 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8003 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8004 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8005 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8006 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8007 | -c "client hello, adding use_srtp extension" \ |
| 8008 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8009 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8010 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8011 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8012 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8013 | -C "error" |
| 8014 | |
| 8015 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8016 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 8017 | "$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] | 8018 | "$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] | 8019 | 0 \ |
| 8020 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8021 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8022 | -S "selected srtp profile" \ |
| 8023 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8024 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8025 | -c "client hello, adding use_srtp extension" \ |
| 8026 | -C "found use_srtp extension" \ |
| 8027 | -C "found srtp profile" \ |
| 8028 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8029 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8030 | -C "error" |
| 8031 | |
| 8032 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8033 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 8034 | "$P_SRV dtls=1 debug_level=3" \ |
| 8035 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8036 | 0 \ |
| 8037 | -s "found use_srtp extension" \ |
| 8038 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8039 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8040 | -c "client hello, adding use_srtp extension" \ |
| 8041 | -C "found use_srtp extension" \ |
| 8042 | -C "found srtp profile" \ |
| 8043 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8044 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8045 | -C "error" |
| 8046 | |
| 8047 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8048 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 8049 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 8050 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8051 | 0 \ |
| 8052 | -s "found use_srtp extension" \ |
| 8053 | -s "found srtp profile" \ |
| 8054 | -s "selected srtp profile" \ |
| 8055 | -s "server hello, adding use_srtp extension" \ |
| 8056 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8057 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8058 | -c "client hello, adding use_srtp extension" \ |
| 8059 | -c "found use_srtp extension" \ |
| 8060 | -c "found srtp profile" \ |
| 8061 | -c "selected srtp profile" \ |
| 8062 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8063 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8064 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8065 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 8066 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8067 | -C "error" |
| 8068 | |
| 8069 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8070 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 8071 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8072 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8073 | 0 \ |
| 8074 | -s "found use_srtp extension" \ |
| 8075 | -s "found srtp profile" \ |
| 8076 | -s "selected srtp profile" \ |
| 8077 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8078 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 8079 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8080 | -S "dumping 'using mki' (8 bytes)" \ |
| 8081 | -c "client hello, adding use_srtp extension" \ |
| 8082 | -c "found use_srtp extension" \ |
| 8083 | -c "found srtp profile" \ |
| 8084 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8085 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 8086 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8087 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8088 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8089 | -C "dumping 'received mki' (8 bytes)" \ |
| 8090 | -C "error" |
| 8091 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8092 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8093 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 8094 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8095 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8096 | 0 \ |
| 8097 | -s "found use_srtp extension" \ |
| 8098 | -s "found srtp profile" \ |
| 8099 | -s "selected srtp profile" \ |
| 8100 | -s "server hello, adding use_srtp extension" \ |
| 8101 | -s "DTLS-SRTP key material is"\ |
| 8102 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 8103 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 8104 | |
| 8105 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8106 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 8107 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8108 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8109 | 0 \ |
| 8110 | -s "found use_srtp extension" \ |
| 8111 | -s "found srtp profile" \ |
| 8112 | -s "selected srtp profile" \ |
| 8113 | -s "server hello, adding use_srtp extension" \ |
| 8114 | -s "DTLS-SRTP key material is"\ |
| 8115 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 8116 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8117 | |
| 8118 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8119 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 8120 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8121 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8122 | 0 \ |
| 8123 | -s "found use_srtp extension" \ |
| 8124 | -s "found srtp profile" \ |
| 8125 | -s "selected srtp profile" \ |
| 8126 | -s "server hello, adding use_srtp extension" \ |
| 8127 | -s "DTLS-SRTP key material is"\ |
| 8128 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 8129 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8130 | |
| 8131 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8132 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 8133 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8134 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8135 | 0 \ |
| 8136 | -s "found use_srtp extension" \ |
| 8137 | -s "found srtp profile" \ |
| 8138 | -s "selected srtp profile" \ |
| 8139 | -s "server hello, adding use_srtp extension" \ |
| 8140 | -s "DTLS-SRTP key material is"\ |
| 8141 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 8142 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8143 | |
| 8144 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8145 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 8146 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8147 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8148 | 0 \ |
| 8149 | -s "found use_srtp extension" \ |
| 8150 | -s "found srtp profile" \ |
| 8151 | -s "selected srtp profile" \ |
| 8152 | -s "server hello, adding use_srtp extension" \ |
| 8153 | -s "DTLS-SRTP key material is"\ |
| 8154 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 8155 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8156 | |
| 8157 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8158 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 8159 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 8160 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8161 | 0 \ |
| 8162 | -s "found use_srtp extension" \ |
| 8163 | -s "found srtp profile" \ |
| 8164 | -S "selected srtp profile" \ |
| 8165 | -S "server hello, adding use_srtp extension" \ |
| 8166 | -S "DTLS-SRTP key material is"\ |
| 8167 | -C "SRTP Extension negotiated, profile" |
| 8168 | |
| 8169 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8170 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 8171 | "$P_SRV dtls=1 debug_level=3" \ |
| 8172 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8173 | 0 \ |
| 8174 | -s "found use_srtp extension" \ |
| 8175 | -S "server hello, adding use_srtp extension" \ |
| 8176 | -S "DTLS-SRTP key material is"\ |
| 8177 | -C "SRTP Extension negotiated, profile" |
| 8178 | |
| 8179 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8180 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 8181 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8182 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8183 | 0 \ |
| 8184 | -c "client hello, adding use_srtp extension" \ |
| 8185 | -c "found use_srtp extension" \ |
| 8186 | -c "found srtp profile" \ |
| 8187 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 8188 | -c "DTLS-SRTP key material is"\ |
| 8189 | -C "error" |
| 8190 | |
| 8191 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8192 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 8193 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8194 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8195 | 0 \ |
| 8196 | -c "client hello, adding use_srtp extension" \ |
| 8197 | -c "found use_srtp extension" \ |
| 8198 | -c "found srtp profile" \ |
| 8199 | -c "selected srtp profile" \ |
| 8200 | -c "DTLS-SRTP key material is"\ |
| 8201 | -C "error" |
| 8202 | |
| 8203 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8204 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 8205 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8206 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8207 | 0 \ |
| 8208 | -c "client hello, adding use_srtp extension" \ |
| 8209 | -c "found use_srtp extension" \ |
| 8210 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8211 | -c "selected srtp profile" \ |
| 8212 | -c "DTLS-SRTP key material is"\ |
| 8213 | -C "error" |
| 8214 | |
| 8215 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8216 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 8217 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8218 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8219 | 0 \ |
| 8220 | -c "client hello, adding use_srtp extension" \ |
| 8221 | -c "found use_srtp extension" \ |
| 8222 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8223 | -c "selected srtp profile" \ |
| 8224 | -c "DTLS-SRTP key material is"\ |
| 8225 | -C "error" |
| 8226 | |
| 8227 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8228 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 8229 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8230 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8231 | 0 \ |
| 8232 | -c "client hello, adding use_srtp extension" \ |
| 8233 | -c "found use_srtp extension" \ |
| 8234 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8235 | -c "selected srtp profile" \ |
| 8236 | -c "DTLS-SRTP key material is"\ |
| 8237 | -C "error" |
| 8238 | |
| 8239 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8240 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 8241 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8242 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 8243 | 0 \ |
| 8244 | -c "client hello, adding use_srtp extension" \ |
| 8245 | -C "found use_srtp extension" \ |
| 8246 | -C "found srtp profile" \ |
| 8247 | -C "selected srtp profile" \ |
| 8248 | -C "DTLS-SRTP key material is"\ |
| 8249 | -C "error" |
| 8250 | |
| 8251 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8252 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 8253 | "$O_SRV -dtls" \ |
| 8254 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8255 | 0 \ |
| 8256 | -c "client hello, adding use_srtp extension" \ |
| 8257 | -C "found use_srtp extension" \ |
| 8258 | -C "found srtp profile" \ |
| 8259 | -C "selected srtp profile" \ |
| 8260 | -C "DTLS-SRTP key material is"\ |
| 8261 | -C "error" |
| 8262 | |
| 8263 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8264 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 8265 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8266 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8267 | 0 \ |
| 8268 | -c "client hello, adding use_srtp extension" \ |
| 8269 | -c "found use_srtp extension" \ |
| 8270 | -c "found srtp profile" \ |
| 8271 | -c "selected srtp profile" \ |
| 8272 | -c "DTLS-SRTP key material is"\ |
| 8273 | -c "DTLS-SRTP no mki value negotiated"\ |
| 8274 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8275 | -C "dumping 'received mki' (8 bytes)" \ |
| 8276 | -C "error" |
| 8277 | |
| 8278 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8279 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8280 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8281 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8282 | "$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] | 8283 | 0 \ |
| 8284 | -s "found use_srtp extension" \ |
| 8285 | -s "found srtp profile" \ |
| 8286 | -s "selected srtp profile" \ |
| 8287 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8288 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8289 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 8290 | |
| 8291 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8292 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8293 | 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] | 8294 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8295 | "$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] | 8296 | 0 \ |
| 8297 | -s "found use_srtp extension" \ |
| 8298 | -s "found srtp profile" \ |
| 8299 | -s "selected srtp profile" \ |
| 8300 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8301 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8302 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 8303 | |
| 8304 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8305 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8306 | 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] | 8307 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8308 | "$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] | 8309 | 0 \ |
| 8310 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8311 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8312 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8313 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8314 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8315 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 8316 | |
| 8317 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8318 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8319 | 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] | 8320 | "$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] | 8321 | "$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] | 8322 | 0 \ |
| 8323 | -s "found use_srtp extension" \ |
| 8324 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8325 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8326 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8327 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8328 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 8329 | |
| 8330 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8331 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8332 | 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] | 8333 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8334 | "$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] | 8335 | 0 \ |
| 8336 | -s "found use_srtp extension" \ |
| 8337 | -s "found srtp profile" \ |
| 8338 | -s "selected srtp profile" \ |
| 8339 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8340 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8341 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 8342 | |
| 8343 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8344 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8345 | 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] | 8346 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 8347 | "$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] | 8348 | 0 \ |
| 8349 | -s "found use_srtp extension" \ |
| 8350 | -s "found srtp profile" \ |
| 8351 | -S "selected srtp profile" \ |
| 8352 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8353 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8354 | -C "SRTP profile:" |
| 8355 | |
| 8356 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8357 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8358 | 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] | 8359 | "$P_SRV dtls=1 debug_level=3" \ |
| 8360 | "$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] | 8361 | 0 \ |
| 8362 | -s "found use_srtp extension" \ |
| 8363 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8364 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8365 | -C "SRTP profile:" |
| 8366 | |
| 8367 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8368 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8369 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 8370 | "$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" \ |
| 8371 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8372 | 0 \ |
| 8373 | -c "client hello, adding use_srtp extension" \ |
| 8374 | -c "found use_srtp extension" \ |
| 8375 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8376 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8377 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8378 | -C "error" |
| 8379 | |
| 8380 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8381 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8382 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 8383 | "$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" \ |
| 8384 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8385 | 0 \ |
| 8386 | -c "client hello, adding use_srtp extension" \ |
| 8387 | -c "found use_srtp extension" \ |
| 8388 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8389 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8390 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8391 | -C "error" |
| 8392 | |
| 8393 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8394 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8395 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 8396 | "$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" \ |
| 8397 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8398 | 0 \ |
| 8399 | -c "client hello, adding use_srtp extension" \ |
| 8400 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8401 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8402 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8403 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8404 | -C "error" |
| 8405 | |
| 8406 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8407 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8408 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 8409 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8410 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8411 | 0 \ |
| 8412 | -c "client hello, adding use_srtp extension" \ |
| 8413 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8414 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8415 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8416 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8417 | -C "error" |
| 8418 | |
| 8419 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8420 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8421 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 8422 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8423 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8424 | 0 \ |
| 8425 | -c "client hello, adding use_srtp extension" \ |
| 8426 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8427 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8428 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8429 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8430 | -C "error" |
| 8431 | |
| 8432 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8433 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8434 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 8435 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8436 | "$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] | 8437 | 0 \ |
| 8438 | -c "client hello, adding use_srtp extension" \ |
| 8439 | -C "found use_srtp extension" \ |
| 8440 | -C "found srtp profile" \ |
| 8441 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8442 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8443 | -C "error" |
| 8444 | |
| 8445 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8446 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8447 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 8448 | "$G_SRV -u" \ |
| 8449 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8450 | 0 \ |
| 8451 | -c "client hello, adding use_srtp extension" \ |
| 8452 | -C "found use_srtp extension" \ |
| 8453 | -C "found srtp profile" \ |
| 8454 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8455 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8456 | -C "error" |
| 8457 | |
| 8458 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8459 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8460 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 8461 | "$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" \ |
| 8462 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8463 | 0 \ |
| 8464 | -c "client hello, adding use_srtp extension" \ |
| 8465 | -c "found use_srtp extension" \ |
| 8466 | -c "found srtp profile" \ |
| 8467 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8468 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 8469 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8470 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8471 | -c "dumping 'received mki' (8 bytes)" \ |
| 8472 | -C "error" |
| 8473 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 8474 | # Tests for specific things with "unreliable" UDP connection |
| 8475 | |
| 8476 | not_with_valgrind # spurious resend due to timeout |
| 8477 | run_test "DTLS proxy: reference" \ |
| 8478 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8479 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 8480 | "$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] | 8481 | 0 \ |
| 8482 | -C "replayed record" \ |
| 8483 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 8484 | -C "Buffer record from epoch" \ |
| 8485 | -S "Buffer record from epoch" \ |
| 8486 | -C "ssl_buffer_message" \ |
| 8487 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8488 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8489 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8490 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8491 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8492 | -c "HTTP/1.0 200 OK" |
| 8493 | |
| 8494 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8495 | run_test "DTLS proxy: duplicate every packet" \ |
| 8496 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8497 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 8498 | "$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] | 8499 | 0 \ |
| 8500 | -c "replayed record" \ |
| 8501 | -s "replayed record" \ |
| 8502 | -c "record from another epoch" \ |
| 8503 | -s "record from another epoch" \ |
| 8504 | -S "resend" \ |
| 8505 | -s "Extra-header:" \ |
| 8506 | -c "HTTP/1.0 200 OK" |
| 8507 | |
| 8508 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 8509 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8510 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 8511 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8512 | 0 \ |
| 8513 | -c "replayed record" \ |
| 8514 | -S "replayed record" \ |
| 8515 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8516 | -s "record from another epoch" \ |
| 8517 | -c "resend" \ |
| 8518 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8519 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8520 | -c "HTTP/1.0 200 OK" |
| 8521 | |
| 8522 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 8523 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8524 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8525 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8526 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8527 | -c "next record in same datagram" \ |
| 8528 | -s "next record in same datagram" |
| 8529 | |
| 8530 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 8531 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8532 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8533 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8534 | 0 \ |
| 8535 | -c "next record in same datagram" \ |
| 8536 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8537 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8538 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 8539 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8540 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 8541 | "$P_CLI dtls=1 dgram_packing=0 debug_level=1 read_timeout=100" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8542 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8543 | -c "discarding invalid record (mac)" \ |
| 8544 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8545 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8546 | -c "HTTP/1.0 200 OK" \ |
| 8547 | -S "too many records with bad MAC" \ |
| 8548 | -S "Verification of the message MAC failed" |
| 8549 | |
| 8550 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 8551 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8552 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 8553 | "$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] | 8554 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8555 | -C "discarding invalid record (mac)" \ |
| 8556 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8557 | -S "Extra-header:" \ |
| 8558 | -C "HTTP/1.0 200 OK" \ |
| 8559 | -s "too many records with bad MAC" \ |
| 8560 | -s "Verification of the message MAC failed" |
| 8561 | |
| 8562 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 8563 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8564 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 8565 | "$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] | 8566 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8567 | -c "discarding invalid record (mac)" \ |
| 8568 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8569 | -s "Extra-header:" \ |
| 8570 | -c "HTTP/1.0 200 OK" \ |
| 8571 | -S "too many records with bad MAC" \ |
| 8572 | -S "Verification of the message MAC failed" |
| 8573 | |
| 8574 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 8575 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8576 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 8577 | "$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] | 8578 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8579 | -c "discarding invalid record (mac)" \ |
| 8580 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8581 | -s "Extra-header:" \ |
| 8582 | -c "HTTP/1.0 200 OK" \ |
| 8583 | -s "too many records with bad MAC" \ |
| 8584 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8585 | |
| 8586 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 8587 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 8588 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 8589 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8590 | 0 \ |
| 8591 | -c "record from another epoch" \ |
| 8592 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8593 | -s "Extra-header:" \ |
| 8594 | -c "HTTP/1.0 200 OK" |
| 8595 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8596 | # Tests for reordering support with DTLS |
| 8597 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8598 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 8599 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8600 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8601 | hs_timeout=2500-60000" \ |
| 8602 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8603 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8604 | 0 \ |
| 8605 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8606 | -c "Next handshake message has been buffered - load"\ |
| 8607 | -S "Buffering HS message" \ |
| 8608 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8609 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8610 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8611 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8612 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8613 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8614 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 8615 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8616 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8617 | hs_timeout=2500-60000" \ |
| 8618 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8619 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8620 | 0 \ |
| 8621 | -c "Buffering HS message" \ |
| 8622 | -c "found fragmented DTLS handshake message"\ |
| 8623 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 8624 | -c "Next handshake message has been buffered - load"\ |
| 8625 | -S "Buffering HS message" \ |
| 8626 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8627 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8628 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8629 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8630 | -S "Remember CCS message" |
| 8631 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8632 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 8633 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 8634 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 8635 | # while keeping the ServerKeyExchange. |
| 8636 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 8637 | 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] | 8638 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8639 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8640 | hs_timeout=2500-60000" \ |
| 8641 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8642 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8643 | 0 \ |
| 8644 | -c "Buffering HS message" \ |
| 8645 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8646 | -C "attempt to make space by freeing buffered messages" \ |
| 8647 | -S "Buffering HS message" \ |
| 8648 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8649 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8650 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8651 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8652 | -S "Remember CCS message" |
| 8653 | |
| 8654 | # The size constraints ensure that the delayed certificate message can't |
| 8655 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 8656 | # when dropping it first. |
| 8657 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 8658 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 8659 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 8660 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8661 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8662 | hs_timeout=2500-60000" \ |
| 8663 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8664 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8665 | 0 \ |
| 8666 | -c "Buffering HS message" \ |
| 8667 | -c "attempt to make space by freeing buffered future messages" \ |
| 8668 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8669 | -S "Buffering HS message" \ |
| 8670 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8671 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8672 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8673 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8674 | -S "Remember CCS message" |
| 8675 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8676 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 8677 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8678 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 8679 | hs_timeout=2500-60000" \ |
| 8680 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8681 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8682 | 0 \ |
| 8683 | -C "Buffering HS message" \ |
| 8684 | -C "Next handshake message has been buffered - load"\ |
| 8685 | -s "Buffering HS message" \ |
| 8686 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8687 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8688 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8689 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8690 | -S "Remember CCS message" |
| 8691 | |
| 8692 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 8693 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8694 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8695 | hs_timeout=2500-60000" \ |
| 8696 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8697 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8698 | 0 \ |
| 8699 | -C "Buffering HS message" \ |
| 8700 | -C "Next handshake message has been buffered - load"\ |
| 8701 | -S "Buffering HS message" \ |
| 8702 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8703 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8704 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8705 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8706 | -S "Remember CCS message" |
| 8707 | |
| 8708 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 8709 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8710 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8711 | hs_timeout=2500-60000" \ |
| 8712 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8713 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8714 | 0 \ |
| 8715 | -C "Buffering HS message" \ |
| 8716 | -C "Next handshake message has been buffered - load"\ |
| 8717 | -S "Buffering HS message" \ |
| 8718 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8719 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8720 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8721 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8722 | -s "Remember CCS message" |
| 8723 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8724 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8725 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8726 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8727 | hs_timeout=2500-60000" \ |
| 8728 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8729 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 8730 | 0 \ |
| 8731 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8732 | -s "Found buffered record from current epoch - load" \ |
| 8733 | -c "Buffer record from epoch 1" \ |
| 8734 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8735 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8736 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 8737 | # from the server are delayed, so that the encrypted Finished message |
| 8738 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 8739 | # in afterwards, the encrypted Finished message must be freed in order |
| 8740 | # to make space for the NewSessionTicket to be reassembled. |
| 8741 | # This works only in very particular circumstances: |
| 8742 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 8743 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 8744 | # the encrypted Finished message. |
| 8745 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 8746 | # needs to be fragmented. |
| 8747 | # - All messages sent by the server must be small enough to be either sent |
| 8748 | # without fragmentation or be reassembled within the bounds of |
| 8749 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 8750 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 8751 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 8752 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8753 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 8754 | -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] | 8755 | "$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] | 8756 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 8757 | 0 \ |
| 8758 | -s "Buffer record from epoch 1" \ |
| 8759 | -s "Found buffered record from current epoch - load" \ |
| 8760 | -c "Buffer record from epoch 1" \ |
| 8761 | -C "Found buffered record from current epoch - load" \ |
| 8762 | -c "Enough space available after freeing future epoch record" |
| 8763 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 8764 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 8765 | |
| 8766 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8767 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 8768 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8769 | "$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] | 8770 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8771 | "$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] | 8772 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8773 | 0 \ |
| 8774 | -s "Extra-header:" \ |
| 8775 | -c "HTTP/1.0 200 OK" |
| 8776 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8777 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8778 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 8779 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8780 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8781 | "$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] | 8782 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8783 | 0 \ |
| 8784 | -s "Extra-header:" \ |
| 8785 | -c "HTTP/1.0 200 OK" |
| 8786 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8787 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8788 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 8789 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8790 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8791 | "$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] | 8792 | 0 \ |
| 8793 | -s "Extra-header:" \ |
| 8794 | -c "HTTP/1.0 200 OK" |
| 8795 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8796 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8797 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 8798 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8799 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 8800 | "$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] | 8801 | 0 \ |
| 8802 | -s "Extra-header:" \ |
| 8803 | -c "HTTP/1.0 200 OK" |
| 8804 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8805 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8806 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 8807 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8808 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 8809 | "$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] | 8810 | 0 \ |
| 8811 | -s "Extra-header:" \ |
| 8812 | -c "HTTP/1.0 200 OK" |
| 8813 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8814 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8815 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 8816 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8817 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 8818 | "$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] | 8819 | 0 \ |
| 8820 | -s "Extra-header:" \ |
| 8821 | -c "HTTP/1.0 200 OK" |
| 8822 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8823 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8824 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 8825 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8826 | "$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] | 8827 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8828 | "$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] | 8829 | 0 \ |
| 8830 | -s "Extra-header:" \ |
| 8831 | -c "HTTP/1.0 200 OK" |
| 8832 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8833 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 8834 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 8835 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8836 | "$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] | 8837 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8838 | "$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] | 8839 | 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] | 8840 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8841 | 0 \ |
| 8842 | -s "a session has been resumed" \ |
| 8843 | -c "a session has been resumed" \ |
| 8844 | -s "Extra-header:" \ |
| 8845 | -c "HTTP/1.0 200 OK" |
| 8846 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8847 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 8848 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 8849 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8850 | "$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] | 8851 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8852 | "$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] | 8853 | 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] | 8854 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 8855 | 0 \ |
| 8856 | -s "a session has been resumed" \ |
| 8857 | -c "a session has been resumed" \ |
| 8858 | -s "Extra-header:" \ |
| 8859 | -c "HTTP/1.0 200 OK" |
| 8860 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8861 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8862 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8863 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8864 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8865 | "$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] | 8866 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8867 | "$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] | 8868 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8869 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8870 | 0 \ |
| 8871 | -c "=> renegotiate" \ |
| 8872 | -s "=> renegotiate" \ |
| 8873 | -s "Extra-header:" \ |
| 8874 | -c "HTTP/1.0 200 OK" |
| 8875 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8876 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8877 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8878 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 8879 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8880 | "$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] | 8881 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8882 | "$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] | 8883 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8884 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8885 | 0 \ |
| 8886 | -c "=> renegotiate" \ |
| 8887 | -s "=> renegotiate" \ |
| 8888 | -s "Extra-header:" \ |
| 8889 | -c "HTTP/1.0 200 OK" |
| 8890 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8891 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8892 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8893 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 8894 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8895 | "$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] | 8896 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8897 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8898 | "$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] | 8899 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8900 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8901 | 0 \ |
| 8902 | -c "=> renegotiate" \ |
| 8903 | -s "=> renegotiate" \ |
| 8904 | -s "Extra-header:" \ |
| 8905 | -c "HTTP/1.0 200 OK" |
| 8906 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8907 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8908 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8909 | 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] | 8910 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8911 | "$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] | 8912 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8913 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8914 | "$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] | 8915 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8916 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8917 | 0 \ |
| 8918 | -c "=> renegotiate" \ |
| 8919 | -s "=> renegotiate" \ |
| 8920 | -s "Extra-header:" \ |
| 8921 | -c "HTTP/1.0 200 OK" |
| 8922 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8923 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 8924 | ## all versions installed on the CI machines), reported here: |
| 8925 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 8926 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8927 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 8928 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8929 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8930 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8931 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8932 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8933 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8934 | "$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] | 8935 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8936 | -c "HTTP/1.0 200 OK" |
| 8937 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8938 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8939 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8940 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8941 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 8942 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8943 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8944 | "$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] | 8945 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8946 | -c "HTTP/1.0 200 OK" |
| 8947 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8948 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8949 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8950 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8951 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 8952 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8953 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8954 | "$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] | 8955 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8956 | -c "HTTP/1.0 200 OK" |
| 8957 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 8958 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8959 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8960 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8961 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 8962 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 8963 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8964 | "$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] | 8965 | 0 \ |
| 8966 | -s "Extra-header:" \ |
| 8967 | -c "Extra-header:" |
| 8968 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8969 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8970 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8971 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8972 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 8973 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8974 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8975 | "$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] | 8976 | 0 \ |
| 8977 | -s "Extra-header:" \ |
| 8978 | -c "Extra-header:" |
| 8979 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8980 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8981 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8982 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8983 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 8984 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8985 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8986 | "$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] | 8987 | 0 \ |
| 8988 | -s "Extra-header:" \ |
| 8989 | -c "Extra-header:" |
| 8990 | |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8991 | run_test "export keys functionality" \ |
| 8992 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 8993 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 8994 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 8995 | -c "EAP-TLS key material is:"\ |
| 8996 | -s "EAP-TLS key material is:"\ |
| 8997 | -c "EAP-TLS IV is:" \ |
| 8998 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8999 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 9000 | # openssl feature tests: check if tls1.3 exists. |
| 9001 | requires_openssl_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9002 | run_test "TLS 1.3: Test openssl tls1_3 feature" \ |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 9003 | "$O_NEXT_SRV -tls1_3 -msg" \ |
| 9004 | "$O_NEXT_CLI -tls1_3 -msg" \ |
| 9005 | 0 \ |
| 9006 | -c "TLS 1.3" \ |
| 9007 | -s "TLS 1.3" |
| 9008 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 9009 | # 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] | 9010 | requires_gnutls_tls1_3 |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 9011 | requires_gnutls_next_no_ticket |
| 9012 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9013 | run_test "TLS 1.3: Test gnutls tls1_3 feature" \ |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 9014 | "$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] | 9015 | "$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] | 9016 | 0 \ |
| 9017 | -s "Version: TLS1.3" \ |
| 9018 | -c "Version: TLS1.3" |
| 9019 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 9020 | # TLS1.3 test cases |
| 9021 | # TODO: remove or rewrite this test case if #4832 is resolved. |
| 9022 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9023 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 9024 | skip_handshake_stage_check |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9025 | run_test "TLS 1.3: Not supported version check: tls12 and tls13" \ |
Xiaofei Bai | d25fab6 | 2021-12-02 06:36:27 +0000 | [diff] [blame] | 9026 | "$P_SRV debug_level=1 min_version=tls12 max_version=tls13" \ |
| 9027 | "$P_CLI debug_level=1 min_version=tls12 max_version=tls13" \ |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 9028 | 1 \ |
| 9029 | -s "SSL - The requested feature is not available" \ |
| 9030 | -c "SSL - The requested feature is not available" \ |
| 9031 | -s "Hybrid TLS 1.2 + TLS 1.3 configurations are not yet supported" \ |
| 9032 | -c "Hybrid TLS 1.2 + TLS 1.3 configurations are not yet supported" |
| 9033 | |
Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 9034 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9035 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9036 | run_test "TLS 1.3: handshake dispatch test: tls13 only" \ |
Xiaofei Bai | d25fab6 | 2021-12-02 06:36:27 +0000 | [diff] [blame] | 9037 | "$P_SRV debug_level=2 min_version=tls13 max_version=tls13" \ |
| 9038 | "$P_CLI debug_level=2 min_version=tls13 max_version=tls13" \ |
Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 9039 | 1 \ |
Jerry Yu | e3b3412 | 2021-09-28 17:53:35 +0800 | [diff] [blame] | 9040 | -s "tls13 server state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 9041 | -c "tls13 client state: MBEDTLS_SSL_HELLO_REQUEST" |
Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 9042 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 9043 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9044 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9045 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9046 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9047 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 42920ec | 2021-09-28 14:31:15 +0800 | [diff] [blame] | 9048 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9049 | run_test "TLS 1.3: minimal feature sets - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9050 | "$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] | 9051 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 9052 | 0 \ |
Jerry Yu | cdcc55f | 2021-11-11 13:26:33 +0800 | [diff] [blame] | 9053 | -c "tls13 client state: MBEDTLS_SSL_HELLO_REQUEST(0)" \ |
| 9054 | -c "tls13 client state: MBEDTLS_SSL_SERVER_HELLO(2)" \ |
| 9055 | -c "tls13 client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS(19)" \ |
| 9056 | -c "tls13 client state: MBEDTLS_SSL_CERTIFICATE_REQUEST(5)" \ |
| 9057 | -c "tls13 client state: MBEDTLS_SSL_SERVER_CERTIFICATE(3)" \ |
| 9058 | -c "tls13 client state: MBEDTLS_SSL_CERTIFICATE_VERIFY(9)" \ |
| 9059 | -c "tls13 client state: MBEDTLS_SSL_SERVER_FINISHED(13)" \ |
| 9060 | -c "tls13 client state: MBEDTLS_SSL_CLIENT_FINISHED(11)" \ |
| 9061 | -c "tls13 client state: MBEDTLS_SSL_FLUSH_BUFFERS(14)" \ |
| 9062 | -c "tls13 client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP(15)" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 9063 | -c "<= ssl_tls13_process_server_hello" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 9064 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 9065 | -c "ECDH curve: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 9066 | -c "=> ssl_tls13_process_server_hello" \ |
Jerry Yu | daac359 | 2021-10-29 20:01:42 +0800 | [diff] [blame] | 9067 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 9068 | -c "Certificate verification flags clear" \ |
Jerry Yu | 5398c10 | 2021-11-05 13:32:38 +0800 | [diff] [blame] | 9069 | -c "=> parse certificate verify" \ |
| 9070 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 9071 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 9072 | -c "<= parse finished message" \ |
| 9073 | -c "HTTP/1.0 200 ok" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 9074 | |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 9075 | requires_gnutls_tls1_3 |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 9076 | requires_gnutls_next_no_ticket |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9077 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9078 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9079 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9080 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 42920ec | 2021-09-28 14:31:15 +0800 | [diff] [blame] | 9081 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9082 | run_test "TLS 1.3: minimal feature sets - gnutls" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9083 | "$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] | 9084 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 9085 | 0 \ |
Jerry Yu | cdcc55f | 2021-11-11 13:26:33 +0800 | [diff] [blame] | 9086 | -s "SERVER HELLO was queued" \ |
| 9087 | -c "tls13 client state: MBEDTLS_SSL_HELLO_REQUEST(0)" \ |
| 9088 | -c "tls13 client state: MBEDTLS_SSL_SERVER_HELLO(2)" \ |
| 9089 | -c "tls13 client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS(19)" \ |
| 9090 | -c "tls13 client state: MBEDTLS_SSL_CERTIFICATE_REQUEST(5)" \ |
| 9091 | -c "tls13 client state: MBEDTLS_SSL_SERVER_CERTIFICATE(3)" \ |
| 9092 | -c "tls13 client state: MBEDTLS_SSL_CERTIFICATE_VERIFY(9)" \ |
| 9093 | -c "tls13 client state: MBEDTLS_SSL_SERVER_FINISHED(13)" \ |
| 9094 | -c "tls13 client state: MBEDTLS_SSL_CLIENT_FINISHED(11)" \ |
| 9095 | -c "tls13 client state: MBEDTLS_SSL_FLUSH_BUFFERS(14)" \ |
| 9096 | -c "tls13 client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP(15)" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 9097 | -c "<= ssl_tls13_process_server_hello" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 9098 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 9099 | -c "ECDH curve: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 9100 | -c "=> ssl_tls13_process_server_hello" \ |
Jerry Yu | daac359 | 2021-10-29 20:01:42 +0800 | [diff] [blame] | 9101 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 9102 | -c "Certificate verification flags clear" \ |
Jerry Yu | 5398c10 | 2021-11-05 13:32:38 +0800 | [diff] [blame] | 9103 | -c "=> parse certificate verify" \ |
| 9104 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 9105 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 9106 | -c "<= parse finished message" \ |
| 9107 | -c "HTTP/1.0 200 OK" |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 9108 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9109 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9110 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9111 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9112 | skip_handshake_stage_check |
| 9113 | requires_gnutls_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9114 | 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] | 9115 | "$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] | 9116 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9117 | 1 \ |
| 9118 | -s "Client's version: 3.3" \ |
| 9119 | -c "is a fatal alert message (msg 40)" \ |
| 9120 | -S "Version: TLS1.0" \ |
| 9121 | -C "Protocol is TLSv1.0" |
| 9122 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9123 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9124 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9125 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9126 | skip_handshake_stage_check |
| 9127 | requires_gnutls_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9128 | 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] | 9129 | "$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] | 9130 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9131 | 1 \ |
| 9132 | -s "Client's version: 3.3" \ |
| 9133 | -c "is a fatal alert message (msg 40)" \ |
| 9134 | -S "Version: TLS1.1" \ |
| 9135 | -C "Protocol is TLSv1.1" |
| 9136 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9137 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9138 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9139 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9140 | skip_handshake_stage_check |
| 9141 | requires_gnutls_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9142 | 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] | 9143 | "$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] | 9144 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9145 | 1 \ |
| 9146 | -s "Client's version: 3.3" \ |
| 9147 | -c "is a fatal alert message (msg 40)" \ |
| 9148 | -S "Version: TLS1.2" \ |
| 9149 | -C "Protocol is TLSv1.2" |
| 9150 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9151 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9152 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9153 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9154 | skip_handshake_stage_check |
| 9155 | requires_openssl_next |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9156 | 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] | 9157 | "$O_NEXT_SRV -msg -tls1" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9158 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9159 | 1 \ |
| 9160 | -s "fatal protocol_version" \ |
| 9161 | -c "is a fatal alert message (msg 70)" \ |
| 9162 | -S "Version: TLS1.0" \ |
| 9163 | -C "Protocol : TLSv1.0" |
| 9164 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9165 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9166 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9167 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9168 | skip_handshake_stage_check |
| 9169 | requires_openssl_next |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9170 | 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] | 9171 | "$O_NEXT_SRV -msg -tls1_1" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9172 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9173 | 1 \ |
| 9174 | -s "fatal protocol_version" \ |
| 9175 | -c "is a fatal alert message (msg 70)" \ |
| 9176 | -S "Version: TLS1.1" \ |
| 9177 | -C "Protocol : TLSv1.1" |
| 9178 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9179 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9180 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9181 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9182 | skip_handshake_stage_check |
| 9183 | requires_openssl_next |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9184 | 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] | 9185 | "$O_NEXT_SRV -msg -tls1_2" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9186 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9187 | 1 \ |
| 9188 | -s "fatal protocol_version" \ |
| 9189 | -c "is a fatal alert message (msg 70)" \ |
| 9190 | -S "Version: TLS1.2" \ |
| 9191 | -C "Protocol : TLSv1.2" |
| 9192 | |
Jerry Yu | 936dffd | 2021-11-22 18:34:36 +0800 | [diff] [blame] | 9193 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9194 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9195 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9196 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9197 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 936dffd | 2021-11-22 18:34:36 +0800 | [diff] [blame] | 9198 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9199 | run_test "TLS 1.3: CertificateRequest check - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9200 | "$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] | 9201 | "$P_CLI debug_level=4 force_version=tls13 " \ |
Jerry Yu | 936dffd | 2021-11-22 18:34:36 +0800 | [diff] [blame] | 9202 | 1 \ |
Xiaofei Bai | 5d8598e | 2022-01-11 05:56:06 +0000 | [diff] [blame] | 9203 | -c "=> parse certificate request" \ |
Xiaofei Bai | 69fcd39 | 2022-01-20 08:25:00 +0000 | [diff] [blame] | 9204 | -c "got a certificate request" \ |
Xiaofei Bai | 5d8598e | 2022-01-11 05:56:06 +0000 | [diff] [blame] | 9205 | -c "<= parse certificate request" |
Jerry Yu | 936dffd | 2021-11-22 18:34:36 +0800 | [diff] [blame] | 9206 | |
| 9207 | requires_gnutls_tls1_3 |
| 9208 | requires_gnutls_next_no_ticket |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9209 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9210 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9211 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9212 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 936dffd | 2021-11-22 18:34:36 +0800 | [diff] [blame] | 9213 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9214 | run_test "TLS 1.3: CertificateRequest check - gnutls" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9215 | "$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] | 9216 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
Jerry Yu | 936dffd | 2021-11-22 18:34:36 +0800 | [diff] [blame] | 9217 | 1 \ |
Xiaofei Bai | 5d8598e | 2022-01-11 05:56:06 +0000 | [diff] [blame] | 9218 | -c "=> parse certificate request" \ |
Xiaofei Bai | 69fcd39 | 2022-01-20 08:25:00 +0000 | [diff] [blame] | 9219 | -c "got a certificate request" \ |
Xiaofei Bai | 5d8598e | 2022-01-11 05:56:06 +0000 | [diff] [blame] | 9220 | -c "<= parse certificate request" |
Jerry Yu | 936dffd | 2021-11-22 18:34:36 +0800 | [diff] [blame] | 9221 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9222 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9223 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9224 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9225 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 9226 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9227 | requires_openssl_tls1_3 |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 9228 | run_test "TLS 1.3: HelloRetryRequest check, ciphersuite TLS_AES_128_GCM_SHA256 - openssl" \ |
| 9229 | "$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" \ |
| 9230 | "$P_CLI debug_level=4 force_version=tls13" \ |
| 9231 | 0 \ |
| 9232 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 9233 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
| 9234 | -c "tls13 client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 9235 | -c "HTTP/1.0 200 ok" |
| 9236 | |
| 9237 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 9238 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 9239 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9240 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 9241 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9242 | requires_openssl_tls1_3 |
| 9243 | 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] | 9244 | "$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] | 9245 | "$P_CLI debug_level=4 force_version=tls13" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 9246 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 9247 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 9248 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
| 9249 | -c "tls13 client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 9250 | -c "HTTP/1.0 200 ok" |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 9251 | |
| 9252 | requires_gnutls_tls1_3 |
| 9253 | requires_gnutls_next_no_ticket |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9254 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9255 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9256 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9257 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 9258 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 9259 | run_test "TLS 1.3: HelloRetryRequest check, ciphersuite TLS_AES_128_GCM_SHA256 - gnutls" \ |
| 9260 | "$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" \ |
| 9261 | "$P_CLI debug_level=4 force_version=tls13" \ |
| 9262 | 0 \ |
| 9263 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 9264 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
| 9265 | -c "tls13 client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 9266 | -c "HTTP/1.0 200 OK" |
| 9267 | |
| 9268 | requires_gnutls_tls1_3 |
| 9269 | requires_gnutls_next_no_ticket |
| 9270 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 9271 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 9272 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9273 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 9274 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9275 | 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] | 9276 | "$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] | 9277 | "$P_CLI debug_level=4 force_version=tls13" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 9278 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 9279 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 9280 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
| 9281 | -c "tls13 client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 9282 | -c "HTTP/1.0 200 OK" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9283 | |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 9284 | for i in $(ls opt-testcases/*.sh) |
| 9285 | do |
| 9286 | . $i |
| 9287 | done |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 9288 | |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9289 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9290 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9291 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9292 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9293 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9294 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 9295 | 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] | 9296 | "$O_NEXT_SRV -msg -tls1_3 -no_middlebox -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
| 9297 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
| 9298 | 0 \ |
| 9299 | -c "HTTP/1.0 200 ok" |
| 9300 | |
| 9301 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9302 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9303 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9304 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9305 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9306 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 9307 | 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] | 9308 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
| 9309 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
| 9310 | 1 \ |
| 9311 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 9312 | |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 9313 | requires_gnutls_tls1_3 |
| 9314 | requires_gnutls_next_no_ticket |
| 9315 | requires_gnutls_next_disable_tls13_compat |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9316 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 9317 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 9318 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9319 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 9320 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9321 | run_test "TLS 1.3 m->G both peers do not support middlebox compatibility" \ |
| 9322 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE --disable-client-cert" \ |
| 9323 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
| 9324 | 0 \ |
| 9325 | -c "HTTP/1.0 200 OK" |
| 9326 | |
| 9327 | requires_gnutls_tls1_3 |
| 9328 | requires_gnutls_next_no_ticket |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9329 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 9330 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 9331 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9332 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 9333 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9334 | run_test "TLS 1.3 m->G server with middlebox compat support, not client" \ |
| 9335 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --disable-client-cert" \ |
| 9336 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
| 9337 | 1 \ |
| 9338 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 9339 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 9340 | # Test heap memory usage after handshake |
| 9341 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 9342 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 9343 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9344 | requires_max_content_len 16384 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 9345 | run_tests_memory_after_hanshake |
| 9346 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 9347 | # Final report |
| 9348 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9349 | echo "------------------------------------------------------------------------" |
| 9350 | |
| 9351 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 9352 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9353 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 9354 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9355 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 9356 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 9357 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9358 | |
| 9359 | exit $FAILS |