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. |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 546 | # Use $TEST_SUITE_NAME as the test suite name if set. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 547 | record_outcome() { |
| 548 | echo "$1" |
| 549 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 550 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 551 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 552 | "${TEST_SUITE_NAME:-ssl-opt}" "$NAME" \ |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 553 | "$1" "${2-}" \ |
| 554 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 555 | fi |
| 556 | } |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 557 | unset TEST_SUITE_NAME |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 558 | |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 559 | # True if the presence of the given pattern in a log definitely indicates |
| 560 | # that the test has failed. False if the presence is inconclusive. |
| 561 | # |
| 562 | # Inputs: |
| 563 | # * $1: pattern found in the logs |
| 564 | # * $TIMES_LEFT: >0 if retrying is an option |
| 565 | # |
| 566 | # Outputs: |
| 567 | # * $outcome: set to a retry reason if the pattern is inconclusive, |
| 568 | # unchanged otherwise. |
| 569 | # * Return value: 1 if the pattern is inconclusive, |
| 570 | # 0 if the failure is definitive. |
| 571 | log_pattern_presence_is_conclusive() { |
| 572 | # If we've run out of attempts, then don't retry no matter what. |
| 573 | if [ $TIMES_LEFT -eq 0 ]; then |
| 574 | return 0 |
| 575 | fi |
| 576 | case $1 in |
| 577 | "resend") |
| 578 | # An undesired resend may have been caused by the OS dropping or |
| 579 | # delaying a packet at an inopportune time. |
| 580 | outcome="RETRY(resend)" |
| 581 | return 1;; |
| 582 | esac |
| 583 | } |
| 584 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 585 | # fail <message> |
| 586 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 587 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 588 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 589 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 590 | mv $SRV_OUT o-srv-${TESTS}.log |
| 591 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 592 | if [ -n "$PXY_CMD" ]; then |
| 593 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 594 | fi |
| 595 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 596 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 597 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 598 | echo " ! server output:" |
| 599 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 600 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 601 | echo " ! client output:" |
| 602 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 603 | if [ -n "$PXY_CMD" ]; then |
| 604 | echo " ! ========================================================" |
| 605 | echo " ! proxy output:" |
| 606 | cat o-pxy-${TESTS}.log |
| 607 | fi |
| 608 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 609 | fi |
| 610 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 611 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 612 | } |
| 613 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 614 | # is_polar <cmd_line> |
| 615 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 616 | case "$1" in |
| 617 | *ssl_client2*) true;; |
| 618 | *ssl_server2*) true;; |
| 619 | *) false;; |
| 620 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 621 | } |
| 622 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 623 | # openssl s_server doesn't have -www with DTLS |
| 624 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 625 | case "$SRV_CMD" in |
| 626 | *s_server*-dtls*) |
| 627 | NEEDS_INPUT=1 |
| 628 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 629 | *) NEEDS_INPUT=0;; |
| 630 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 631 | } |
| 632 | |
| 633 | # provide input to commands that need it |
| 634 | provide_input() { |
| 635 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 636 | return |
| 637 | fi |
| 638 | |
| 639 | while true; do |
| 640 | echo "HTTP/1.0 200 OK" |
| 641 | sleep 1 |
| 642 | done |
| 643 | } |
| 644 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 645 | # has_mem_err <log_file_name> |
| 646 | has_mem_err() { |
| 647 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 648 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 649 | then |
| 650 | return 1 # false: does not have errors |
| 651 | else |
| 652 | return 0 # true: has errors |
| 653 | fi |
| 654 | } |
| 655 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 656 | # 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] | 657 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 658 | wait_app_start() { |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 659 | newline=' |
| 660 | ' |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 661 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 662 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 663 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 664 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 665 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 666 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 667 | # Make a tight loop, server normally takes less than 1s to start. |
Paul Elliott | 58ed8a7 | 2021-10-19 17:56:39 +0100 | [diff] [blame] | 668 | while true; do |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 669 | SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -F p) |
| 670 | # When we use a proxy, it will be listening on the same port we |
| 671 | # are checking for as well as the server and lsof will list both. |
| 672 | # If multiple PIDs are returned, each one will be on a separate |
| 673 | # line, each prepended with 'p'. |
| 674 | case ${newline}${SERVER_PIDS}${newline} in |
| 675 | *${newline}p${2}${newline}*) break;; |
| 676 | esac |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 677 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 678 | echo "$3 START TIMEOUT" |
| 679 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 680 | break |
| 681 | fi |
| 682 | # Linux and *BSD support decimal arguments to sleep. On other |
| 683 | # OSes this may be a tight loop. |
| 684 | sleep 0.1 2>/dev/null || true |
| 685 | done |
| 686 | } |
| 687 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 688 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 689 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 690 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 691 | } |
| 692 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 693 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 694 | # Wait for server process $2 to be listening on port $1. |
| 695 | wait_server_start() { |
| 696 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 697 | } |
| 698 | |
| 699 | # Wait for proxy process $2 to be listening on port $1. |
| 700 | wait_proxy_start() { |
| 701 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 702 | } |
| 703 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 704 | # 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] | 705 | # 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] | 706 | # acceptable bounds |
| 707 | check_server_hello_time() { |
| 708 | # 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] | 709 | 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] | 710 | # Get the Unix timestamp for now |
| 711 | CUR_TIME=$(date +'%s') |
| 712 | THRESHOLD_IN_SECS=300 |
| 713 | |
| 714 | # Check if the ServerHello time was printed |
| 715 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 716 | return 1 |
| 717 | fi |
| 718 | |
| 719 | # Check the time in ServerHello is within acceptable bounds |
| 720 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 721 | # The time in ServerHello is at least 5 minutes before now |
| 722 | return 1 |
| 723 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 724 | # 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] | 725 | return 1 |
| 726 | else |
| 727 | return 0 |
| 728 | fi |
| 729 | } |
| 730 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 731 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 732 | handshake_memory_get() { |
| 733 | OUTPUT_VARIABLE="$1" |
| 734 | OUTPUT_FILE="$2" |
| 735 | |
| 736 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 737 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 738 | |
| 739 | # Check if memory usage was read |
| 740 | if [ -z "$MEM_USAGE" ]; then |
| 741 | echo "Error: Can not read the value of handshake memory usage" |
| 742 | return 1 |
| 743 | else |
| 744 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 745 | return 0 |
| 746 | fi |
| 747 | } |
| 748 | |
| 749 | # Get handshake memory usage from server or client output and check if this value |
| 750 | # is not higher than the maximum given by the first argument |
| 751 | handshake_memory_check() { |
| 752 | MAX_MEMORY="$1" |
| 753 | OUTPUT_FILE="$2" |
| 754 | |
| 755 | # Get memory usage |
| 756 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 757 | return 1 |
| 758 | fi |
| 759 | |
| 760 | # Check if memory usage is below max value |
| 761 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 762 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 763 | "but should be below $MAX_MEMORY bytes" |
| 764 | return 1 |
| 765 | else |
| 766 | return 0 |
| 767 | fi |
| 768 | } |
| 769 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 770 | # wait for client to terminate and set CLI_EXIT |
| 771 | # must be called right after starting the client |
| 772 | wait_client_done() { |
| 773 | CLI_PID=$! |
| 774 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 775 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 776 | CLI_DELAY_FACTOR=1 |
| 777 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 778 | ( 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] | 779 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 780 | |
| 781 | wait $CLI_PID |
| 782 | CLI_EXIT=$? |
| 783 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 784 | kill $DOG_PID >/dev/null 2>&1 |
| 785 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 786 | |
| 787 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 788 | |
| 789 | sleep $SRV_DELAY_SECONDS |
| 790 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 791 | } |
| 792 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 793 | # check if the given command uses dtls and sets global variable DTLS |
| 794 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 795 | case "$1" in |
Paul Elliott | 1428f25 | 2021-10-12 16:02:55 +0100 | [diff] [blame] | 796 | *dtls=1*|*-dtls*|*-u*) DTLS=1;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 797 | *) DTLS=0;; |
| 798 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 799 | } |
| 800 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 801 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 802 | is_gnutls() { |
| 803 | case "$1" in |
| 804 | *gnutls-cli*) |
| 805 | CMD_IS_GNUTLS=1 |
| 806 | ;; |
| 807 | *gnutls-serv*) |
| 808 | CMD_IS_GNUTLS=1 |
| 809 | ;; |
| 810 | *) |
| 811 | CMD_IS_GNUTLS=0 |
| 812 | ;; |
| 813 | esac |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 814 | } |
| 815 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 816 | # Compare file content |
| 817 | # Usage: find_in_both pattern file1 file2 |
| 818 | # extract from file1 the first line matching the pattern |
| 819 | # check in file2 that the same line can be found |
| 820 | find_in_both() { |
| 821 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 822 | if [ -z "$srv_pattern" ]; then |
| 823 | return 1; |
| 824 | fi |
| 825 | |
| 826 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 827 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 828 | else |
| 829 | return 1; |
| 830 | fi |
| 831 | } |
| 832 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 833 | SKIP_HANDSHAKE_CHECK="NO" |
| 834 | skip_handshake_stage_check() { |
| 835 | SKIP_HANDSHAKE_CHECK="YES" |
| 836 | } |
| 837 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 838 | # Analyze the commands that will be used in a test. |
| 839 | # |
| 840 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass |
| 841 | # extra arguments or go through wrappers. |
| 842 | # Set $DTLS (0=TLS, 1=DTLS). |
| 843 | analyze_test_commands() { |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 844 | # update DTLS variable |
| 845 | detect_dtls "$SRV_CMD" |
| 846 | |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 847 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 848 | # 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] | 849 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 850 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 851 | case " $SRV_CMD " in |
| 852 | *' server_addr=::1 '*) |
| 853 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 854 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 855 | fi |
| 856 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 857 | # update CMD_IS_GNUTLS variable |
| 858 | is_gnutls "$SRV_CMD" |
| 859 | |
| 860 | # if the server uses gnutls but doesn't set priority, explicitly |
| 861 | # set the default priority |
| 862 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 863 | case "$SRV_CMD" in |
| 864 | *--priority*) :;; |
| 865 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 866 | esac |
| 867 | fi |
| 868 | |
| 869 | # update CMD_IS_GNUTLS variable |
| 870 | is_gnutls "$CLI_CMD" |
| 871 | |
| 872 | # if the client uses gnutls but doesn't set priority, explicitly |
| 873 | # set the default priority |
| 874 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 875 | case "$CLI_CMD" in |
| 876 | *--priority*) :;; |
| 877 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 878 | esac |
| 879 | fi |
| 880 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 881 | # fix client port |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 882 | if [ -n "$PXY_CMD" ]; then |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 883 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 884 | else |
| 885 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 886 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 887 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 888 | # prepend valgrind to our commands if active |
| 889 | if [ "$MEMCHECK" -gt 0 ]; then |
| 890 | if is_polar "$SRV_CMD"; then |
| 891 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 892 | fi |
| 893 | if is_polar "$CLI_CMD"; then |
| 894 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 895 | fi |
| 896 | fi |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 897 | } |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 898 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 899 | # Check for failure conditions after a test case. |
| 900 | # |
| 901 | # Inputs from run_test: |
| 902 | # * positional parameters: test options (see run_test documentation) |
| 903 | # * $CLI_EXIT: client return code |
| 904 | # * $CLI_EXPECT: expected client return code |
| 905 | # * $SRV_RET: server return code |
| 906 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 907 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 908 | # |
| 909 | # Outputs: |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 910 | # * $outcome: one of PASS/RETRY*/FAIL |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 911 | check_test_failure() { |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 912 | outcome=FAIL |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 913 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 914 | if [ $TIMES_LEFT -gt 0 ] && |
| 915 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null |
| 916 | then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 917 | outcome="RETRY(client-timeout)" |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 918 | return |
| 919 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 920 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 921 | # 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] | 922 | # (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] | 923 | # expected client exit to incorrectly succeed in case of catastrophic |
| 924 | # failure) |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 925 | if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ] |
| 926 | then |
| 927 | if is_polar "$SRV_CMD"; then |
| 928 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
| 929 | else |
| 930 | fail "server or client failed to reach handshake stage" |
| 931 | return |
| 932 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 933 | fi |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 934 | if is_polar "$CLI_CMD"; then |
| 935 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
| 936 | else |
| 937 | fail "server or client failed to reach handshake stage" |
| 938 | return |
| 939 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 940 | fi |
| 941 | fi |
| 942 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 943 | SKIP_HANDSHAKE_CHECK="NO" |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 944 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 945 | # exit with status 0 when interrupted by a signal, and we don't really |
| 946 | # care anyway), in case e.g. the server reports a memory leak. |
| 947 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 948 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 949 | return |
| 950 | fi |
| 951 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 952 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 953 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 954 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 955 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 956 | 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] | 957 | return |
| 958 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 959 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 960 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 961 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 962 | # 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] | 963 | while [ $# -gt 0 ] |
| 964 | do |
| 965 | case $1 in |
| 966 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 967 | 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] | 968 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 969 | return |
| 970 | fi |
| 971 | ;; |
| 972 | |
| 973 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 974 | 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] | 975 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 976 | return |
| 977 | fi |
| 978 | ;; |
| 979 | |
| 980 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 981 | 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] | 982 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 983 | fail "pattern '$2' MUST NOT be present in the Server output" |
| 984 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 985 | return |
| 986 | fi |
| 987 | ;; |
| 988 | |
| 989 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 990 | 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] | 991 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 992 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 993 | fi |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 994 | return |
| 995 | fi |
| 996 | ;; |
| 997 | |
| 998 | # The filtering in the following two options (-u and -U) do the following |
| 999 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 1000 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1001 | # - keep one of each non-unique line |
| 1002 | # - count how many lines remain |
| 1003 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 1004 | # if there were no duplicates. |
| 1005 | "-U") |
| 1006 | 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 |
| 1007 | fail "lines following pattern '$2' must be unique in Server output" |
| 1008 | return |
| 1009 | fi |
| 1010 | ;; |
| 1011 | |
| 1012 | "-u") |
| 1013 | 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 |
| 1014 | 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] | 1015 | return |
| 1016 | fi |
| 1017 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 1018 | "-F") |
| 1019 | if ! $2 "$SRV_OUT"; then |
| 1020 | fail "function call to '$2' failed on Server output" |
| 1021 | return |
| 1022 | fi |
| 1023 | ;; |
| 1024 | "-f") |
| 1025 | if ! $2 "$CLI_OUT"; then |
| 1026 | fail "function call to '$2' failed on Client output" |
| 1027 | return |
| 1028 | fi |
| 1029 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1030 | "-g") |
| 1031 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 1032 | fail "function call to '$2' failed on Server and Client output" |
| 1033 | return |
| 1034 | fi |
| 1035 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1036 | |
| 1037 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1038 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1039 | exit 1 |
| 1040 | esac |
| 1041 | shift 2 |
| 1042 | done |
| 1043 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1044 | # check valgrind's results |
| 1045 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1046 | 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] | 1047 | fail "Server has memory errors" |
| 1048 | return |
| 1049 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1050 | 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] | 1051 | fail "Client has memory errors" |
| 1052 | return |
| 1053 | fi |
| 1054 | fi |
| 1055 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1056 | # if we're here, everything is ok |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1057 | outcome=PASS |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1058 | } |
| 1059 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1060 | # Run the current test case: start the server and if applicable the proxy, run |
| 1061 | # the client, wait for all processes to finish or time out. |
| 1062 | # |
| 1063 | # Inputs: |
| 1064 | # * $NAME: test case name |
| 1065 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run |
| 1066 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs |
| 1067 | # |
| 1068 | # Outputs: |
| 1069 | # * $CLI_EXIT: client return code |
| 1070 | # * $SRV_RET: server return code |
| 1071 | do_run_test_once() { |
| 1072 | # run the commands |
| 1073 | if [ -n "$PXY_CMD" ]; then |
| 1074 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
| 1075 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 1076 | PXY_PID=$! |
| 1077 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
| 1078 | fi |
| 1079 | |
| 1080 | check_osrv_dtls |
| 1081 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
| 1082 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 1083 | SRV_PID=$! |
| 1084 | wait_server_start "$SRV_PORT" "$SRV_PID" |
| 1085 | |
| 1086 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
| 1087 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 1088 | wait_client_done |
| 1089 | |
| 1090 | sleep 0.05 |
| 1091 | |
| 1092 | # terminate the server (and the proxy) |
| 1093 | kill $SRV_PID |
| 1094 | wait $SRV_PID |
| 1095 | SRV_RET=$? |
| 1096 | |
| 1097 | if [ -n "$PXY_CMD" ]; then |
| 1098 | kill $PXY_PID >/dev/null 2>&1 |
| 1099 | wait $PXY_PID |
| 1100 | fi |
| 1101 | } |
| 1102 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1103 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
| 1104 | # Options: -s pattern pattern that must be present in server output |
| 1105 | # -c pattern pattern that must be present in client output |
| 1106 | # -u pattern lines after pattern must be unique in client output |
| 1107 | # -f call shell function on client output |
| 1108 | # -S pattern pattern that must be absent in server output |
| 1109 | # -C pattern pattern that must be absent in client output |
| 1110 | # -U pattern lines after pattern must be unique in server output |
| 1111 | # -F call shell function on server output |
| 1112 | # -g call shell function on server and client output |
| 1113 | run_test() { |
| 1114 | NAME="$1" |
| 1115 | shift 1 |
| 1116 | |
| 1117 | if is_excluded "$NAME"; then |
| 1118 | SKIP_NEXT="NO" |
| 1119 | # There was no request to run the test, so don't record its outcome. |
| 1120 | return |
| 1121 | fi |
| 1122 | |
| 1123 | print_name "$NAME" |
| 1124 | |
| 1125 | # Do we only run numbered tests? |
| 1126 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 1127 | case ",$RUN_TEST_NUMBER," in |
| 1128 | *",$TESTS,"*) :;; |
| 1129 | *) SKIP_NEXT="YES";; |
| 1130 | esac |
| 1131 | fi |
| 1132 | |
| 1133 | # does this test use a proxy? |
| 1134 | if [ "X$1" = "X-p" ]; then |
| 1135 | PXY_CMD="$2" |
| 1136 | shift 2 |
| 1137 | else |
| 1138 | PXY_CMD="" |
| 1139 | fi |
| 1140 | |
| 1141 | # get commands and client output |
| 1142 | SRV_CMD="$1" |
| 1143 | CLI_CMD="$2" |
| 1144 | CLI_EXPECT="$3" |
| 1145 | shift 3 |
| 1146 | |
| 1147 | # Check if test uses files |
| 1148 | case "$SRV_CMD $CLI_CMD" in |
| 1149 | *data_files/*) |
| 1150 | requires_config_enabled MBEDTLS_FS_IO;; |
| 1151 | esac |
| 1152 | |
| 1153 | # If the client or serve requires a ciphersuite, check that it's enabled. |
| 1154 | maybe_requires_ciphersuite_enabled "$SRV_CMD" "$@" |
| 1155 | maybe_requires_ciphersuite_enabled "$CLI_CMD" "$@" |
| 1156 | |
| 1157 | # should we skip? |
| 1158 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 1159 | SKIP_NEXT="NO" |
| 1160 | record_outcome "SKIP" |
| 1161 | SKIPS=$(( $SKIPS + 1 )) |
| 1162 | return |
| 1163 | fi |
| 1164 | |
| 1165 | analyze_test_commands "$@" |
| 1166 | |
| 1167 | TIMES_LEFT=2 |
| 1168 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1169 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1170 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1171 | do_run_test_once |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1172 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1173 | check_test_failure "$@" |
| 1174 | case $outcome in |
| 1175 | PASS) break;; |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1176 | RETRY*) printf "$outcome ";; |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1177 | FAIL) return;; |
| 1178 | esac |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1179 | done |
| 1180 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1181 | # If we get this far, the test case passed. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1182 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1183 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1184 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1185 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1186 | if [ -n "$PXY_CMD" ]; then |
| 1187 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1188 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1189 | fi |
| 1190 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1191 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1192 | } |
| 1193 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1194 | run_test_psa() { |
| 1195 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1196 | run_test "PSA-supported ciphersuite: $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1197 | "$P_SRV debug_level=3 force_version=tls12" \ |
| 1198 | "$P_CLI debug_level=3 force_version=tls12 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1199 | 0 \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1200 | -c "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1201 | -c "calc PSA finished" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1202 | -s "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1203 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1204 | -C "Failed to setup PSA-based cipher context"\ |
| 1205 | -S "Failed to setup PSA-based cipher context"\ |
| 1206 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1207 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1208 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1209 | -S "error" \ |
| 1210 | -C "error" |
| 1211 | } |
| 1212 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1213 | run_test_psa_force_curve() { |
| 1214 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1215 | run_test "PSA - ECDH with $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1216 | "$P_SRV debug_level=4 force_version=tls12 curves=$1" \ |
| 1217 | "$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] | 1218 | 0 \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1219 | -c "PSA calc verify" \ |
| 1220 | -c "calc PSA finished" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1221 | -s "PSA calc verify" \ |
| 1222 | -s "calc PSA finished" \ |
| 1223 | -C "Failed to setup PSA-based cipher context"\ |
| 1224 | -S "Failed to setup PSA-based cipher context"\ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1225 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1226 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1227 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1228 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1229 | -C "error" |
| 1230 | } |
| 1231 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1232 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1233 | # a maximum fragment length. |
| 1234 | # first argument ($1) is MFL for SSL client |
| 1235 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1236 | run_test_memory_after_hanshake_with_mfl() |
| 1237 | { |
| 1238 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1239 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1240 | |
| 1241 | # Leave some margin for robustness |
| 1242 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1243 | |
| 1244 | run_test "Handshake memory usage (MFL $1)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1245 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
| 1246 | "$P_CLI debug_level=3 force_version=tls12 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1247 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1248 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1249 | 0 \ |
| 1250 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1251 | } |
| 1252 | |
| 1253 | |
| 1254 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1255 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1256 | run_tests_memory_after_hanshake() |
| 1257 | { |
| 1258 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1259 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1260 | |
| 1261 | # first test with default MFU is to get reference memory usage |
| 1262 | MEMORY_USAGE_MFL_16K=0 |
| 1263 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1264 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
| 1265 | "$P_CLI debug_level=3 force_version=tls12 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1266 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1267 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1268 | 0 \ |
| 1269 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1270 | |
| 1271 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1272 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1273 | |
| 1274 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1275 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1276 | |
| 1277 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1278 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1279 | |
| 1280 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1281 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1282 | } |
| 1283 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1284 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1285 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1286 | rm -f context_srv.txt |
| 1287 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1288 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1289 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1290 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1291 | 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] | 1292 | exit 1 |
| 1293 | } |
| 1294 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1295 | # |
| 1296 | # MAIN |
| 1297 | # |
| 1298 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1299 | get_options "$@" |
| 1300 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1301 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1302 | # patterns rather than regular expressions, use a case statement instead |
| 1303 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1304 | # detects simple cases: plain substring, everything, nothing. |
| 1305 | # |
| 1306 | # As an exception, the character '.' is treated as an ordinary character |
| 1307 | # if it is the only special character in the string. This is because it's |
| 1308 | # rare to need "any one character", but needing a literal '.' is common |
| 1309 | # (e.g. '-f "DTLS 1.2"'). |
| 1310 | need_grep= |
| 1311 | case "$FILTER" in |
| 1312 | '^$') simple_filter=;; |
| 1313 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1314 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1315 | need_grep=1;; |
| 1316 | *) # No regexp or shell-pattern special character |
| 1317 | simple_filter="*$FILTER*";; |
| 1318 | esac |
| 1319 | case "$EXCLUDE" in |
| 1320 | '^$') simple_exclude=;; |
| 1321 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1322 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1323 | need_grep=1;; |
| 1324 | *) # No regexp or shell-pattern special character |
| 1325 | simple_exclude="*$EXCLUDE*";; |
| 1326 | esac |
| 1327 | if [ -n "$need_grep" ]; then |
| 1328 | is_excluded () { |
| 1329 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1330 | } |
| 1331 | else |
| 1332 | is_excluded () { |
| 1333 | case "$1" in |
| 1334 | $simple_exclude) true;; |
| 1335 | $simple_filter) false;; |
| 1336 | *) true;; |
| 1337 | esac |
| 1338 | } |
| 1339 | fi |
| 1340 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1341 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1342 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1343 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1344 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1345 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1346 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1347 | exit 1 |
| 1348 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1349 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1350 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1351 | exit 1 |
| 1352 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1353 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1354 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1355 | exit 1 |
| 1356 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1357 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1358 | if which valgrind >/dev/null 2>&1; then :; else |
| 1359 | echo "Memcheck not possible. Valgrind not found" |
| 1360 | exit 1 |
| 1361 | fi |
| 1362 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1363 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 1364 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1365 | exit 1 |
| 1366 | fi |
| 1367 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1368 | # used by watchdog |
| 1369 | MAIN_PID="$$" |
| 1370 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1371 | # We use somewhat arbitrary delays for tests: |
| 1372 | # - how long do we wait for the server to start (when lsof not available)? |
| 1373 | # - how long do we allow for the client to finish? |
| 1374 | # (not to check performance, just to avoid waiting indefinitely) |
| 1375 | # Things are slower with valgrind, so give extra time here. |
| 1376 | # |
| 1377 | # Note: without lsof, there is a trade-off between the running time of this |
| 1378 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1379 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1380 | # 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] | 1381 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1382 | START_DELAY=6 |
| 1383 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1384 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1385 | START_DELAY=2 |
| 1386 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1387 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1388 | |
| 1389 | # some particular tests need more time: |
| 1390 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1391 | # - for the server, we sleep for a number of seconds after the client exits |
| 1392 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1393 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1394 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1395 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1396 | # 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] | 1397 | # +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] | 1398 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 1399 | # 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] | 1400 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1401 | 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] | 1402 | 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] | 1403 | O_SRV="$O_SRV -accept $SRV_PORT" |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1404 | 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] | 1405 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1406 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1407 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1408 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1409 | 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] | 1410 | 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] | 1411 | fi |
| 1412 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 1413 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 1414 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1415 | 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] | 1416 | 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] | 1417 | fi |
| 1418 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1419 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1420 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1421 | 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] | 1422 | fi |
| 1423 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1424 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1425 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1426 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1427 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1428 | # Allow SHA-1, because many of our test certificates use it |
| 1429 | P_SRV="$P_SRV allow_sha1=1" |
| 1430 | P_CLI="$P_CLI allow_sha1=1" |
| 1431 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1432 | # Also pick a unique name for intermediate files |
| 1433 | SRV_OUT="srv_out.$$" |
| 1434 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1435 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1436 | SESSION="session.$$" |
| 1437 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1438 | SKIP_NEXT="NO" |
| 1439 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1440 | trap cleanup INT TERM HUP |
| 1441 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1442 | # Basic test |
| 1443 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1444 | # Checks that: |
| 1445 | # - 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] | 1446 | # - the expected parameters are selected |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1447 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1448 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1449 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1450 | "$P_CLI" \ |
| 1451 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1452 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1453 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1454 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 1455 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1456 | -S "error" \ |
| 1457 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1458 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1459 | run_test "Default, DTLS" \ |
| 1460 | "$P_SRV dtls=1" \ |
| 1461 | "$P_CLI dtls=1" \ |
| 1462 | 0 \ |
| 1463 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1464 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1465 | |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1466 | run_test "TLS client auth: required" \ |
| 1467 | "$P_SRV auth_mode=required" \ |
| 1468 | "$P_CLI" \ |
| 1469 | 0 \ |
| 1470 | -s "Verifying peer X.509 certificate... ok" |
| 1471 | |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 1472 | run_test "key size: TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1473 | "$P_SRV" \ |
| 1474 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1475 | 0 \ |
| 1476 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1477 | -c "Key size is 256" |
| 1478 | |
| 1479 | run_test "key size: TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1480 | "$P_SRV" \ |
| 1481 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1482 | 0 \ |
| 1483 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1484 | -c "Key size is 128" |
| 1485 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1486 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1487 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1488 | requires_config_enabled MBEDTLS_SHA256_C |
| 1489 | run_test "TLS: password protected client key" \ |
| 1490 | "$P_SRV auth_mode=required" \ |
| 1491 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1492 | 0 |
| 1493 | |
| 1494 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1495 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1496 | requires_config_enabled MBEDTLS_SHA256_C |
| 1497 | run_test "TLS: password protected server key" \ |
| 1498 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1499 | "$P_CLI" \ |
| 1500 | 0 |
| 1501 | |
| 1502 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1503 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1504 | requires_config_enabled MBEDTLS_RSA_C |
| 1505 | requires_config_enabled MBEDTLS_SHA256_C |
| 1506 | run_test "TLS: password protected server key, two certificates" \ |
| 1507 | "$P_SRV \ |
| 1508 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1509 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1510 | "$P_CLI" \ |
| 1511 | 0 |
| 1512 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1513 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1514 | run_test "CA callback on client" \ |
| 1515 | "$P_SRV debug_level=3" \ |
| 1516 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1517 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1518 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1519 | -S "error" \ |
| 1520 | -C "error" |
| 1521 | |
| 1522 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1523 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1524 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1525 | requires_config_enabled MBEDTLS_SHA256_C |
| 1526 | run_test "CA callback on server" \ |
| 1527 | "$P_SRV auth_mode=required" \ |
| 1528 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1529 | key_file=data_files/server5.key" \ |
| 1530 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1531 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1532 | -s "Verifying peer X.509 certificate... ok" \ |
| 1533 | -S "error" \ |
| 1534 | -C "error" |
| 1535 | |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1536 | # Test using an opaque private key for client authentication |
| 1537 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1538 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1539 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1540 | requires_config_enabled MBEDTLS_SHA256_C |
| 1541 | run_test "Opaque key for client authentication" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1542 | "$P_SRV auth_mode=required crt_file=data_files/server5.crt \ |
| 1543 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1544 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1545 | key_file=data_files/server5.key" \ |
| 1546 | 0 \ |
| 1547 | -c "key type: Opaque" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1548 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1549 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1550 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1551 | -S "error" \ |
| 1552 | -C "error" |
| 1553 | |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1554 | # Test using an opaque private key for server authentication |
| 1555 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1556 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1557 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1558 | requires_config_enabled MBEDTLS_SHA256_C |
| 1559 | run_test "Opaque key for server authentication" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1560 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
| 1561 | key_file=data_files/server5.key" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1562 | "$P_CLI crt_file=data_files/server5.crt \ |
| 1563 | key_file=data_files/server5.key" \ |
| 1564 | 0 \ |
| 1565 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1566 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 1567 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1568 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1569 | -S "error" \ |
| 1570 | -C "error" |
| 1571 | |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1572 | # Test using an opaque private key for client/server authentication |
| 1573 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1574 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1575 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1576 | requires_config_enabled MBEDTLS_SHA256_C |
| 1577 | run_test "Opaque key for client/server authentication" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1578 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
| 1579 | key_file=data_files/server5.key" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1580 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1581 | key_file=data_files/server5.key" \ |
| 1582 | 0 \ |
| 1583 | -c "key type: Opaque" \ |
| 1584 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1585 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 1586 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1587 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1588 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1589 | -S "error" \ |
| 1590 | -C "error" |
| 1591 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1592 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 1593 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 1594 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 1595 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 1596 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 1597 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 1598 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 1599 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 1600 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 1601 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 1602 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 1603 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1604 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1605 | run_test_psa_force_curve "secp521r1" |
| 1606 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 1607 | run_test_psa_force_curve "brainpoolP512r1" |
| 1608 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 1609 | run_test_psa_force_curve "secp384r1" |
| 1610 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1611 | run_test_psa_force_curve "brainpoolP384r1" |
| 1612 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1613 | run_test_psa_force_curve "secp256r1" |
| 1614 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1615 | run_test_psa_force_curve "secp256k1" |
| 1616 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1617 | run_test_psa_force_curve "brainpoolP256r1" |
| 1618 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1619 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1620 | ## SECP224K1 is buggy via the PSA API |
| 1621 | ## (https://github.com/ARMmbed/mbedtls/issues/3541), |
| 1622 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 1623 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 1624 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 1625 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1626 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1627 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1628 | run_test_psa_force_curve "secp192r1" |
| 1629 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1630 | run_test_psa_force_curve "secp192k1" |
| 1631 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1632 | # Test current time in ServerHello |
| 1633 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 1634 | run_test "ServerHello contains gmt_unix_time" \ |
| 1635 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1636 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1637 | 0 \ |
| 1638 | -f "check_server_hello_time" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1639 | -F "check_server_hello_time" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1640 | |
| 1641 | # Test for uniqueness of IVs in AEAD ciphersuites |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1642 | run_test "Unique IV in GCM" \ |
| 1643 | "$P_SRV exchanges=20 debug_level=4" \ |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1644 | "$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] | 1645 | 0 \ |
| 1646 | -u "IV used" \ |
| 1647 | -U "IV used" |
| 1648 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1649 | # Tests for certificate verification callback |
| 1650 | run_test "Configuration-specific CRT verification callback" \ |
| 1651 | "$P_SRV debug_level=3" \ |
| 1652 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1653 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1654 | -S "error" \ |
| 1655 | -c "Verify requested for " \ |
| 1656 | -c "Use configuration-specific verification callback" \ |
| 1657 | -C "Use context-specific verification callback" \ |
| 1658 | -C "error" |
| 1659 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1660 | run_test "Context-specific CRT verification callback" \ |
| 1661 | "$P_SRV debug_level=3" \ |
| 1662 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 1663 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1664 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1665 | -c "Verify requested for " \ |
| 1666 | -c "Use context-specific verification callback" \ |
| 1667 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1668 | -C "error" |
| 1669 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1670 | # Tests for SHA-1 support |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1671 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1672 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1673 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1674 | 1 \ |
| 1675 | -c "The certificate is signed with an unacceptable hash" |
| 1676 | |
| 1677 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1678 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1679 | "$P_CLI allow_sha1=1" \ |
| 1680 | 0 |
| 1681 | |
| 1682 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1683 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1684 | "$P_CLI allow_sha1=0" \ |
| 1685 | 0 |
| 1686 | |
| 1687 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1688 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1689 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1690 | 1 \ |
| 1691 | -s "The certificate is signed with an unacceptable hash" |
| 1692 | |
| 1693 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1694 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1695 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1696 | 0 |
| 1697 | |
| 1698 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1699 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1700 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1701 | 0 |
| 1702 | |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1703 | # Dummy TLS 1.3 test |
| 1704 | # Currently only checking that passing TLS 1.3 key exchange modes to |
| 1705 | # ssl_client2/ssl_server2 example programs works. |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1706 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1707 | run_test "TLS 1.3, key exchange mode parameter passing: PSK only" \ |
Jerry Yu | 31c01d3 | 2021-08-24 10:49:06 +0800 | [diff] [blame] | 1708 | "$P_SRV tls13_kex_modes=psk" \ |
| 1709 | "$P_CLI tls13_kex_modes=psk" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1710 | 0 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1711 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1712 | run_test "TLS 1.3, key exchange mode parameter passing: PSK-ephemeral only" \ |
| 1713 | "$P_SRV tls13_kex_modes=psk_ephemeral" \ |
| 1714 | "$P_CLI tls13_kex_modes=psk_ephemeral" \ |
| 1715 | 0 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1716 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1717 | 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] | 1718 | "$P_SRV tls13_kex_modes=ephemeral" \ |
| 1719 | "$P_CLI tls13_kex_modes=ephemeral" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1720 | 0 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1721 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1722 | run_test "TLS 1.3, key exchange mode parameter passing: All ephemeral" \ |
| 1723 | "$P_SRV tls13_kex_modes=ephemeral_all" \ |
| 1724 | "$P_CLI tls13_kex_modes=ephemeral_all" \ |
| 1725 | 0 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1726 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1727 | run_test "TLS 1.3, key exchange mode parameter passing: All PSK" \ |
| 1728 | "$P_SRV tls13_kex_modes=psk_all" \ |
| 1729 | "$P_CLI tls13_kex_modes=psk_all" \ |
| 1730 | 0 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1731 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1732 | run_test "TLS 1.3, key exchange mode parameter passing: All" \ |
| 1733 | "$P_SRV tls13_kex_modes=all" \ |
| 1734 | "$P_CLI tls13_kex_modes=all" \ |
| 1735 | 0 |
| 1736 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1737 | # Tests for datagram packing |
| 1738 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1739 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1740 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1741 | 0 \ |
| 1742 | -c "next record in same datagram" \ |
| 1743 | -s "next record in same datagram" |
| 1744 | |
| 1745 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1746 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1747 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1748 | 0 \ |
| 1749 | -s "next record in same datagram" \ |
| 1750 | -C "next record in same datagram" |
| 1751 | |
| 1752 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1753 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1754 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1755 | 0 \ |
| 1756 | -S "next record in same datagram" \ |
| 1757 | -c "next record in same datagram" |
| 1758 | |
| 1759 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1760 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1761 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1762 | 0 \ |
| 1763 | -S "next record in same datagram" \ |
| 1764 | -C "next record in same datagram" |
| 1765 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1766 | # Tests for Context serialization |
| 1767 | |
| 1768 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1769 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1770 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1771 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1772 | 0 \ |
| 1773 | -c "Deserializing connection..." \ |
| 1774 | -S "Deserializing connection..." |
| 1775 | |
| 1776 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1777 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 1778 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1779 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1780 | 0 \ |
| 1781 | -c "Deserializing connection..." \ |
| 1782 | -S "Deserializing connection..." |
| 1783 | |
| 1784 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1785 | run_test "Context serialization, client serializes, GCM" \ |
| 1786 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1787 | "$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] | 1788 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1789 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1790 | -S "Deserializing connection..." |
| 1791 | |
| 1792 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1793 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1794 | run_test "Context serialization, client serializes, with CID" \ |
| 1795 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1796 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1797 | 0 \ |
| 1798 | -c "Deserializing connection..." \ |
| 1799 | -S "Deserializing connection..." |
| 1800 | |
| 1801 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1802 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1803 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1804 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1805 | 0 \ |
| 1806 | -C "Deserializing connection..." \ |
| 1807 | -s "Deserializing connection..." |
| 1808 | |
| 1809 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1810 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 1811 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1812 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1813 | 0 \ |
| 1814 | -C "Deserializing connection..." \ |
| 1815 | -s "Deserializing connection..." |
| 1816 | |
| 1817 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1818 | run_test "Context serialization, server serializes, GCM" \ |
| 1819 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1820 | "$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] | 1821 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1822 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1823 | -s "Deserializing connection..." |
| 1824 | |
| 1825 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1826 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1827 | run_test "Context serialization, server serializes, with CID" \ |
| 1828 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1829 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1830 | 0 \ |
| 1831 | -C "Deserializing connection..." \ |
| 1832 | -s "Deserializing connection..." |
| 1833 | |
| 1834 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1835 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1836 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1837 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1838 | 0 \ |
| 1839 | -c "Deserializing connection..." \ |
| 1840 | -s "Deserializing connection..." |
| 1841 | |
| 1842 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1843 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 1844 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1845 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1846 | 0 \ |
| 1847 | -c "Deserializing connection..." \ |
| 1848 | -s "Deserializing connection..." |
| 1849 | |
| 1850 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1851 | run_test "Context serialization, both serialize, GCM" \ |
| 1852 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1853 | "$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] | 1854 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1855 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1856 | -s "Deserializing connection..." |
| 1857 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1858 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1859 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1860 | run_test "Context serialization, both serialize, with CID" \ |
| 1861 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1862 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1863 | 0 \ |
| 1864 | -c "Deserializing connection..." \ |
| 1865 | -s "Deserializing connection..." |
| 1866 | |
| 1867 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1868 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1869 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1870 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1871 | 0 \ |
| 1872 | -c "Deserializing connection..." \ |
| 1873 | -S "Deserializing connection..." |
| 1874 | |
| 1875 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1876 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 1877 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1878 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1879 | 0 \ |
| 1880 | -c "Deserializing connection..." \ |
| 1881 | -S "Deserializing connection..." |
| 1882 | |
| 1883 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1884 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 1885 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1886 | "$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] | 1887 | 0 \ |
| 1888 | -c "Deserializing connection..." \ |
| 1889 | -S "Deserializing connection..." |
| 1890 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1891 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1892 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1893 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 1894 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1895 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1896 | 0 \ |
| 1897 | -c "Deserializing connection..." \ |
| 1898 | -S "Deserializing connection..." |
| 1899 | |
| 1900 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1901 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1902 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1903 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1904 | 0 \ |
| 1905 | -C "Deserializing connection..." \ |
| 1906 | -s "Deserializing connection..." |
| 1907 | |
| 1908 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1909 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 1910 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1911 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1912 | 0 \ |
| 1913 | -C "Deserializing connection..." \ |
| 1914 | -s "Deserializing connection..." |
| 1915 | |
| 1916 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1917 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 1918 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1919 | "$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] | 1920 | 0 \ |
| 1921 | -C "Deserializing connection..." \ |
| 1922 | -s "Deserializing connection..." |
| 1923 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1924 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1925 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1926 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 1927 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1928 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1929 | 0 \ |
| 1930 | -C "Deserializing connection..." \ |
| 1931 | -s "Deserializing connection..." |
| 1932 | |
| 1933 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1934 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1935 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1936 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1937 | 0 \ |
| 1938 | -c "Deserializing connection..." \ |
| 1939 | -s "Deserializing connection..." |
| 1940 | |
| 1941 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1942 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 1943 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1944 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1945 | 0 \ |
| 1946 | -c "Deserializing connection..." \ |
| 1947 | -s "Deserializing connection..." |
| 1948 | |
| 1949 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1950 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 1951 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1952 | "$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] | 1953 | 0 \ |
| 1954 | -c "Deserializing connection..." \ |
| 1955 | -s "Deserializing connection..." |
| 1956 | |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1957 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1958 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1959 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 1960 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1961 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1962 | 0 \ |
| 1963 | -c "Deserializing connection..." \ |
| 1964 | -s "Deserializing connection..." |
| 1965 | |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1966 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1967 | run_test "Saving the serialized context to a file" \ |
| 1968 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 1969 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 1970 | 0 \ |
| 1971 | -s "Save serialized context to a file... ok" \ |
| 1972 | -c "Save serialized context to a file... ok" |
| 1973 | rm -f context_srv.txt |
| 1974 | rm -f context_cli.txt |
| 1975 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1976 | # Tests for DTLS Connection ID extension |
| 1977 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1978 | # So far, the CID API isn't implemented, so we can't |
| 1979 | # grep for output witnessing its use. This needs to be |
| 1980 | # changed once the CID extension is implemented. |
| 1981 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1982 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1983 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1984 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 1985 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1986 | 0 \ |
| 1987 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1988 | -s "found CID extension" \ |
| 1989 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1990 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1991 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1992 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1993 | -C "found CID extension" \ |
| 1994 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1995 | -C "Copy CIDs into SSL transform" \ |
| 1996 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1997 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1998 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1999 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2000 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2001 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 2002 | 0 \ |
| 2003 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2004 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2005 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2006 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2007 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2008 | -C "found CID extension" \ |
| 2009 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2010 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 2011 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2012 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2013 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2014 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2015 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2016 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 2017 | 0 \ |
| 2018 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2019 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2020 | -c "client hello, adding CID extension" \ |
| 2021 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2022 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2023 | -s "server hello, adding CID extension" \ |
| 2024 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2025 | -c "Use of CID extension negotiated" \ |
| 2026 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2027 | -c "Copy CIDs into SSL transform" \ |
| 2028 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2029 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2030 | -s "Use of Connection ID has been negotiated" \ |
| 2031 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2032 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2033 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2034 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2035 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2036 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 2037 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 2038 | 0 \ |
| 2039 | -c "Enable use of CID extension." \ |
| 2040 | -s "Enable use of CID extension." \ |
| 2041 | -c "client hello, adding CID extension" \ |
| 2042 | -s "found CID extension" \ |
| 2043 | -s "Use of CID extension negotiated" \ |
| 2044 | -s "server hello, adding CID extension" \ |
| 2045 | -c "found CID extension" \ |
| 2046 | -c "Use of CID extension negotiated" \ |
| 2047 | -s "Copy CIDs into SSL transform" \ |
| 2048 | -c "Copy CIDs into SSL transform" \ |
| 2049 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2050 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2051 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2052 | -c "Use of Connection ID has been negotiated" \ |
| 2053 | -c "ignoring unexpected CID" \ |
| 2054 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2055 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2056 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2057 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 2058 | -p "$P_PXY mtu=800" \ |
| 2059 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2060 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2061 | 0 \ |
| 2062 | -c "Enable use of CID extension." \ |
| 2063 | -s "Enable use of CID extension." \ |
| 2064 | -c "client hello, adding CID extension" \ |
| 2065 | -s "found CID extension" \ |
| 2066 | -s "Use of CID extension negotiated" \ |
| 2067 | -s "server hello, adding CID extension" \ |
| 2068 | -c "found CID extension" \ |
| 2069 | -c "Use of CID extension negotiated" \ |
| 2070 | -s "Copy CIDs into SSL transform" \ |
| 2071 | -c "Copy CIDs into SSL transform" \ |
| 2072 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2073 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2074 | -s "Use of Connection ID has been negotiated" \ |
| 2075 | -c "Use of Connection ID has been negotiated" |
| 2076 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2077 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2078 | 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] | 2079 | -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] | 2080 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2081 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2082 | 0 \ |
| 2083 | -c "Enable use of CID extension." \ |
| 2084 | -s "Enable use of CID extension." \ |
| 2085 | -c "client hello, adding CID extension" \ |
| 2086 | -s "found CID extension" \ |
| 2087 | -s "Use of CID extension negotiated" \ |
| 2088 | -s "server hello, adding CID extension" \ |
| 2089 | -c "found CID extension" \ |
| 2090 | -c "Use of CID extension negotiated" \ |
| 2091 | -s "Copy CIDs into SSL transform" \ |
| 2092 | -c "Copy CIDs into SSL transform" \ |
| 2093 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2094 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2095 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2096 | -c "Use of Connection ID has been negotiated" \ |
| 2097 | -c "ignoring unexpected CID" \ |
| 2098 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2099 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2100 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2101 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2102 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2103 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2104 | 0 \ |
| 2105 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2106 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2107 | -c "client hello, adding CID extension" \ |
| 2108 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2109 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2110 | -s "server hello, adding CID extension" \ |
| 2111 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2112 | -c "Use of CID extension negotiated" \ |
| 2113 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2114 | -c "Copy CIDs into SSL transform" \ |
| 2115 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2116 | -s "Peer CID (length 0 Bytes):" \ |
| 2117 | -s "Use of Connection ID has been negotiated" \ |
| 2118 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2119 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2120 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2121 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2122 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2123 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2124 | 0 \ |
| 2125 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2126 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2127 | -c "client hello, adding CID extension" \ |
| 2128 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2129 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2130 | -s "server hello, adding CID extension" \ |
| 2131 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2132 | -c "Use of CID extension negotiated" \ |
| 2133 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2134 | -c "Copy CIDs into SSL transform" \ |
| 2135 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2136 | -c "Peer CID (length 0 Bytes):" \ |
| 2137 | -s "Use of Connection ID has been negotiated" \ |
| 2138 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2139 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2140 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2141 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2142 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2143 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2144 | 0 \ |
| 2145 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2146 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2147 | -c "client hello, adding CID extension" \ |
| 2148 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2149 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2150 | -s "server hello, adding CID extension" \ |
| 2151 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2152 | -c "Use of CID extension negotiated" \ |
| 2153 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2154 | -c "Copy CIDs into SSL transform" \ |
| 2155 | -S "Use of Connection ID has been negotiated" \ |
| 2156 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2157 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2158 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2159 | 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] | 2160 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2161 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2162 | 0 \ |
| 2163 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2164 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2165 | -c "client hello, adding CID extension" \ |
| 2166 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2167 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2168 | -s "server hello, adding CID extension" \ |
| 2169 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2170 | -c "Use of CID extension negotiated" \ |
| 2171 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2172 | -c "Copy CIDs into SSL transform" \ |
| 2173 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2174 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2175 | -s "Use of Connection ID has been negotiated" \ |
| 2176 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2177 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2178 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2179 | 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] | 2180 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2181 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2182 | 0 \ |
| 2183 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2184 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2185 | -c "client hello, adding CID extension" \ |
| 2186 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2187 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2188 | -s "server hello, adding CID extension" \ |
| 2189 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2190 | -c "Use of CID extension negotiated" \ |
| 2191 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2192 | -c "Copy CIDs into SSL transform" \ |
| 2193 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2194 | -s "Peer CID (length 0 Bytes):" \ |
| 2195 | -s "Use of Connection ID has been negotiated" \ |
| 2196 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2197 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2198 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2199 | 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] | 2200 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2201 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2202 | 0 \ |
| 2203 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2204 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2205 | -c "client hello, adding CID extension" \ |
| 2206 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2207 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2208 | -s "server hello, adding CID extension" \ |
| 2209 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2210 | -c "Use of CID extension negotiated" \ |
| 2211 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2212 | -c "Copy CIDs into SSL transform" \ |
| 2213 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2214 | -c "Peer CID (length 0 Bytes):" \ |
| 2215 | -s "Use of Connection ID has been negotiated" \ |
| 2216 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2217 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2218 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2219 | 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] | 2220 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2221 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2222 | 0 \ |
| 2223 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2224 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2225 | -c "client hello, adding CID extension" \ |
| 2226 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2227 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2228 | -s "server hello, adding CID extension" \ |
| 2229 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2230 | -c "Use of CID extension negotiated" \ |
| 2231 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2232 | -c "Copy CIDs into SSL transform" \ |
| 2233 | -S "Use of Connection ID has been negotiated" \ |
| 2234 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2235 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2236 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2237 | 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] | 2238 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2239 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2240 | 0 \ |
| 2241 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2242 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2243 | -c "client hello, adding CID extension" \ |
| 2244 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2245 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2246 | -s "server hello, adding CID extension" \ |
| 2247 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2248 | -c "Use of CID extension negotiated" \ |
| 2249 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2250 | -c "Copy CIDs into SSL transform" \ |
| 2251 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2252 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2253 | -s "Use of Connection ID has been negotiated" \ |
| 2254 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2255 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2256 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2257 | 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] | 2258 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2259 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2260 | 0 \ |
| 2261 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2262 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2263 | -c "client hello, adding CID extension" \ |
| 2264 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2265 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2266 | -s "server hello, adding CID extension" \ |
| 2267 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2268 | -c "Use of CID extension negotiated" \ |
| 2269 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2270 | -c "Copy CIDs into SSL transform" \ |
| 2271 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2272 | -s "Peer CID (length 0 Bytes):" \ |
| 2273 | -s "Use of Connection ID has been negotiated" \ |
| 2274 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2275 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2276 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2277 | 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] | 2278 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2279 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2280 | 0 \ |
| 2281 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2282 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2283 | -c "client hello, adding CID extension" \ |
| 2284 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2285 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2286 | -s "server hello, adding CID extension" \ |
| 2287 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2288 | -c "Use of CID extension negotiated" \ |
| 2289 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2290 | -c "Copy CIDs into SSL transform" \ |
| 2291 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2292 | -c "Peer CID (length 0 Bytes):" \ |
| 2293 | -s "Use of Connection ID has been negotiated" \ |
| 2294 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2295 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2296 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2297 | 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] | 2298 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2299 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2300 | 0 \ |
| 2301 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2302 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2303 | -c "client hello, adding CID extension" \ |
| 2304 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2305 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2306 | -s "server hello, adding CID extension" \ |
| 2307 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2308 | -c "Use of CID extension negotiated" \ |
| 2309 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2310 | -c "Copy CIDs into SSL transform" \ |
| 2311 | -S "Use of Connection ID has been negotiated" \ |
| 2312 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2313 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2314 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 2315 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2316 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2317 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2318 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2319 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2320 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2321 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2322 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2323 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2324 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2325 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2326 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2327 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2328 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2329 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2330 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2331 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2332 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2333 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2334 | 0 \ |
| 2335 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2336 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2337 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2338 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2339 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2340 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2341 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2342 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2343 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2344 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2345 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2346 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 2347 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2348 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2349 | 0 \ |
| 2350 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2351 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2352 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2353 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2354 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2355 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2356 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2357 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2358 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2359 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2360 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2361 | 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] | 2362 | -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] | 2363 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2364 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2365 | 0 \ |
| 2366 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2367 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2368 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2369 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2370 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2371 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2372 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2373 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2374 | -c "ignoring unexpected CID" \ |
| 2375 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2376 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2377 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2378 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2379 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2380 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2381 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2382 | 0 \ |
| 2383 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2384 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2385 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2386 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2387 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2388 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2389 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2390 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2391 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2392 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2393 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2394 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 2395 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2396 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2397 | 0 \ |
| 2398 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2399 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2400 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2401 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2402 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2403 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2404 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2405 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2406 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2407 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2408 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2409 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2410 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2411 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2412 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2413 | 0 \ |
| 2414 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2415 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2416 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2417 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2418 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2419 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2420 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2421 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2422 | -c "ignoring unexpected CID" \ |
| 2423 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2424 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2425 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2426 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2427 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2428 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2429 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2430 | 0 \ |
| 2431 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2432 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2433 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2434 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2435 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2436 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2437 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2438 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2439 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2440 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 2441 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2442 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2443 | 0 \ |
| 2444 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2445 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2446 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2447 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2448 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2449 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2450 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2451 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2452 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2453 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2454 | -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] | 2455 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2456 | "$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" \ |
| 2457 | 0 \ |
| 2458 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2459 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2460 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2461 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2462 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2463 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2464 | -c "ignoring unexpected CID" \ |
| 2465 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2466 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2467 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2468 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2469 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2470 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2471 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2472 | 0 \ |
| 2473 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2474 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2475 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2476 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2477 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2478 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2479 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2480 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2481 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 2482 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2483 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2484 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2485 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2486 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2487 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2488 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2489 | 0 \ |
| 2490 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2491 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2492 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2493 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2494 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2495 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2496 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2497 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2498 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2499 | -c "ignoring unexpected CID" \ |
| 2500 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2501 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2502 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2503 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2504 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 2505 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2506 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2507 | 0 \ |
| 2508 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2509 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2510 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2511 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2512 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2513 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2514 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2515 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2516 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2517 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2518 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2519 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2520 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2521 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2522 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2523 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2524 | 0 \ |
| 2525 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2526 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2527 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2528 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2529 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2530 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2531 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2532 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2533 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2534 | -c "ignoring unexpected CID" \ |
| 2535 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2536 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 2537 | # 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] | 2538 | # tests check that the buffer contents are reallocated when the message is |
| 2539 | # larger than the buffer. |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2540 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2541 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2542 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2543 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 2544 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2545 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 2546 | 0 \ |
| 2547 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2548 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2549 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2550 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2551 | -s "Reallocating in_buf" \ |
| 2552 | -s "Reallocating out_buf" |
| 2553 | |
| 2554 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2555 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2556 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2557 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 2558 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2559 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 2560 | 0 \ |
| 2561 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2562 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2563 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2564 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2565 | -s "Reallocating in_buf" \ |
| 2566 | -s "Reallocating out_buf" |
| 2567 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2568 | # Tests for Encrypt-then-MAC extension |
| 2569 | |
| 2570 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2571 | "$P_SRV debug_level=3 \ |
| 2572 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2573 | "$P_CLI debug_level=3" \ |
| 2574 | 0 \ |
| 2575 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2576 | -s "found encrypt then mac extension" \ |
| 2577 | -s "server hello, adding encrypt then mac extension" \ |
| 2578 | -c "found encrypt_then_mac extension" \ |
| 2579 | -c "using encrypt then mac" \ |
| 2580 | -s "using encrypt then mac" |
| 2581 | |
| 2582 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2583 | "$P_SRV debug_level=3 etm=0 \ |
| 2584 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2585 | "$P_CLI debug_level=3 etm=1" \ |
| 2586 | 0 \ |
| 2587 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2588 | -s "found encrypt then mac extension" \ |
| 2589 | -S "server hello, adding encrypt then mac extension" \ |
| 2590 | -C "found encrypt_then_mac extension" \ |
| 2591 | -C "using encrypt then mac" \ |
| 2592 | -S "using encrypt then mac" |
| 2593 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2594 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 2595 | "$P_SRV debug_level=3 etm=1 \ |
| 2596 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 2597 | "$P_CLI debug_level=3 etm=1" \ |
| 2598 | 0 \ |
| 2599 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2600 | -s "found encrypt then mac extension" \ |
| 2601 | -S "server hello, adding encrypt then mac extension" \ |
| 2602 | -C "found encrypt_then_mac extension" \ |
| 2603 | -C "using encrypt then mac" \ |
| 2604 | -S "using encrypt then mac" |
| 2605 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2606 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2607 | "$P_SRV debug_level=3 etm=1 \ |
| 2608 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2609 | "$P_CLI debug_level=3 etm=0" \ |
| 2610 | 0 \ |
| 2611 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2612 | -S "found encrypt then mac extension" \ |
| 2613 | -S "server hello, adding encrypt then mac extension" \ |
| 2614 | -C "found encrypt_then_mac extension" \ |
| 2615 | -C "using encrypt then mac" \ |
| 2616 | -S "using encrypt then mac" |
| 2617 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2618 | # Tests for Extended Master Secret extension |
| 2619 | |
| 2620 | run_test "Extended Master Secret: default" \ |
| 2621 | "$P_SRV debug_level=3" \ |
| 2622 | "$P_CLI debug_level=3" \ |
| 2623 | 0 \ |
| 2624 | -c "client hello, adding extended_master_secret extension" \ |
| 2625 | -s "found extended master secret extension" \ |
| 2626 | -s "server hello, adding extended master secret extension" \ |
| 2627 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2628 | -c "session hash for extended master secret" \ |
| 2629 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2630 | |
| 2631 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 2632 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 2633 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 2634 | 0 \ |
| 2635 | -c "client hello, adding extended_master_secret extension" \ |
| 2636 | -s "found extended master secret extension" \ |
| 2637 | -S "server hello, adding extended master secret extension" \ |
| 2638 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2639 | -C "session hash for extended master secret" \ |
| 2640 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2641 | |
| 2642 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 2643 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 2644 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 2645 | 0 \ |
| 2646 | -C "client hello, adding extended_master_secret extension" \ |
| 2647 | -S "found extended master secret extension" \ |
| 2648 | -S "server hello, adding extended master secret extension" \ |
| 2649 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2650 | -C "session hash for extended master secret" \ |
| 2651 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2652 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2653 | # Test sending and receiving empty application data records |
| 2654 | |
| 2655 | run_test "Encrypt then MAC: empty application data record" \ |
| 2656 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 2657 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 2658 | 0 \ |
| 2659 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2660 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2661 | -c "0 bytes written in 1 fragments" |
| 2662 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2663 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2664 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 2665 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 2666 | 0 \ |
| 2667 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2668 | -c "0 bytes written in 1 fragments" |
| 2669 | |
| 2670 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 2671 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 2672 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 2673 | 0 \ |
| 2674 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2675 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2676 | -c "0 bytes written in 1 fragments" |
| 2677 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2678 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2679 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 2680 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 2681 | 0 \ |
| 2682 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2683 | -c "0 bytes written in 1 fragments" |
| 2684 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2685 | # Tests for CBC 1/n-1 record splitting |
| 2686 | |
| 2687 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 2688 | "$P_SRV" \ |
| 2689 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 2690 | request_size=123 force_version=tls12" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2691 | 0 \ |
| 2692 | -s "Read from client: 123 bytes read" \ |
| 2693 | -S "Read from client: 1 bytes read" \ |
| 2694 | -S "122 bytes read" |
| 2695 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2696 | # Tests for Session Tickets |
| 2697 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2698 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2699 | "$P_SRV debug_level=3 tickets=1" \ |
| 2700 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2701 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2702 | -c "client hello, adding session ticket extension" \ |
| 2703 | -s "found session ticket extension" \ |
| 2704 | -s "server hello, adding session ticket extension" \ |
| 2705 | -c "found session_ticket extension" \ |
| 2706 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2707 | -S "session successfully restored from cache" \ |
| 2708 | -s "session successfully restored from ticket" \ |
| 2709 | -s "a session has been resumed" \ |
| 2710 | -c "a session has been resumed" |
| 2711 | |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 2712 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 2713 | run_test "Session resume using tickets: manual rotation" \ |
| 2714 | "$P_SRV debug_level=3 tickets=1 ticket_rotate=1" \ |
| 2715 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2716 | 0 \ |
| 2717 | -c "client hello, adding session ticket extension" \ |
| 2718 | -s "found session ticket extension" \ |
| 2719 | -s "server hello, adding session ticket extension" \ |
| 2720 | -c "found session_ticket extension" \ |
| 2721 | -c "parse new session ticket" \ |
| 2722 | -S "session successfully restored from cache" \ |
| 2723 | -s "session successfully restored from ticket" \ |
| 2724 | -s "a session has been resumed" \ |
| 2725 | -c "a session has been resumed" |
| 2726 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2727 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2728 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2729 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2730 | 0 \ |
| 2731 | -c "client hello, adding session ticket extension" \ |
| 2732 | -s "found session ticket extension" \ |
| 2733 | -s "server hello, adding session ticket extension" \ |
| 2734 | -c "found session_ticket extension" \ |
| 2735 | -c "parse new session ticket" \ |
| 2736 | -S "session successfully restored from cache" \ |
| 2737 | -s "session successfully restored from ticket" \ |
| 2738 | -s "a session has been resumed" \ |
| 2739 | -c "a session has been resumed" |
| 2740 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2741 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2742 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2743 | "$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] | 2744 | 0 \ |
| 2745 | -c "client hello, adding session ticket extension" \ |
| 2746 | -s "found session ticket extension" \ |
| 2747 | -s "server hello, adding session ticket extension" \ |
| 2748 | -c "found session_ticket extension" \ |
| 2749 | -c "parse new session ticket" \ |
| 2750 | -S "session successfully restored from cache" \ |
| 2751 | -S "session successfully restored from ticket" \ |
| 2752 | -S "a session has been resumed" \ |
| 2753 | -C "a session has been resumed" |
| 2754 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2755 | run_test "Session resume using tickets: session copy" \ |
| 2756 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2757 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 2758 | 0 \ |
| 2759 | -c "client hello, adding session ticket extension" \ |
| 2760 | -s "found session ticket extension" \ |
| 2761 | -s "server hello, adding session ticket extension" \ |
| 2762 | -c "found session_ticket extension" \ |
| 2763 | -c "parse new session ticket" \ |
| 2764 | -S "session successfully restored from cache" \ |
| 2765 | -s "session successfully restored from ticket" \ |
| 2766 | -s "a session has been resumed" \ |
| 2767 | -c "a session has been resumed" |
| 2768 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2769 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2770 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2771 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2772 | 0 \ |
| 2773 | -c "client hello, adding session ticket extension" \ |
| 2774 | -c "found session_ticket extension" \ |
| 2775 | -c "parse new session ticket" \ |
| 2776 | -c "a session has been resumed" |
| 2777 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2778 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2779 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2780 | "( $O_CLI -sess_out $SESSION; \ |
| 2781 | $O_CLI -sess_in $SESSION; \ |
| 2782 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2783 | 0 \ |
| 2784 | -s "found session ticket extension" \ |
| 2785 | -s "server hello, adding session ticket extension" \ |
| 2786 | -S "session successfully restored from cache" \ |
| 2787 | -s "session successfully restored from ticket" \ |
| 2788 | -s "a session has been resumed" |
| 2789 | |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 2790 | run_test "Session resume using tickets: AES-128-GCM" \ |
| 2791 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-GCM" \ |
| 2792 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2793 | 0 \ |
| 2794 | -c "client hello, adding session ticket extension" \ |
| 2795 | -s "found session ticket extension" \ |
| 2796 | -s "server hello, adding session ticket extension" \ |
| 2797 | -c "found session_ticket extension" \ |
| 2798 | -c "parse new session ticket" \ |
| 2799 | -S "session successfully restored from cache" \ |
| 2800 | -s "session successfully restored from ticket" \ |
| 2801 | -s "a session has been resumed" \ |
| 2802 | -c "a session has been resumed" |
| 2803 | |
| 2804 | run_test "Session resume using tickets: AES-192-GCM" \ |
| 2805 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-GCM" \ |
| 2806 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2807 | 0 \ |
| 2808 | -c "client hello, adding session ticket extension" \ |
| 2809 | -s "found session ticket extension" \ |
| 2810 | -s "server hello, adding session ticket extension" \ |
| 2811 | -c "found session_ticket extension" \ |
| 2812 | -c "parse new session ticket" \ |
| 2813 | -S "session successfully restored from cache" \ |
| 2814 | -s "session successfully restored from ticket" \ |
| 2815 | -s "a session has been resumed" \ |
| 2816 | -c "a session has been resumed" |
| 2817 | |
| 2818 | run_test "Session resume using tickets: AES-128-CCM" \ |
| 2819 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-CCM" \ |
| 2820 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2821 | 0 \ |
| 2822 | -c "client hello, adding session ticket extension" \ |
| 2823 | -s "found session ticket extension" \ |
| 2824 | -s "server hello, adding session ticket extension" \ |
| 2825 | -c "found session_ticket extension" \ |
| 2826 | -c "parse new session ticket" \ |
| 2827 | -S "session successfully restored from cache" \ |
| 2828 | -s "session successfully restored from ticket" \ |
| 2829 | -s "a session has been resumed" \ |
| 2830 | -c "a session has been resumed" |
| 2831 | |
| 2832 | run_test "Session resume using tickets: AES-192-CCM" \ |
| 2833 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-CCM" \ |
| 2834 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2835 | 0 \ |
| 2836 | -c "client hello, adding session ticket extension" \ |
| 2837 | -s "found session ticket extension" \ |
| 2838 | -s "server hello, adding session ticket extension" \ |
| 2839 | -c "found session_ticket extension" \ |
| 2840 | -c "parse new session ticket" \ |
| 2841 | -S "session successfully restored from cache" \ |
| 2842 | -s "session successfully restored from ticket" \ |
| 2843 | -s "a session has been resumed" \ |
| 2844 | -c "a session has been resumed" |
| 2845 | |
| 2846 | run_test "Session resume using tickets: AES-256-CCM" \ |
| 2847 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-256-CCM" \ |
| 2848 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2849 | 0 \ |
| 2850 | -c "client hello, adding session ticket extension" \ |
| 2851 | -s "found session ticket extension" \ |
| 2852 | -s "server hello, adding session ticket extension" \ |
| 2853 | -c "found session_ticket extension" \ |
| 2854 | -c "parse new session ticket" \ |
| 2855 | -S "session successfully restored from cache" \ |
| 2856 | -s "session successfully restored from ticket" \ |
| 2857 | -s "a session has been resumed" \ |
| 2858 | -c "a session has been resumed" |
| 2859 | |
| 2860 | run_test "Session resume using tickets: CAMELLIA-128-CCM" \ |
| 2861 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-128-CCM" \ |
| 2862 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2863 | 0 \ |
| 2864 | -c "client hello, adding session ticket extension" \ |
| 2865 | -s "found session ticket extension" \ |
| 2866 | -s "server hello, adding session ticket extension" \ |
| 2867 | -c "found session_ticket extension" \ |
| 2868 | -c "parse new session ticket" \ |
| 2869 | -S "session successfully restored from cache" \ |
| 2870 | -s "session successfully restored from ticket" \ |
| 2871 | -s "a session has been resumed" \ |
| 2872 | -c "a session has been resumed" |
| 2873 | |
| 2874 | run_test "Session resume using tickets: CAMELLIA-192-CCM" \ |
| 2875 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-192-CCM" \ |
| 2876 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2877 | 0 \ |
| 2878 | -c "client hello, adding session ticket extension" \ |
| 2879 | -s "found session ticket extension" \ |
| 2880 | -s "server hello, adding session ticket extension" \ |
| 2881 | -c "found session_ticket extension" \ |
| 2882 | -c "parse new session ticket" \ |
| 2883 | -S "session successfully restored from cache" \ |
| 2884 | -s "session successfully restored from ticket" \ |
| 2885 | -s "a session has been resumed" \ |
| 2886 | -c "a session has been resumed" |
| 2887 | |
| 2888 | run_test "Session resume using tickets: CAMELLIA-256-CCM" \ |
| 2889 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-256-CCM" \ |
| 2890 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2891 | 0 \ |
| 2892 | -c "client hello, adding session ticket extension" \ |
| 2893 | -s "found session ticket extension" \ |
| 2894 | -s "server hello, adding session ticket extension" \ |
| 2895 | -c "found session_ticket extension" \ |
| 2896 | -c "parse new session ticket" \ |
| 2897 | -S "session successfully restored from cache" \ |
| 2898 | -s "session successfully restored from ticket" \ |
| 2899 | -s "a session has been resumed" \ |
| 2900 | -c "a session has been resumed" |
| 2901 | |
| 2902 | run_test "Session resume using tickets: ARIA-128-GCM" \ |
| 2903 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-GCM" \ |
| 2904 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2905 | 0 \ |
| 2906 | -c "client hello, adding session ticket extension" \ |
| 2907 | -s "found session ticket extension" \ |
| 2908 | -s "server hello, adding session ticket extension" \ |
| 2909 | -c "found session_ticket extension" \ |
| 2910 | -c "parse new session ticket" \ |
| 2911 | -S "session successfully restored from cache" \ |
| 2912 | -s "session successfully restored from ticket" \ |
| 2913 | -s "a session has been resumed" \ |
| 2914 | -c "a session has been resumed" |
| 2915 | |
| 2916 | run_test "Session resume using tickets: ARIA-192-GCM" \ |
| 2917 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-GCM" \ |
| 2918 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2919 | 0 \ |
| 2920 | -c "client hello, adding session ticket extension" \ |
| 2921 | -s "found session ticket extension" \ |
| 2922 | -s "server hello, adding session ticket extension" \ |
| 2923 | -c "found session_ticket extension" \ |
| 2924 | -c "parse new session ticket" \ |
| 2925 | -S "session successfully restored from cache" \ |
| 2926 | -s "session successfully restored from ticket" \ |
| 2927 | -s "a session has been resumed" \ |
| 2928 | -c "a session has been resumed" |
| 2929 | |
| 2930 | run_test "Session resume using tickets: ARIA-256-GCM" \ |
| 2931 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-GCM" \ |
| 2932 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2933 | 0 \ |
| 2934 | -c "client hello, adding session ticket extension" \ |
| 2935 | -s "found session ticket extension" \ |
| 2936 | -s "server hello, adding session ticket extension" \ |
| 2937 | -c "found session_ticket extension" \ |
| 2938 | -c "parse new session ticket" \ |
| 2939 | -S "session successfully restored from cache" \ |
| 2940 | -s "session successfully restored from ticket" \ |
| 2941 | -s "a session has been resumed" \ |
| 2942 | -c "a session has been resumed" |
| 2943 | |
| 2944 | run_test "Session resume using tickets: ARIA-128-CCM" \ |
| 2945 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-CCM" \ |
| 2946 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2947 | 0 \ |
| 2948 | -c "client hello, adding session ticket extension" \ |
| 2949 | -s "found session ticket extension" \ |
| 2950 | -s "server hello, adding session ticket extension" \ |
| 2951 | -c "found session_ticket extension" \ |
| 2952 | -c "parse new session ticket" \ |
| 2953 | -S "session successfully restored from cache" \ |
| 2954 | -s "session successfully restored from ticket" \ |
| 2955 | -s "a session has been resumed" \ |
| 2956 | -c "a session has been resumed" |
| 2957 | |
| 2958 | run_test "Session resume using tickets: ARIA-192-CCM" \ |
| 2959 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-CCM" \ |
| 2960 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2961 | 0 \ |
| 2962 | -c "client hello, adding session ticket extension" \ |
| 2963 | -s "found session ticket extension" \ |
| 2964 | -s "server hello, adding session ticket extension" \ |
| 2965 | -c "found session_ticket extension" \ |
| 2966 | -c "parse new session ticket" \ |
| 2967 | -S "session successfully restored from cache" \ |
| 2968 | -s "session successfully restored from ticket" \ |
| 2969 | -s "a session has been resumed" \ |
| 2970 | -c "a session has been resumed" |
| 2971 | |
| 2972 | run_test "Session resume using tickets: ARIA-256-CCM" \ |
| 2973 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-CCM" \ |
| 2974 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2975 | 0 \ |
| 2976 | -c "client hello, adding session ticket extension" \ |
| 2977 | -s "found session ticket extension" \ |
| 2978 | -s "server hello, adding session ticket extension" \ |
| 2979 | -c "found session_ticket extension" \ |
| 2980 | -c "parse new session ticket" \ |
| 2981 | -S "session successfully restored from cache" \ |
| 2982 | -s "session successfully restored from ticket" \ |
| 2983 | -s "a session has been resumed" \ |
| 2984 | -c "a session has been resumed" |
| 2985 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2986 | # Tests for Session Tickets with DTLS |
| 2987 | |
| 2988 | run_test "Session resume using tickets, DTLS: basic" \ |
| 2989 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2990 | "$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] | 2991 | 0 \ |
| 2992 | -c "client hello, adding session ticket extension" \ |
| 2993 | -s "found session ticket extension" \ |
| 2994 | -s "server hello, adding session ticket extension" \ |
| 2995 | -c "found session_ticket extension" \ |
| 2996 | -c "parse new session ticket" \ |
| 2997 | -S "session successfully restored from cache" \ |
| 2998 | -s "session successfully restored from ticket" \ |
| 2999 | -s "a session has been resumed" \ |
| 3000 | -c "a session has been resumed" |
| 3001 | |
| 3002 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 3003 | "$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] | 3004 | "$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] | 3005 | 0 \ |
| 3006 | -c "client hello, adding session ticket extension" \ |
| 3007 | -s "found session ticket extension" \ |
| 3008 | -s "server hello, adding session ticket extension" \ |
| 3009 | -c "found session_ticket extension" \ |
| 3010 | -c "parse new session ticket" \ |
| 3011 | -S "session successfully restored from cache" \ |
| 3012 | -s "session successfully restored from ticket" \ |
| 3013 | -s "a session has been resumed" \ |
| 3014 | -c "a session has been resumed" |
| 3015 | |
| 3016 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 3017 | "$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] | 3018 | "$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] | 3019 | 0 \ |
| 3020 | -c "client hello, adding session ticket extension" \ |
| 3021 | -s "found session ticket extension" \ |
| 3022 | -s "server hello, adding session ticket extension" \ |
| 3023 | -c "found session_ticket extension" \ |
| 3024 | -c "parse new session ticket" \ |
| 3025 | -S "session successfully restored from cache" \ |
| 3026 | -S "session successfully restored from ticket" \ |
| 3027 | -S "a session has been resumed" \ |
| 3028 | -C "a session has been resumed" |
| 3029 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3030 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 3031 | "$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] | 3032 | "$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] | 3033 | 0 \ |
| 3034 | -c "client hello, adding session ticket extension" \ |
| 3035 | -s "found session ticket extension" \ |
| 3036 | -s "server hello, adding session ticket extension" \ |
| 3037 | -c "found session_ticket extension" \ |
| 3038 | -c "parse new session ticket" \ |
| 3039 | -S "session successfully restored from cache" \ |
| 3040 | -s "session successfully restored from ticket" \ |
| 3041 | -s "a session has been resumed" \ |
| 3042 | -c "a session has been resumed" |
| 3043 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3044 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 3045 | "$O_SRV -dtls" \ |
| 3046 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 3047 | 0 \ |
| 3048 | -c "client hello, adding session ticket extension" \ |
| 3049 | -c "found session_ticket extension" \ |
| 3050 | -c "parse new session ticket" \ |
| 3051 | -c "a session has been resumed" |
| 3052 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3053 | # 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] | 3054 | # 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] | 3055 | requires_openssl_next |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3056 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 3057 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3058 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 3059 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3060 | rm -f $SESSION )" \ |
| 3061 | 0 \ |
| 3062 | -s "found session ticket extension" \ |
| 3063 | -s "server hello, adding session ticket extension" \ |
| 3064 | -S "session successfully restored from cache" \ |
| 3065 | -s "session successfully restored from ticket" \ |
| 3066 | -s "a session has been resumed" |
| 3067 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3068 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3069 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3070 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3071 | "$P_SRV debug_level=3 tickets=0" \ |
| 3072 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3073 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3074 | -c "client hello, adding session ticket extension" \ |
| 3075 | -s "found session ticket extension" \ |
| 3076 | -S "server hello, adding session ticket extension" \ |
| 3077 | -C "found session_ticket extension" \ |
| 3078 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3079 | -s "session successfully restored from cache" \ |
| 3080 | -S "session successfully restored from ticket" \ |
| 3081 | -s "a session has been resumed" \ |
| 3082 | -c "a session has been resumed" |
| 3083 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3084 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3085 | "$P_SRV debug_level=3 tickets=1" \ |
| 3086 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3087 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3088 | -C "client hello, adding session ticket extension" \ |
| 3089 | -S "found session ticket extension" \ |
| 3090 | -S "server hello, adding session ticket extension" \ |
| 3091 | -C "found session_ticket extension" \ |
| 3092 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3093 | -s "session successfully restored from cache" \ |
| 3094 | -S "session successfully restored from ticket" \ |
| 3095 | -s "a session has been resumed" \ |
| 3096 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3097 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3098 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3099 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 3100 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3101 | 0 \ |
| 3102 | -S "session successfully restored from cache" \ |
| 3103 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3104 | -S "a session has been resumed" \ |
| 3105 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3106 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3107 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3108 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 3109 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3110 | 0 \ |
| 3111 | -s "session successfully restored from cache" \ |
| 3112 | -S "session successfully restored from ticket" \ |
| 3113 | -s "a session has been resumed" \ |
| 3114 | -c "a session has been resumed" |
| 3115 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 3116 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3117 | "$P_SRV debug_level=3 tickets=0" \ |
| 3118 | "$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] | 3119 | 0 \ |
| 3120 | -s "session successfully restored from cache" \ |
| 3121 | -S "session successfully restored from ticket" \ |
| 3122 | -s "a session has been resumed" \ |
| 3123 | -c "a session has been resumed" |
| 3124 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3125 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3126 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 3127 | "$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] | 3128 | 0 \ |
| 3129 | -S "session successfully restored from cache" \ |
| 3130 | -S "session successfully restored from ticket" \ |
| 3131 | -S "a session has been resumed" \ |
| 3132 | -C "a session has been resumed" |
| 3133 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3134 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3135 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 3136 | "$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] | 3137 | 0 \ |
| 3138 | -s "session successfully restored from cache" \ |
| 3139 | -S "session successfully restored from ticket" \ |
| 3140 | -s "a session has been resumed" \ |
| 3141 | -c "a session has been resumed" |
| 3142 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3143 | run_test "Session resume using cache: session copy" \ |
| 3144 | "$P_SRV debug_level=3 tickets=0" \ |
| 3145 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 3146 | 0 \ |
| 3147 | -s "session successfully restored from cache" \ |
| 3148 | -S "session successfully restored from ticket" \ |
| 3149 | -s "a session has been resumed" \ |
| 3150 | -c "a session has been resumed" |
| 3151 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3152 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3153 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3154 | "( $O_CLI -sess_out $SESSION; \ |
| 3155 | $O_CLI -sess_in $SESSION; \ |
| 3156 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 3157 | 0 \ |
| 3158 | -s "found session ticket extension" \ |
| 3159 | -S "server hello, adding session ticket extension" \ |
| 3160 | -s "session successfully restored from cache" \ |
| 3161 | -S "session successfully restored from ticket" \ |
| 3162 | -s "a session has been resumed" |
| 3163 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3164 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 3165 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3166 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 3167 | 0 \ |
| 3168 | -C "found session_ticket extension" \ |
| 3169 | -C "parse new session ticket" \ |
| 3170 | -c "a session has been resumed" |
| 3171 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3172 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 3173 | |
| 3174 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 3175 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3176 | "$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] | 3177 | 0 \ |
| 3178 | -c "client hello, adding session ticket extension" \ |
| 3179 | -s "found session ticket extension" \ |
| 3180 | -S "server hello, adding session ticket extension" \ |
| 3181 | -C "found session_ticket extension" \ |
| 3182 | -C "parse new session ticket" \ |
| 3183 | -s "session successfully restored from cache" \ |
| 3184 | -S "session successfully restored from ticket" \ |
| 3185 | -s "a session has been resumed" \ |
| 3186 | -c "a session has been resumed" |
| 3187 | |
| 3188 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 3189 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3190 | "$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] | 3191 | 0 \ |
| 3192 | -C "client hello, adding session ticket extension" \ |
| 3193 | -S "found session ticket extension" \ |
| 3194 | -S "server hello, adding session ticket extension" \ |
| 3195 | -C "found session_ticket extension" \ |
| 3196 | -C "parse new session ticket" \ |
| 3197 | -s "session successfully restored from cache" \ |
| 3198 | -S "session successfully restored from ticket" \ |
| 3199 | -s "a session has been resumed" \ |
| 3200 | -c "a session has been resumed" |
| 3201 | |
| 3202 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 3203 | "$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] | 3204 | "$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] | 3205 | 0 \ |
| 3206 | -S "session successfully restored from cache" \ |
| 3207 | -S "session successfully restored from ticket" \ |
| 3208 | -S "a session has been resumed" \ |
| 3209 | -C "a session has been resumed" |
| 3210 | |
| 3211 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 3212 | "$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] | 3213 | "$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] | 3214 | 0 \ |
| 3215 | -s "session successfully restored from cache" \ |
| 3216 | -S "session successfully restored from ticket" \ |
| 3217 | -s "a session has been resumed" \ |
| 3218 | -c "a session has been resumed" |
| 3219 | |
| 3220 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 3221 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3222 | "$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] | 3223 | 0 \ |
| 3224 | -s "session successfully restored from cache" \ |
| 3225 | -S "session successfully restored from ticket" \ |
| 3226 | -s "a session has been resumed" \ |
| 3227 | -c "a session has been resumed" |
| 3228 | |
| 3229 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 3230 | "$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] | 3231 | "$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] | 3232 | 0 \ |
| 3233 | -S "session successfully restored from cache" \ |
| 3234 | -S "session successfully restored from ticket" \ |
| 3235 | -S "a session has been resumed" \ |
| 3236 | -C "a session has been resumed" |
| 3237 | |
| 3238 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 3239 | "$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] | 3240 | "$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] | 3241 | 0 \ |
| 3242 | -s "session successfully restored from cache" \ |
| 3243 | -S "session successfully restored from ticket" \ |
| 3244 | -s "a session has been resumed" \ |
| 3245 | -c "a session has been resumed" |
| 3246 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3247 | run_test "Session resume using cache, DTLS: session copy" \ |
| 3248 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3249 | "$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] | 3250 | 0 \ |
| 3251 | -s "session successfully restored from cache" \ |
| 3252 | -S "session successfully restored from ticket" \ |
| 3253 | -s "a session has been resumed" \ |
| 3254 | -c "a session has been resumed" |
| 3255 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3256 | # 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] | 3257 | # 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] | 3258 | requires_openssl_next |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3259 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 3260 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3261 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 3262 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3263 | rm -f $SESSION )" \ |
| 3264 | 0 \ |
| 3265 | -s "found session ticket extension" \ |
| 3266 | -S "server hello, adding session ticket extension" \ |
| 3267 | -s "session successfully restored from cache" \ |
| 3268 | -S "session successfully restored from ticket" \ |
| 3269 | -s "a session has been resumed" |
| 3270 | |
| 3271 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 3272 | "$O_SRV -dtls" \ |
| 3273 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 3274 | 0 \ |
| 3275 | -C "found session_ticket extension" \ |
| 3276 | -C "parse new session ticket" \ |
| 3277 | -c "a session has been resumed" |
| 3278 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3279 | # Tests for Max Fragment Length extension |
| 3280 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3281 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3282 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3283 | "$P_SRV debug_level=3" \ |
| 3284 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3285 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3286 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3287 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3288 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3289 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3290 | -C "client hello, adding max_fragment_length extension" \ |
| 3291 | -S "found max fragment length extension" \ |
| 3292 | -S "server hello, max_fragment_length extension" \ |
| 3293 | -C "found max_fragment_length extension" |
| 3294 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3295 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3296 | run_test "Max fragment length: enabled, default, larger message" \ |
| 3297 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3298 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3299 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3300 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3301 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3302 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3303 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3304 | -C "client hello, adding max_fragment_length extension" \ |
| 3305 | -S "found max fragment length extension" \ |
| 3306 | -S "server hello, max_fragment_length extension" \ |
| 3307 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3308 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3309 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3310 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3311 | |
| 3312 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3313 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 3314 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3315 | "$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] | 3316 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3317 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3318 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3319 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3320 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3321 | -C "client hello, adding max_fragment_length extension" \ |
| 3322 | -S "found max fragment length extension" \ |
| 3323 | -S "server hello, max_fragment_length extension" \ |
| 3324 | -C "found max_fragment_length extension" \ |
| 3325 | -c "fragment larger than.*maximum " |
| 3326 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3327 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 3328 | # (session fragment length will be 16384 regardless of mbedtls |
| 3329 | # content length configuration.) |
| 3330 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3331 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3332 | run_test "Max fragment length: disabled, larger message" \ |
| 3333 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3334 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3335 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3336 | -C "Maximum incoming record payload length is 16384" \ |
| 3337 | -C "Maximum outgoing record payload length is 16384" \ |
| 3338 | -S "Maximum incoming record payload length is 16384" \ |
| 3339 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3340 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3341 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3342 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3343 | |
| 3344 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 3345 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3346 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3347 | "$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] | 3348 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3349 | -C "Maximum incoming record payload length is 16384" \ |
| 3350 | -C "Maximum outgoing record payload length is 16384" \ |
| 3351 | -S "Maximum incoming record payload length is 16384" \ |
| 3352 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3353 | -c "fragment larger than.*maximum " |
| 3354 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3355 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3356 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3357 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3358 | "$P_SRV debug_level=3" \ |
| 3359 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3360 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3361 | -c "Maximum incoming record payload length is 4096" \ |
| 3362 | -c "Maximum outgoing record payload length is 4096" \ |
| 3363 | -s "Maximum incoming record payload length is 4096" \ |
| 3364 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3365 | -c "client hello, adding max_fragment_length extension" \ |
| 3366 | -s "found max fragment length extension" \ |
| 3367 | -s "server hello, max_fragment_length extension" \ |
| 3368 | -c "found max_fragment_length extension" |
| 3369 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3370 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3371 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3372 | run_test "Max fragment length: client 512, server 1024" \ |
| 3373 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3374 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3375 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3376 | -c "Maximum incoming record payload length is 512" \ |
| 3377 | -c "Maximum outgoing record payload length is 512" \ |
| 3378 | -s "Maximum incoming record payload length is 512" \ |
| 3379 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3380 | -c "client hello, adding max_fragment_length extension" \ |
| 3381 | -s "found max fragment length extension" \ |
| 3382 | -s "server hello, max_fragment_length extension" \ |
| 3383 | -c "found max_fragment_length extension" |
| 3384 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3385 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3386 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3387 | run_test "Max fragment length: client 512, server 2048" \ |
| 3388 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3389 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3390 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3391 | -c "Maximum incoming record payload length is 512" \ |
| 3392 | -c "Maximum outgoing record payload length is 512" \ |
| 3393 | -s "Maximum incoming record payload length is 512" \ |
| 3394 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3395 | -c "client hello, adding max_fragment_length extension" \ |
| 3396 | -s "found max fragment length extension" \ |
| 3397 | -s "server hello, max_fragment_length extension" \ |
| 3398 | -c "found max_fragment_length extension" |
| 3399 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3400 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3401 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3402 | run_test "Max fragment length: client 512, server 4096" \ |
| 3403 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3404 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3405 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3406 | -c "Maximum incoming record payload length is 512" \ |
| 3407 | -c "Maximum outgoing record payload length is 512" \ |
| 3408 | -s "Maximum incoming record payload length is 512" \ |
| 3409 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3410 | -c "client hello, adding max_fragment_length extension" \ |
| 3411 | -s "found max fragment length extension" \ |
| 3412 | -s "server hello, max_fragment_length extension" \ |
| 3413 | -c "found max_fragment_length extension" |
| 3414 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3415 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3416 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3417 | run_test "Max fragment length: client 1024, server 512" \ |
| 3418 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3419 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3420 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3421 | -c "Maximum incoming record payload length is 1024" \ |
| 3422 | -c "Maximum outgoing record payload length is 1024" \ |
| 3423 | -s "Maximum incoming record payload length is 1024" \ |
| 3424 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3425 | -c "client hello, adding max_fragment_length extension" \ |
| 3426 | -s "found max fragment length extension" \ |
| 3427 | -s "server hello, max_fragment_length extension" \ |
| 3428 | -c "found max_fragment_length extension" |
| 3429 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3430 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3431 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3432 | run_test "Max fragment length: client 1024, server 2048" \ |
| 3433 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3434 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3435 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3436 | -c "Maximum incoming record payload length is 1024" \ |
| 3437 | -c "Maximum outgoing record payload length is 1024" \ |
| 3438 | -s "Maximum incoming record payload length is 1024" \ |
| 3439 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3440 | -c "client hello, adding max_fragment_length extension" \ |
| 3441 | -s "found max fragment length extension" \ |
| 3442 | -s "server hello, max_fragment_length extension" \ |
| 3443 | -c "found max_fragment_length extension" |
| 3444 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3445 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3446 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3447 | run_test "Max fragment length: client 1024, server 4096" \ |
| 3448 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3449 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3450 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3451 | -c "Maximum incoming record payload length is 1024" \ |
| 3452 | -c "Maximum outgoing record payload length is 1024" \ |
| 3453 | -s "Maximum incoming record payload length is 1024" \ |
| 3454 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3455 | -c "client hello, adding max_fragment_length extension" \ |
| 3456 | -s "found max fragment length extension" \ |
| 3457 | -s "server hello, max_fragment_length extension" \ |
| 3458 | -c "found max_fragment_length extension" |
| 3459 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3460 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3461 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3462 | run_test "Max fragment length: client 2048, server 512" \ |
| 3463 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3464 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3465 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3466 | -c "Maximum incoming record payload length is 2048" \ |
| 3467 | -c "Maximum outgoing record payload length is 2048" \ |
| 3468 | -s "Maximum incoming record payload length is 2048" \ |
| 3469 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3470 | -c "client hello, adding max_fragment_length extension" \ |
| 3471 | -s "found max fragment length extension" \ |
| 3472 | -s "server hello, max_fragment_length extension" \ |
| 3473 | -c "found max_fragment_length extension" |
| 3474 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3475 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3476 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3477 | run_test "Max fragment length: client 2048, server 1024" \ |
| 3478 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3479 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3480 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3481 | -c "Maximum incoming record payload length is 2048" \ |
| 3482 | -c "Maximum outgoing record payload length is 2048" \ |
| 3483 | -s "Maximum incoming record payload length is 2048" \ |
| 3484 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3485 | -c "client hello, adding max_fragment_length extension" \ |
| 3486 | -s "found max fragment length extension" \ |
| 3487 | -s "server hello, max_fragment_length extension" \ |
| 3488 | -c "found max_fragment_length extension" |
| 3489 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3490 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3491 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3492 | run_test "Max fragment length: client 2048, server 4096" \ |
| 3493 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3494 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3495 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3496 | -c "Maximum incoming record payload length is 2048" \ |
| 3497 | -c "Maximum outgoing record payload length is 2048" \ |
| 3498 | -s "Maximum incoming record payload length is 2048" \ |
| 3499 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3500 | -c "client hello, adding max_fragment_length extension" \ |
| 3501 | -s "found max fragment length extension" \ |
| 3502 | -s "server hello, max_fragment_length extension" \ |
| 3503 | -c "found max_fragment_length extension" |
| 3504 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3505 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3506 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3507 | run_test "Max fragment length: client 4096, server 512" \ |
| 3508 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3509 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3510 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3511 | -c "Maximum incoming record payload length is 4096" \ |
| 3512 | -c "Maximum outgoing record payload length is 4096" \ |
| 3513 | -s "Maximum incoming record payload length is 4096" \ |
| 3514 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3515 | -c "client hello, adding max_fragment_length extension" \ |
| 3516 | -s "found max fragment length extension" \ |
| 3517 | -s "server hello, max_fragment_length extension" \ |
| 3518 | -c "found max_fragment_length extension" |
| 3519 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3520 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3521 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3522 | run_test "Max fragment length: client 4096, server 1024" \ |
| 3523 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3524 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3525 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3526 | -c "Maximum incoming record payload length is 4096" \ |
| 3527 | -c "Maximum outgoing record payload length is 4096" \ |
| 3528 | -s "Maximum incoming record payload length is 4096" \ |
| 3529 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3530 | -c "client hello, adding max_fragment_length extension" \ |
| 3531 | -s "found max fragment length extension" \ |
| 3532 | -s "server hello, max_fragment_length extension" \ |
| 3533 | -c "found max_fragment_length extension" |
| 3534 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3535 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3536 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3537 | run_test "Max fragment length: client 4096, server 2048" \ |
| 3538 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3539 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3540 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3541 | -c "Maximum incoming record payload length is 4096" \ |
| 3542 | -c "Maximum outgoing record payload length is 4096" \ |
| 3543 | -s "Maximum incoming record payload length is 4096" \ |
| 3544 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3545 | -c "client hello, adding max_fragment_length extension" \ |
| 3546 | -s "found max fragment length extension" \ |
| 3547 | -s "server hello, max_fragment_length extension" \ |
| 3548 | -c "found max_fragment_length extension" |
| 3549 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3550 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3551 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3552 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3553 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3554 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3555 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3556 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3557 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3558 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3559 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3560 | -C "client hello, adding max_fragment_length extension" \ |
| 3561 | -S "found max fragment length extension" \ |
| 3562 | -S "server hello, max_fragment_length extension" \ |
| 3563 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3564 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3565 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3566 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3567 | requires_gnutls |
| 3568 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3569 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3570 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3571 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3572 | -c "Maximum incoming record payload length is 4096" \ |
| 3573 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3574 | -c "client hello, adding max_fragment_length extension" \ |
| 3575 | -c "found max_fragment_length extension" |
| 3576 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3577 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3578 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3579 | run_test "Max fragment length: client, message just fits" \ |
| 3580 | "$P_SRV debug_level=3" \ |
| 3581 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 3582 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3583 | -c "Maximum incoming record payload length is 2048" \ |
| 3584 | -c "Maximum outgoing record payload length is 2048" \ |
| 3585 | -s "Maximum incoming record payload length is 2048" \ |
| 3586 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3587 | -c "client hello, adding max_fragment_length extension" \ |
| 3588 | -s "found max fragment length extension" \ |
| 3589 | -s "server hello, max_fragment_length extension" \ |
| 3590 | -c "found max_fragment_length extension" \ |
| 3591 | -c "2048 bytes written in 1 fragments" \ |
| 3592 | -s "2048 bytes read" |
| 3593 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3594 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3595 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3596 | run_test "Max fragment length: client, larger message" \ |
| 3597 | "$P_SRV debug_level=3" \ |
| 3598 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 3599 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3600 | -c "Maximum incoming record payload length is 2048" \ |
| 3601 | -c "Maximum outgoing record payload length is 2048" \ |
| 3602 | -s "Maximum incoming record payload length is 2048" \ |
| 3603 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3604 | -c "client hello, adding max_fragment_length extension" \ |
| 3605 | -s "found max fragment length extension" \ |
| 3606 | -s "server hello, max_fragment_length extension" \ |
| 3607 | -c "found max_fragment_length extension" \ |
| 3608 | -c "2345 bytes written in 2 fragments" \ |
| 3609 | -s "2048 bytes read" \ |
| 3610 | -s "297 bytes read" |
| 3611 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3612 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3613 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 3614 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3615 | "$P_SRV debug_level=3 dtls=1" \ |
| 3616 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 3617 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3618 | -c "Maximum incoming record payload length is 2048" \ |
| 3619 | -c "Maximum outgoing record payload length is 2048" \ |
| 3620 | -s "Maximum incoming record payload length is 2048" \ |
| 3621 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3622 | -c "client hello, adding max_fragment_length extension" \ |
| 3623 | -s "found max fragment length extension" \ |
| 3624 | -s "server hello, max_fragment_length extension" \ |
| 3625 | -c "found max_fragment_length extension" \ |
| 3626 | -c "fragment larger than.*maximum" |
| 3627 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3628 | # Tests for renegotiation |
| 3629 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3630 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3631 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3632 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3633 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3634 | 0 \ |
| 3635 | -C "client hello, adding renegotiation extension" \ |
| 3636 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3637 | -S "found renegotiation extension" \ |
| 3638 | -s "server hello, secure renegotiation extension" \ |
| 3639 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3640 | -C "=> renegotiate" \ |
| 3641 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3642 | -S "write hello request" |
| 3643 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3644 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3645 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3646 | "$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] | 3647 | "$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] | 3648 | 0 \ |
| 3649 | -c "client hello, adding renegotiation extension" \ |
| 3650 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3651 | -s "found renegotiation extension" \ |
| 3652 | -s "server hello, secure renegotiation extension" \ |
| 3653 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3654 | -c "=> renegotiate" \ |
| 3655 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3656 | -S "write hello request" |
| 3657 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3658 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3659 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3660 | "$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] | 3661 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3662 | 0 \ |
| 3663 | -c "client hello, adding renegotiation extension" \ |
| 3664 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3665 | -s "found renegotiation extension" \ |
| 3666 | -s "server hello, secure renegotiation extension" \ |
| 3667 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3668 | -c "=> renegotiate" \ |
| 3669 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3670 | -s "write hello request" |
| 3671 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3672 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3673 | # 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] | 3674 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3675 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3676 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 3677 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 3678 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3679 | 0 \ |
| 3680 | -c "client hello, adding renegotiation extension" \ |
| 3681 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3682 | -s "found renegotiation extension" \ |
| 3683 | -s "server hello, secure renegotiation extension" \ |
| 3684 | -c "found renegotiation extension" \ |
| 3685 | -c "=> renegotiate" \ |
| 3686 | -s "=> renegotiate" \ |
| 3687 | -S "write hello request" \ |
| 3688 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3689 | |
| 3690 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3691 | # 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] | 3692 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3693 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3694 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 3695 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 3696 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3697 | 0 \ |
| 3698 | -c "client hello, adding renegotiation extension" \ |
| 3699 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3700 | -s "found renegotiation extension" \ |
| 3701 | -s "server hello, secure renegotiation extension" \ |
| 3702 | -c "found renegotiation extension" \ |
| 3703 | -c "=> renegotiate" \ |
| 3704 | -s "=> renegotiate" \ |
| 3705 | -s "write hello request" \ |
| 3706 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3707 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3708 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3709 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3710 | "$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] | 3711 | "$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] | 3712 | 0 \ |
| 3713 | -c "client hello, adding renegotiation extension" \ |
| 3714 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3715 | -s "found renegotiation extension" \ |
| 3716 | -s "server hello, secure renegotiation extension" \ |
| 3717 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3718 | -c "=> renegotiate" \ |
| 3719 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3720 | -s "write hello request" |
| 3721 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3722 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3723 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3724 | requires_max_content_len 2048 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3725 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 3726 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 3727 | "$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" \ |
| 3728 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3729 | -c "Maximum incoming record payload length is 2048" \ |
| 3730 | -c "Maximum outgoing record payload length is 2048" \ |
| 3731 | -s "Maximum incoming record payload length is 2048" \ |
| 3732 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3733 | -c "client hello, adding max_fragment_length extension" \ |
| 3734 | -s "found max fragment length extension" \ |
| 3735 | -s "server hello, max_fragment_length extension" \ |
| 3736 | -c "found max_fragment_length extension" \ |
| 3737 | -c "client hello, adding renegotiation extension" \ |
| 3738 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3739 | -s "found renegotiation extension" \ |
| 3740 | -s "server hello, secure renegotiation extension" \ |
| 3741 | -c "found renegotiation extension" \ |
| 3742 | -c "=> renegotiate" \ |
| 3743 | -s "=> renegotiate" \ |
| 3744 | -s "write hello request" |
| 3745 | |
| 3746 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3747 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3748 | "$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] | 3749 | "$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] | 3750 | 1 \ |
| 3751 | -c "client hello, adding renegotiation extension" \ |
| 3752 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3753 | -S "found renegotiation extension" \ |
| 3754 | -s "server hello, secure renegotiation extension" \ |
| 3755 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3756 | -c "=> renegotiate" \ |
| 3757 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3758 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 3759 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3760 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3761 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3762 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3763 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3764 | "$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] | 3765 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3766 | 0 \ |
| 3767 | -C "client hello, adding renegotiation extension" \ |
| 3768 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3769 | -S "found renegotiation extension" \ |
| 3770 | -s "server hello, secure renegotiation extension" \ |
| 3771 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3772 | -C "=> renegotiate" \ |
| 3773 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3774 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 3775 | -S "SSL - An unexpected message was received from our peer" \ |
| 3776 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3777 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3778 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3779 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3780 | "$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] | 3781 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3782 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3783 | 0 \ |
| 3784 | -C "client hello, adding renegotiation extension" \ |
| 3785 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3786 | -S "found renegotiation extension" \ |
| 3787 | -s "server hello, secure renegotiation extension" \ |
| 3788 | -c "found renegotiation extension" \ |
| 3789 | -C "=> renegotiate" \ |
| 3790 | -S "=> renegotiate" \ |
| 3791 | -s "write hello request" \ |
| 3792 | -S "SSL - An unexpected message was received from our peer" \ |
| 3793 | -S "failed" |
| 3794 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3795 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3796 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3797 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3798 | "$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] | 3799 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3800 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3801 | 0 \ |
| 3802 | -C "client hello, adding renegotiation extension" \ |
| 3803 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3804 | -S "found renegotiation extension" \ |
| 3805 | -s "server hello, secure renegotiation extension" \ |
| 3806 | -c "found renegotiation extension" \ |
| 3807 | -C "=> renegotiate" \ |
| 3808 | -S "=> renegotiate" \ |
| 3809 | -s "write hello request" \ |
| 3810 | -S "SSL - An unexpected message was received from our peer" \ |
| 3811 | -S "failed" |
| 3812 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3813 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3814 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3815 | "$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] | 3816 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3817 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3818 | 0 \ |
| 3819 | -C "client hello, adding renegotiation extension" \ |
| 3820 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3821 | -S "found renegotiation extension" \ |
| 3822 | -s "server hello, secure renegotiation extension" \ |
| 3823 | -c "found renegotiation extension" \ |
| 3824 | -C "=> renegotiate" \ |
| 3825 | -S "=> renegotiate" \ |
| 3826 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3827 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3828 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3829 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3830 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3831 | "$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] | 3832 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3833 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3834 | 0 \ |
| 3835 | -c "client hello, adding renegotiation extension" \ |
| 3836 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3837 | -s "found renegotiation extension" \ |
| 3838 | -s "server hello, secure renegotiation extension" \ |
| 3839 | -c "found renegotiation extension" \ |
| 3840 | -c "=> renegotiate" \ |
| 3841 | -s "=> renegotiate" \ |
| 3842 | -s "write hello request" \ |
| 3843 | -S "SSL - An unexpected message was received from our peer" \ |
| 3844 | -S "failed" |
| 3845 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3846 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3847 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3848 | "$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] | 3849 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3850 | 0 \ |
| 3851 | -C "client hello, adding renegotiation extension" \ |
| 3852 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3853 | -S "found renegotiation extension" \ |
| 3854 | -s "server hello, secure renegotiation extension" \ |
| 3855 | -c "found renegotiation extension" \ |
| 3856 | -S "record counter limit reached: renegotiate" \ |
| 3857 | -C "=> renegotiate" \ |
| 3858 | -S "=> renegotiate" \ |
| 3859 | -S "write hello request" \ |
| 3860 | -S "SSL - An unexpected message was received from our peer" \ |
| 3861 | -S "failed" |
| 3862 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 3863 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3864 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3865 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3866 | "$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] | 3867 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3868 | 0 \ |
| 3869 | -c "client hello, adding renegotiation extension" \ |
| 3870 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3871 | -s "found renegotiation extension" \ |
| 3872 | -s "server hello, secure renegotiation extension" \ |
| 3873 | -c "found renegotiation extension" \ |
| 3874 | -s "record counter limit reached: renegotiate" \ |
| 3875 | -c "=> renegotiate" \ |
| 3876 | -s "=> renegotiate" \ |
| 3877 | -s "write hello request" \ |
| 3878 | -S "SSL - An unexpected message was received from our peer" \ |
| 3879 | -S "failed" |
| 3880 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3881 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3882 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3883 | "$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] | 3884 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3885 | 0 \ |
| 3886 | -c "client hello, adding renegotiation extension" \ |
| 3887 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3888 | -s "found renegotiation extension" \ |
| 3889 | -s "server hello, secure renegotiation extension" \ |
| 3890 | -c "found renegotiation extension" \ |
| 3891 | -s "record counter limit reached: renegotiate" \ |
| 3892 | -c "=> renegotiate" \ |
| 3893 | -s "=> renegotiate" \ |
| 3894 | -s "write hello request" \ |
| 3895 | -S "SSL - An unexpected message was received from our peer" \ |
| 3896 | -S "failed" |
| 3897 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3898 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3899 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3900 | "$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] | 3901 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 3902 | 0 \ |
| 3903 | -C "client hello, adding renegotiation extension" \ |
| 3904 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3905 | -S "found renegotiation extension" \ |
| 3906 | -s "server hello, secure renegotiation extension" \ |
| 3907 | -c "found renegotiation extension" \ |
| 3908 | -S "record counter limit reached: renegotiate" \ |
| 3909 | -C "=> renegotiate" \ |
| 3910 | -S "=> renegotiate" \ |
| 3911 | -S "write hello request" \ |
| 3912 | -S "SSL - An unexpected message was received from our peer" \ |
| 3913 | -S "failed" |
| 3914 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3915 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3916 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3917 | "$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] | 3918 | "$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] | 3919 | 0 \ |
| 3920 | -c "client hello, adding renegotiation extension" \ |
| 3921 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3922 | -s "found renegotiation extension" \ |
| 3923 | -s "server hello, secure renegotiation extension" \ |
| 3924 | -c "found renegotiation extension" \ |
| 3925 | -c "=> renegotiate" \ |
| 3926 | -s "=> renegotiate" \ |
| 3927 | -S "write hello request" |
| 3928 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3929 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3930 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3931 | "$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] | 3932 | "$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] | 3933 | 0 \ |
| 3934 | -c "client hello, adding renegotiation extension" \ |
| 3935 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3936 | -s "found renegotiation extension" \ |
| 3937 | -s "server hello, secure renegotiation extension" \ |
| 3938 | -c "found renegotiation extension" \ |
| 3939 | -c "=> renegotiate" \ |
| 3940 | -s "=> renegotiate" \ |
| 3941 | -s "write hello request" |
| 3942 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3943 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3944 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 3945 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3946 | "$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] | 3947 | 0 \ |
| 3948 | -c "client hello, adding renegotiation extension" \ |
| 3949 | -c "found renegotiation extension" \ |
| 3950 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3951 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3952 | -C "error" \ |
| 3953 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3954 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3955 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3956 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3957 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 3958 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3959 | "$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] | 3960 | 0 \ |
| 3961 | -c "client hello, adding renegotiation extension" \ |
| 3962 | -c "found renegotiation extension" \ |
| 3963 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3964 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3965 | -C "error" \ |
| 3966 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3967 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3968 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3969 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3970 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 3971 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3972 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3973 | 1 \ |
| 3974 | -c "client hello, adding renegotiation extension" \ |
| 3975 | -C "found renegotiation extension" \ |
| 3976 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3977 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3978 | -c "error" \ |
| 3979 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3980 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3981 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3982 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3983 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 3984 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3985 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3986 | allow_legacy=0" \ |
| 3987 | 1 \ |
| 3988 | -c "client hello, adding renegotiation extension" \ |
| 3989 | -C "found renegotiation extension" \ |
| 3990 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3991 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3992 | -c "error" \ |
| 3993 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3994 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3995 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3996 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3997 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 3998 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3999 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 4000 | allow_legacy=1" \ |
| 4001 | 0 \ |
| 4002 | -c "client hello, adding renegotiation extension" \ |
| 4003 | -C "found renegotiation extension" \ |
| 4004 | -c "=> renegotiate" \ |
| 4005 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4006 | -C "error" \ |
| 4007 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4008 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4009 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 4010 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 4011 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 4012 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4013 | 0 \ |
| 4014 | -c "client hello, adding renegotiation extension" \ |
| 4015 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4016 | -s "found renegotiation extension" \ |
| 4017 | -s "server hello, secure renegotiation extension" \ |
| 4018 | -c "found renegotiation extension" \ |
| 4019 | -c "=> renegotiate" \ |
| 4020 | -s "=> renegotiate" \ |
| 4021 | -S "write hello request" |
| 4022 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4023 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 4024 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 4025 | "$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] | 4026 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 4027 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 4028 | 0 \ |
| 4029 | -c "client hello, adding renegotiation extension" \ |
| 4030 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4031 | -s "found renegotiation extension" \ |
| 4032 | -s "server hello, secure renegotiation extension" \ |
| 4033 | -c "found renegotiation extension" \ |
| 4034 | -c "=> renegotiate" \ |
| 4035 | -s "=> renegotiate" \ |
| 4036 | -s "write hello request" |
| 4037 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4038 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 4039 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 4040 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 4041 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 4042 | 0 \ |
| 4043 | -c "client hello, adding renegotiation extension" \ |
| 4044 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4045 | -s "found renegotiation extension" \ |
| 4046 | -s "server hello, secure renegotiation extension" \ |
| 4047 | -s "record counter limit reached: renegotiate" \ |
| 4048 | -c "=> renegotiate" \ |
| 4049 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4050 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 4051 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 4052 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4053 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 4054 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 4055 | "$G_SRV -u --mtu 4096" \ |
| 4056 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 4057 | 0 \ |
| 4058 | -c "client hello, adding renegotiation extension" \ |
| 4059 | -c "found renegotiation extension" \ |
| 4060 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4061 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 4062 | -C "error" \ |
| 4063 | -s "Extra-header:" |
| 4064 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4065 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 4066 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4067 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4068 | run_test "Renego ext: gnutls server strict, client default" \ |
| 4069 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 4070 | "$P_CLI debug_level=3" \ |
| 4071 | 0 \ |
| 4072 | -c "found renegotiation extension" \ |
| 4073 | -C "error" \ |
| 4074 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4075 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4076 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4077 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 4078 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4079 | "$P_CLI debug_level=3" \ |
| 4080 | 0 \ |
| 4081 | -C "found renegotiation extension" \ |
| 4082 | -C "error" \ |
| 4083 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4084 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4085 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4086 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 4087 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4088 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 4089 | 1 \ |
| 4090 | -C "found renegotiation extension" \ |
| 4091 | -c "error" \ |
| 4092 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4093 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4094 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4095 | run_test "Renego ext: gnutls client strict, server default" \ |
| 4096 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4097 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4098 | 0 \ |
| 4099 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4100 | -s "server hello, secure renegotiation extension" |
| 4101 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4102 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4103 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 4104 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4105 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4106 | 0 \ |
| 4107 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4108 | -S "server hello, secure renegotiation extension" |
| 4109 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4110 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4111 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 4112 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4113 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4114 | 1 \ |
| 4115 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4116 | -S "server hello, secure renegotiation extension" |
| 4117 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4118 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 4119 | |
| 4120 | requires_gnutls |
| 4121 | run_test "DER format: no trailing bytes" \ |
| 4122 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 4123 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4124 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4125 | 0 \ |
| 4126 | -c "Handshake was completed" \ |
| 4127 | |
| 4128 | requires_gnutls |
| 4129 | run_test "DER format: with a trailing zero byte" \ |
| 4130 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 4131 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4132 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4133 | 0 \ |
| 4134 | -c "Handshake was completed" \ |
| 4135 | |
| 4136 | requires_gnutls |
| 4137 | run_test "DER format: with a trailing random byte" \ |
| 4138 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 4139 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4140 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4141 | 0 \ |
| 4142 | -c "Handshake was completed" \ |
| 4143 | |
| 4144 | requires_gnutls |
| 4145 | run_test "DER format: with 2 trailing random bytes" \ |
| 4146 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 4147 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4148 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4149 | 0 \ |
| 4150 | -c "Handshake was completed" \ |
| 4151 | |
| 4152 | requires_gnutls |
| 4153 | run_test "DER format: with 4 trailing random bytes" \ |
| 4154 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 4155 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4156 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4157 | 0 \ |
| 4158 | -c "Handshake was completed" \ |
| 4159 | |
| 4160 | requires_gnutls |
| 4161 | run_test "DER format: with 8 trailing random bytes" \ |
| 4162 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 4163 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4164 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4165 | 0 \ |
| 4166 | -c "Handshake was completed" \ |
| 4167 | |
| 4168 | requires_gnutls |
| 4169 | run_test "DER format: with 9 trailing random bytes" \ |
| 4170 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 4171 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4172 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4173 | 0 \ |
| 4174 | -c "Handshake was completed" \ |
| 4175 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4176 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 4177 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4178 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4179 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4180 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4181 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4182 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4183 | 1 \ |
| 4184 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4185 | -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] | 4186 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4187 | -c "X509 - Certificate verification failed" |
| 4188 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4189 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4190 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4191 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4192 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4193 | 0 \ |
| 4194 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4195 | -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] | 4196 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4197 | -C "X509 - Certificate verification failed" |
| 4198 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 4199 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 4200 | "$P_SRV" \ |
| 4201 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 4202 | 0 \ |
| 4203 | -c "x509_verify_cert() returned" \ |
| 4204 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4205 | -c "! Certificate verification flags"\ |
| 4206 | -C "! mbedtls_ssl_handshake returned" \ |
| 4207 | -C "X509 - Certificate verification failed" \ |
| 4208 | -C "SSL - No CA Chain is set, but required to operate" |
| 4209 | |
| 4210 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 4211 | "$P_SRV" \ |
| 4212 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 4213 | 1 \ |
| 4214 | -c "x509_verify_cert() returned" \ |
| 4215 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4216 | -c "! Certificate verification flags"\ |
| 4217 | -c "! mbedtls_ssl_handshake returned" \ |
| 4218 | -c "SSL - No CA Chain is set, but required to operate" |
| 4219 | |
| 4220 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4221 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4222 | # the client informs the server about the supported curves - it does, though, in the |
| 4223 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4224 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4225 | # different means to have the server ignoring the client's supported curve list. |
| 4226 | |
| 4227 | requires_config_enabled MBEDTLS_ECP_C |
| 4228 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4229 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4230 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4231 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4232 | 1 \ |
| 4233 | -c "bad certificate (EC key curve)"\ |
| 4234 | -c "! Certificate verification flags"\ |
| 4235 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4236 | |
| 4237 | requires_config_enabled MBEDTLS_ECP_C |
| 4238 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4239 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4240 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4241 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4242 | 1 \ |
| 4243 | -c "bad certificate (EC key curve)"\ |
| 4244 | -c "! Certificate verification flags"\ |
| 4245 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4246 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4247 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 4248 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4249 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4250 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4251 | 0 \ |
| 4252 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4253 | -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] | 4254 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4255 | -C "X509 - Certificate verification failed" |
| 4256 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 4257 | run_test "Authentication: client SHA256, server required" \ |
| 4258 | "$P_SRV auth_mode=required" \ |
| 4259 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4260 | key_file=data_files/server6.key \ |
| 4261 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4262 | 0 \ |
| 4263 | -c "Supported Signature Algorithm found: 4," \ |
| 4264 | -c "Supported Signature Algorithm found: 5," |
| 4265 | |
| 4266 | run_test "Authentication: client SHA384, server required" \ |
| 4267 | "$P_SRV auth_mode=required" \ |
| 4268 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4269 | key_file=data_files/server6.key \ |
| 4270 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4271 | 0 \ |
| 4272 | -c "Supported Signature Algorithm found: 4," \ |
| 4273 | -c "Supported Signature Algorithm found: 5," |
| 4274 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4275 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 4276 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4277 | "$P_CLI debug_level=3 crt_file=none \ |
| 4278 | key_file=data_files/server5.key" \ |
| 4279 | 1 \ |
| 4280 | -S "skip write certificate request" \ |
| 4281 | -C "skip parse certificate request" \ |
| 4282 | -c "got a certificate request" \ |
| 4283 | -c "= write certificate$" \ |
| 4284 | -C "skip write certificate$" \ |
| 4285 | -S "x509_verify_cert() returned" \ |
| 4286 | -s "client has no certificate" \ |
| 4287 | -s "! mbedtls_ssl_handshake returned" \ |
| 4288 | -c "! mbedtls_ssl_handshake returned" \ |
| 4289 | -s "No client certification received from the client, but required by the authentication mode" |
| 4290 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4291 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4292 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4293 | "$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] | 4294 | key_file=data_files/server5.key" \ |
| 4295 | 1 \ |
| 4296 | -S "skip write certificate request" \ |
| 4297 | -C "skip parse certificate request" \ |
| 4298 | -c "got a certificate request" \ |
| 4299 | -C "skip write certificate" \ |
| 4300 | -C "skip write certificate verify" \ |
| 4301 | -S "skip parse certificate verify" \ |
| 4302 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4303 | -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] | 4304 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4305 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4306 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4307 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4308 | # We don't check that the client receives the alert because it might |
| 4309 | # detect that its write end of the connection is closed and abort |
| 4310 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4311 | |
Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 4312 | run_test "Authentication: client cert self-signed and trusted, server required" \ |
| 4313 | "$P_SRV debug_level=3 auth_mode=required ca_file=data_files/server5-selfsigned.crt" \ |
| 4314 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4315 | key_file=data_files/server5.key" \ |
| 4316 | 0 \ |
| 4317 | -S "skip write certificate request" \ |
| 4318 | -C "skip parse certificate request" \ |
| 4319 | -c "got a certificate request" \ |
| 4320 | -C "skip write certificate" \ |
| 4321 | -C "skip write certificate verify" \ |
| 4322 | -S "skip parse certificate verify" \ |
| 4323 | -S "x509_verify_cert() returned" \ |
| 4324 | -S "! The certificate is not correctly signed" \ |
| 4325 | -S "X509 - Certificate verification failed" |
| 4326 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4327 | run_test "Authentication: client cert not trusted, server required" \ |
| 4328 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4329 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4330 | key_file=data_files/server5.key" \ |
| 4331 | 1 \ |
| 4332 | -S "skip write certificate request" \ |
| 4333 | -C "skip parse certificate request" \ |
| 4334 | -c "got a certificate request" \ |
| 4335 | -C "skip write certificate" \ |
| 4336 | -C "skip write certificate verify" \ |
| 4337 | -S "skip parse certificate verify" \ |
| 4338 | -s "x509_verify_cert() returned" \ |
| 4339 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4340 | -s "! mbedtls_ssl_handshake returned" \ |
| 4341 | -c "! mbedtls_ssl_handshake returned" \ |
| 4342 | -s "X509 - Certificate verification failed" |
| 4343 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4344 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4345 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4346 | "$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] | 4347 | key_file=data_files/server5.key" \ |
| 4348 | 0 \ |
| 4349 | -S "skip write certificate request" \ |
| 4350 | -C "skip parse certificate request" \ |
| 4351 | -c "got a certificate request" \ |
| 4352 | -C "skip write certificate" \ |
| 4353 | -C "skip write certificate verify" \ |
| 4354 | -S "skip parse certificate verify" \ |
| 4355 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4356 | -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] | 4357 | -S "! mbedtls_ssl_handshake returned" \ |
| 4358 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4359 | -S "X509 - Certificate verification failed" |
| 4360 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4361 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4362 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 4363 | "$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] | 4364 | key_file=data_files/server5.key" \ |
| 4365 | 0 \ |
| 4366 | -s "skip write certificate request" \ |
| 4367 | -C "skip parse certificate request" \ |
| 4368 | -c "got no certificate request" \ |
| 4369 | -c "skip write certificate" \ |
| 4370 | -c "skip write certificate verify" \ |
| 4371 | -s "skip parse certificate verify" \ |
| 4372 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4373 | -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] | 4374 | -S "! mbedtls_ssl_handshake returned" \ |
| 4375 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4376 | -S "X509 - Certificate verification failed" |
| 4377 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4378 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4379 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4380 | "$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] | 4381 | 0 \ |
| 4382 | -S "skip write certificate request" \ |
| 4383 | -C "skip parse certificate request" \ |
| 4384 | -c "got a certificate request" \ |
| 4385 | -C "skip write certificate$" \ |
| 4386 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4387 | -c "skip write certificate verify" \ |
| 4388 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4389 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4390 | -S "! mbedtls_ssl_handshake returned" \ |
| 4391 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4392 | -S "X509 - Certificate verification failed" |
| 4393 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4394 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4395 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4396 | "$O_CLI" \ |
| 4397 | 0 \ |
| 4398 | -S "skip write certificate request" \ |
| 4399 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4400 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4401 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4402 | -S "X509 - Certificate verification failed" |
| 4403 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4404 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4405 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4406 | "$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] | 4407 | 0 \ |
| 4408 | -C "skip parse certificate request" \ |
| 4409 | -c "got a certificate request" \ |
| 4410 | -C "skip write certificate$" \ |
| 4411 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4412 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4413 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4414 | run_test "Authentication: client no cert, openssl server required" \ |
| 4415 | "$O_SRV -Verify 10" \ |
| 4416 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 4417 | 1 \ |
| 4418 | -C "skip parse certificate request" \ |
| 4419 | -c "got a certificate request" \ |
| 4420 | -C "skip write certificate$" \ |
| 4421 | -c "skip write certificate verify" \ |
| 4422 | -c "! mbedtls_ssl_handshake returned" |
| 4423 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4424 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 4425 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 4426 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4427 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4428 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4429 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4430 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 4431 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 4432 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 4433 | # 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] | 4434 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4435 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4436 | run_test "Authentication: server max_int chain, client default" \ |
| 4437 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4438 | key_file=data_files/dir-maxpath/09.key" \ |
| 4439 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4440 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4441 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4442 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4443 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4444 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4445 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 4446 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4447 | key_file=data_files/dir-maxpath/10.key" \ |
| 4448 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4449 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4450 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4451 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4452 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4453 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4454 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 4455 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4456 | key_file=data_files/dir-maxpath/10.key" \ |
| 4457 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4458 | auth_mode=optional" \ |
| 4459 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4460 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4461 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4462 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4463 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4464 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 4465 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4466 | key_file=data_files/dir-maxpath/10.key" \ |
| 4467 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4468 | auth_mode=none" \ |
| 4469 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4470 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4471 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4472 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4473 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4474 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 4475 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 4476 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4477 | key_file=data_files/dir-maxpath/10.key" \ |
| 4478 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4479 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4480 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4481 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4482 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4483 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 4484 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4485 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4486 | key_file=data_files/dir-maxpath/10.key" \ |
| 4487 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4488 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4489 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4490 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4491 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4492 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 4493 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4494 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4495 | key_file=data_files/dir-maxpath/10.key" \ |
| 4496 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4497 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4498 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4499 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4500 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4501 | run_test "Authentication: client max_int chain, server required" \ |
| 4502 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4503 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4504 | key_file=data_files/dir-maxpath/09.key" \ |
| 4505 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4506 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4507 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4508 | # Tests for CA list in CertificateRequest messages |
| 4509 | |
| 4510 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 4511 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4512 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4513 | key_file=data_files/server6.key" \ |
| 4514 | 0 \ |
| 4515 | -s "requested DN" |
| 4516 | |
| 4517 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 4518 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4519 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4520 | key_file=data_files/server6.key" \ |
| 4521 | 0 \ |
| 4522 | -S "requested DN" |
| 4523 | |
| 4524 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 4525 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4526 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4527 | key_file=data_files/server5.key" \ |
| 4528 | 1 \ |
| 4529 | -S "requested DN" \ |
| 4530 | -s "x509_verify_cert() returned" \ |
| 4531 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4532 | -s "! mbedtls_ssl_handshake returned" \ |
| 4533 | -c "! mbedtls_ssl_handshake returned" \ |
| 4534 | -s "X509 - Certificate verification failed" |
| 4535 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4536 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 4537 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4538 | |
| 4539 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4540 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 4541 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4542 | key_file=data_files/server5.key" \ |
| 4543 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4544 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4545 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4546 | -c "x509_verify_cert() returned" \ |
| 4547 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4548 | -c "! mbedtls_ssl_handshake returned" \ |
| 4549 | -c "X509 - Certificate verification failed" |
| 4550 | |
| 4551 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4552 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 4553 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4554 | key_file=data_files/server5.key" \ |
| 4555 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4556 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4557 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4558 | -c "x509_verify_cert() returned" \ |
| 4559 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4560 | -C "! mbedtls_ssl_handshake returned" \ |
| 4561 | -C "X509 - Certificate verification failed" |
| 4562 | |
| 4563 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4564 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4565 | # the client informs the server about the supported curves - it does, though, in the |
| 4566 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4567 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4568 | # different means to have the server ignoring the client's supported curve list. |
| 4569 | |
| 4570 | requires_config_enabled MBEDTLS_ECP_C |
| 4571 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4572 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4573 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4574 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4575 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4576 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4577 | -c "use CA callback for X.509 CRT verification" \ |
| 4578 | -c "bad certificate (EC key curve)" \ |
| 4579 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4580 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4581 | |
| 4582 | requires_config_enabled MBEDTLS_ECP_C |
| 4583 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4584 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4585 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4586 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4587 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4588 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4589 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4590 | -c "bad certificate (EC key curve)"\ |
| 4591 | -c "! Certificate verification flags"\ |
| 4592 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4593 | |
| 4594 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4595 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 4596 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4597 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4598 | key_file=data_files/server6.key \ |
| 4599 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4600 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4601 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4602 | -c "Supported Signature Algorithm found: 4," \ |
| 4603 | -c "Supported Signature Algorithm found: 5," |
| 4604 | |
| 4605 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4606 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 4607 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4608 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4609 | key_file=data_files/server6.key \ |
| 4610 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4611 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4612 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4613 | -c "Supported Signature Algorithm found: 4," \ |
| 4614 | -c "Supported Signature Algorithm found: 5," |
| 4615 | |
| 4616 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4617 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 4618 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4619 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4620 | key_file=data_files/server5.key" \ |
| 4621 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4622 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4623 | -S "skip write certificate request" \ |
| 4624 | -C "skip parse certificate request" \ |
| 4625 | -c "got a certificate request" \ |
| 4626 | -C "skip write certificate" \ |
| 4627 | -C "skip write certificate verify" \ |
| 4628 | -S "skip parse certificate verify" \ |
| 4629 | -s "x509_verify_cert() returned" \ |
| 4630 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4631 | -s "! mbedtls_ssl_handshake returned" \ |
| 4632 | -s "send alert level=2 message=48" \ |
| 4633 | -c "! mbedtls_ssl_handshake returned" \ |
| 4634 | -s "X509 - Certificate verification failed" |
| 4635 | # We don't check that the client receives the alert because it might |
| 4636 | # detect that its write end of the connection is closed and abort |
| 4637 | # before reading the alert message. |
| 4638 | |
| 4639 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4640 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 4641 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4642 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4643 | key_file=data_files/server5.key" \ |
| 4644 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4645 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4646 | -S "skip write certificate request" \ |
| 4647 | -C "skip parse certificate request" \ |
| 4648 | -c "got a certificate request" \ |
| 4649 | -C "skip write certificate" \ |
| 4650 | -C "skip write certificate verify" \ |
| 4651 | -S "skip parse certificate verify" \ |
| 4652 | -s "x509_verify_cert() returned" \ |
| 4653 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4654 | -s "! mbedtls_ssl_handshake returned" \ |
| 4655 | -c "! mbedtls_ssl_handshake returned" \ |
| 4656 | -s "X509 - Certificate verification failed" |
| 4657 | |
| 4658 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4659 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 4660 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4661 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4662 | key_file=data_files/server5.key" \ |
| 4663 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4664 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4665 | -S "skip write certificate request" \ |
| 4666 | -C "skip parse certificate request" \ |
| 4667 | -c "got a certificate request" \ |
| 4668 | -C "skip write certificate" \ |
| 4669 | -C "skip write certificate verify" \ |
| 4670 | -S "skip parse certificate verify" \ |
| 4671 | -s "x509_verify_cert() returned" \ |
| 4672 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4673 | -S "! mbedtls_ssl_handshake returned" \ |
| 4674 | -C "! mbedtls_ssl_handshake returned" \ |
| 4675 | -S "X509 - Certificate verification failed" |
| 4676 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4677 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4678 | requires_full_size_output_buffer |
| 4679 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4680 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 4681 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4682 | key_file=data_files/dir-maxpath/09.key" \ |
| 4683 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4684 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4685 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4686 | -C "X509 - A fatal error occurred" |
| 4687 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4688 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4689 | requires_full_size_output_buffer |
| 4690 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4691 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 4692 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4693 | key_file=data_files/dir-maxpath/10.key" \ |
| 4694 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4695 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4696 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4697 | -c "X509 - A fatal error occurred" |
| 4698 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4699 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4700 | requires_full_size_output_buffer |
| 4701 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4702 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 4703 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4704 | key_file=data_files/dir-maxpath/10.key" \ |
| 4705 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4706 | debug_level=3 auth_mode=optional" \ |
| 4707 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4708 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4709 | -c "X509 - A fatal error occurred" |
| 4710 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4711 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4712 | requires_full_size_output_buffer |
| 4713 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4714 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 4715 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4716 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4717 | key_file=data_files/dir-maxpath/10.key" \ |
| 4718 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4719 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4720 | -s "X509 - A fatal error occurred" |
| 4721 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4722 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4723 | requires_full_size_output_buffer |
| 4724 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4725 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 4726 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4727 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4728 | key_file=data_files/dir-maxpath/10.key" \ |
| 4729 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4730 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4731 | -s "X509 - A fatal error occurred" |
| 4732 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4733 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4734 | requires_full_size_output_buffer |
| 4735 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4736 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 4737 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4738 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4739 | key_file=data_files/dir-maxpath/09.key" \ |
| 4740 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4741 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4742 | -S "X509 - A fatal error occurred" |
| 4743 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4744 | # Tests for certificate selection based on SHA verson |
| 4745 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4746 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4747 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 4748 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4749 | key_file=data_files/server5.key \ |
| 4750 | crt_file2=data_files/server5-sha1.crt \ |
| 4751 | key_file2=data_files/server5.key" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 4752 | "$P_CLI force_version=tls12" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4753 | 0 \ |
| 4754 | -c "signed using.*ECDSA with SHA256" \ |
| 4755 | -C "signed using.*ECDSA with SHA1" |
| 4756 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4757 | # tests for SNI |
| 4758 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4759 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4760 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4761 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4762 | 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] | 4763 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4764 | 0 \ |
| 4765 | -S "parse ServerName extension" \ |
| 4766 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4767 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4768 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4769 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4770 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4771 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4772 | 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] | 4773 | 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] | 4774 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4775 | 0 \ |
| 4776 | -s "parse ServerName extension" \ |
| 4777 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4778 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4779 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4780 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4781 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4782 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4783 | 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] | 4784 | 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] | 4785 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4786 | 0 \ |
| 4787 | -s "parse ServerName extension" \ |
| 4788 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4789 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4790 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4791 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4792 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4793 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4794 | 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] | 4795 | 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] | 4796 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4797 | 1 \ |
| 4798 | -s "parse ServerName extension" \ |
| 4799 | -s "ssl_sni_wrapper() returned" \ |
| 4800 | -s "mbedtls_ssl_handshake returned" \ |
| 4801 | -c "mbedtls_ssl_handshake returned" \ |
| 4802 | -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] | 4803 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4804 | run_test "SNI: client auth no override: optional" \ |
| 4805 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4806 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4807 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4808 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4809 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4810 | -S "skip write certificate request" \ |
| 4811 | -C "skip parse certificate request" \ |
| 4812 | -c "got a certificate request" \ |
| 4813 | -C "skip write certificate" \ |
| 4814 | -C "skip write certificate verify" \ |
| 4815 | -S "skip parse certificate verify" |
| 4816 | |
| 4817 | run_test "SNI: client auth override: none -> optional" \ |
| 4818 | "$P_SRV debug_level=3 auth_mode=none \ |
| 4819 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4820 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4821 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4822 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4823 | -S "skip write certificate request" \ |
| 4824 | -C "skip parse certificate request" \ |
| 4825 | -c "got a certificate request" \ |
| 4826 | -C "skip write certificate" \ |
| 4827 | -C "skip write certificate verify" \ |
| 4828 | -S "skip parse certificate verify" |
| 4829 | |
| 4830 | run_test "SNI: client auth override: optional -> none" \ |
| 4831 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4832 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4833 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4834 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4835 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4836 | -s "skip write certificate request" \ |
| 4837 | -C "skip parse certificate request" \ |
| 4838 | -c "got no certificate request" \ |
| 4839 | -c "skip write certificate" \ |
| 4840 | -c "skip write certificate verify" \ |
| 4841 | -s "skip parse certificate verify" |
| 4842 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4843 | run_test "SNI: CA no override" \ |
| 4844 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4845 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4846 | ca_file=data_files/test-ca.crt \ |
| 4847 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4848 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4849 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4850 | 1 \ |
| 4851 | -S "skip write certificate request" \ |
| 4852 | -C "skip parse certificate request" \ |
| 4853 | -c "got a certificate request" \ |
| 4854 | -C "skip write certificate" \ |
| 4855 | -C "skip write certificate verify" \ |
| 4856 | -S "skip parse certificate verify" \ |
| 4857 | -s "x509_verify_cert() returned" \ |
| 4858 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4859 | -S "The certificate has been revoked (is on a CRL)" |
| 4860 | |
| 4861 | run_test "SNI: CA override" \ |
| 4862 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4863 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4864 | ca_file=data_files/test-ca.crt \ |
| 4865 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4866 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4867 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4868 | 0 \ |
| 4869 | -S "skip write certificate request" \ |
| 4870 | -C "skip parse certificate request" \ |
| 4871 | -c "got a certificate request" \ |
| 4872 | -C "skip write certificate" \ |
| 4873 | -C "skip write certificate verify" \ |
| 4874 | -S "skip parse certificate verify" \ |
| 4875 | -S "x509_verify_cert() returned" \ |
| 4876 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4877 | -S "The certificate has been revoked (is on a CRL)" |
| 4878 | |
| 4879 | run_test "SNI: CA override with CRL" \ |
| 4880 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4881 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4882 | ca_file=data_files/test-ca.crt \ |
| 4883 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4884 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4885 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4886 | 1 \ |
| 4887 | -S "skip write certificate request" \ |
| 4888 | -C "skip parse certificate request" \ |
| 4889 | -c "got a certificate request" \ |
| 4890 | -C "skip write certificate" \ |
| 4891 | -C "skip write certificate verify" \ |
| 4892 | -S "skip parse certificate verify" \ |
| 4893 | -s "x509_verify_cert() returned" \ |
| 4894 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4895 | -s "The certificate has been revoked (is on a CRL)" |
| 4896 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4897 | # Tests for SNI and DTLS |
| 4898 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4899 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4900 | run_test "SNI: DTLS, no SNI callback" \ |
| 4901 | "$P_SRV debug_level=3 dtls=1 \ |
| 4902 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 4903 | "$P_CLI server_name=localhost dtls=1" \ |
| 4904 | 0 \ |
| 4905 | -S "parse ServerName extension" \ |
| 4906 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4907 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4908 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4909 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4910 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4911 | "$P_SRV debug_level=3 dtls=1 \ |
| 4912 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4913 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4914 | "$P_CLI server_name=localhost dtls=1" \ |
| 4915 | 0 \ |
| 4916 | -s "parse ServerName extension" \ |
| 4917 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4918 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4919 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4920 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4921 | run_test "SNI: DTLS, matching cert 2" \ |
| 4922 | "$P_SRV debug_level=3 dtls=1 \ |
| 4923 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4924 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4925 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 4926 | 0 \ |
| 4927 | -s "parse ServerName extension" \ |
| 4928 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4929 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 4930 | |
| 4931 | run_test "SNI: DTLS, no matching cert" \ |
| 4932 | "$P_SRV debug_level=3 dtls=1 \ |
| 4933 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4934 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4935 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 4936 | 1 \ |
| 4937 | -s "parse ServerName extension" \ |
| 4938 | -s "ssl_sni_wrapper() returned" \ |
| 4939 | -s "mbedtls_ssl_handshake returned" \ |
| 4940 | -c "mbedtls_ssl_handshake returned" \ |
| 4941 | -c "SSL - A fatal alert message was received from our peer" |
| 4942 | |
| 4943 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 4944 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4945 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4946 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4947 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4948 | 0 \ |
| 4949 | -S "skip write certificate request" \ |
| 4950 | -C "skip parse certificate request" \ |
| 4951 | -c "got a certificate request" \ |
| 4952 | -C "skip write certificate" \ |
| 4953 | -C "skip write certificate verify" \ |
| 4954 | -S "skip parse certificate verify" |
| 4955 | |
| 4956 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 4957 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 4958 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4959 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4960 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4961 | 0 \ |
| 4962 | -S "skip write certificate request" \ |
| 4963 | -C "skip parse certificate request" \ |
| 4964 | -c "got a certificate request" \ |
| 4965 | -C "skip write certificate" \ |
| 4966 | -C "skip write certificate verify" \ |
| 4967 | -S "skip parse certificate verify" |
| 4968 | |
| 4969 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 4970 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4971 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4972 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4973 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4974 | 0 \ |
| 4975 | -s "skip write certificate request" \ |
| 4976 | -C "skip parse certificate request" \ |
| 4977 | -c "got no certificate request" \ |
| 4978 | -c "skip write certificate" \ |
| 4979 | -c "skip write certificate verify" \ |
| 4980 | -s "skip parse certificate verify" |
| 4981 | |
| 4982 | run_test "SNI: DTLS, CA no override" \ |
| 4983 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4984 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4985 | ca_file=data_files/test-ca.crt \ |
| 4986 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4987 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4988 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4989 | 1 \ |
| 4990 | -S "skip write certificate request" \ |
| 4991 | -C "skip parse certificate request" \ |
| 4992 | -c "got a certificate request" \ |
| 4993 | -C "skip write certificate" \ |
| 4994 | -C "skip write certificate verify" \ |
| 4995 | -S "skip parse certificate verify" \ |
| 4996 | -s "x509_verify_cert() returned" \ |
| 4997 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4998 | -S "The certificate has been revoked (is on a CRL)" |
| 4999 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5000 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5001 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5002 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5003 | ca_file=data_files/test-ca.crt \ |
| 5004 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 5005 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5006 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5007 | 0 \ |
| 5008 | -S "skip write certificate request" \ |
| 5009 | -C "skip parse certificate request" \ |
| 5010 | -c "got a certificate request" \ |
| 5011 | -C "skip write certificate" \ |
| 5012 | -C "skip write certificate verify" \ |
| 5013 | -S "skip parse certificate verify" \ |
| 5014 | -S "x509_verify_cert() returned" \ |
| 5015 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5016 | -S "The certificate has been revoked (is on a CRL)" |
| 5017 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5018 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5019 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5020 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 5021 | ca_file=data_files/test-ca.crt \ |
| 5022 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 5023 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5024 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5025 | 1 \ |
| 5026 | -S "skip write certificate request" \ |
| 5027 | -C "skip parse certificate request" \ |
| 5028 | -c "got a certificate request" \ |
| 5029 | -C "skip write certificate" \ |
| 5030 | -C "skip write certificate verify" \ |
| 5031 | -S "skip parse certificate verify" \ |
| 5032 | -s "x509_verify_cert() returned" \ |
| 5033 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5034 | -s "The certificate has been revoked (is on a CRL)" |
| 5035 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5036 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 5037 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5038 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5039 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 5040 | "$P_CLI nbio=2 tickets=0" \ |
| 5041 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5042 | -S "mbedtls_ssl_handshake returned" \ |
| 5043 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5044 | -c "Read from server: .* bytes read" |
| 5045 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5046 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5047 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 5048 | "$P_CLI nbio=2 tickets=0" \ |
| 5049 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5050 | -S "mbedtls_ssl_handshake returned" \ |
| 5051 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5052 | -c "Read from server: .* bytes read" |
| 5053 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5054 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5055 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 5056 | "$P_CLI nbio=2 tickets=1" \ |
| 5057 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5058 | -S "mbedtls_ssl_handshake returned" \ |
| 5059 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5060 | -c "Read from server: .* bytes read" |
| 5061 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5062 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5063 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 5064 | "$P_CLI nbio=2 tickets=1" \ |
| 5065 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5066 | -S "mbedtls_ssl_handshake returned" \ |
| 5067 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5068 | -c "Read from server: .* bytes read" |
| 5069 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5070 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5071 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 5072 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 5073 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5074 | -S "mbedtls_ssl_handshake returned" \ |
| 5075 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5076 | -c "Read from server: .* bytes read" |
| 5077 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5078 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5079 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 5080 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 5081 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5082 | -S "mbedtls_ssl_handshake returned" \ |
| 5083 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5084 | -c "Read from server: .* bytes read" |
| 5085 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5086 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5087 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 5088 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 5089 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5090 | -S "mbedtls_ssl_handshake returned" \ |
| 5091 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5092 | -c "Read from server: .* bytes read" |
| 5093 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5094 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 5095 | |
| 5096 | run_test "Event-driven I/O: basic handshake" \ |
| 5097 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 5098 | "$P_CLI event=1 tickets=0" \ |
| 5099 | 0 \ |
| 5100 | -S "mbedtls_ssl_handshake returned" \ |
| 5101 | -C "mbedtls_ssl_handshake returned" \ |
| 5102 | -c "Read from server: .* bytes read" |
| 5103 | |
| 5104 | run_test "Event-driven I/O: client auth" \ |
| 5105 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 5106 | "$P_CLI event=1 tickets=0" \ |
| 5107 | 0 \ |
| 5108 | -S "mbedtls_ssl_handshake returned" \ |
| 5109 | -C "mbedtls_ssl_handshake returned" \ |
| 5110 | -c "Read from server: .* bytes read" |
| 5111 | |
| 5112 | run_test "Event-driven I/O: ticket" \ |
| 5113 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 5114 | "$P_CLI event=1 tickets=1" \ |
| 5115 | 0 \ |
| 5116 | -S "mbedtls_ssl_handshake returned" \ |
| 5117 | -C "mbedtls_ssl_handshake returned" \ |
| 5118 | -c "Read from server: .* bytes read" |
| 5119 | |
| 5120 | run_test "Event-driven I/O: ticket + client auth" \ |
| 5121 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 5122 | "$P_CLI event=1 tickets=1" \ |
| 5123 | 0 \ |
| 5124 | -S "mbedtls_ssl_handshake returned" \ |
| 5125 | -C "mbedtls_ssl_handshake returned" \ |
| 5126 | -c "Read from server: .* bytes read" |
| 5127 | |
| 5128 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 5129 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 5130 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 5131 | 0 \ |
| 5132 | -S "mbedtls_ssl_handshake returned" \ |
| 5133 | -C "mbedtls_ssl_handshake returned" \ |
| 5134 | -c "Read from server: .* bytes read" |
| 5135 | |
| 5136 | run_test "Event-driven I/O: ticket + resume" \ |
| 5137 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 5138 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 5139 | 0 \ |
| 5140 | -S "mbedtls_ssl_handshake returned" \ |
| 5141 | -C "mbedtls_ssl_handshake returned" \ |
| 5142 | -c "Read from server: .* bytes read" |
| 5143 | |
| 5144 | run_test "Event-driven I/O: session-id resume" \ |
| 5145 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 5146 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 5147 | 0 \ |
| 5148 | -S "mbedtls_ssl_handshake returned" \ |
| 5149 | -C "mbedtls_ssl_handshake returned" \ |
| 5150 | -c "Read from server: .* bytes read" |
| 5151 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5152 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 5153 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 5154 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 5155 | 0 \ |
| 5156 | -c "Read from server: .* bytes read" |
| 5157 | |
| 5158 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 5159 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 5160 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 5161 | 0 \ |
| 5162 | -c "Read from server: .* bytes read" |
| 5163 | |
| 5164 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 5165 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 5166 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 5167 | 0 \ |
| 5168 | -c "Read from server: .* bytes read" |
| 5169 | |
| 5170 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 5171 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 5172 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 5173 | 0 \ |
| 5174 | -c "Read from server: .* bytes read" |
| 5175 | |
| 5176 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 5177 | "$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] | 5178 | "$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] | 5179 | 0 \ |
| 5180 | -c "Read from server: .* bytes read" |
| 5181 | |
| 5182 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 5183 | "$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] | 5184 | "$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] | 5185 | 0 \ |
| 5186 | -c "Read from server: .* bytes read" |
| 5187 | |
| 5188 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 5189 | "$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] | 5190 | "$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] | 5191 | 0 \ |
| 5192 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5193 | |
| 5194 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 5195 | # During session resumption, the client will send its ApplicationData record |
| 5196 | # within the same datagram as the Finished messages. In this situation, the |
| 5197 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 5198 | # because the ApplicationData request has already been queued internally. |
| 5199 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 5200 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5201 | "$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] | 5202 | "$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] | 5203 | 0 \ |
| 5204 | -c "Read from server: .* bytes read" |
| 5205 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5206 | # Tests for version negotiation |
| 5207 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5208 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5209 | "$P_SRV" \ |
| 5210 | "$P_CLI" \ |
| 5211 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5212 | -S "mbedtls_ssl_handshake returned" \ |
| 5213 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5214 | -s "Protocol is TLSv1.2" \ |
| 5215 | -c "Protocol is TLSv1.2" |
| 5216 | |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 5217 | run_test "Not supported version check: cli TLS 1.0" \ |
| 5218 | "$P_SRV" \ |
| 5219 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 5220 | 1 \ |
| 5221 | -s "Handshake protocol not within min/max boundaries" \ |
| 5222 | -c "Error in protocol version" \ |
| 5223 | -S "Protocol is TLSv1.0" \ |
| 5224 | -C "Handshake was completed" |
| 5225 | |
| 5226 | run_test "Not supported version check: cli TLS 1.1" \ |
| 5227 | "$P_SRV" \ |
| 5228 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 5229 | 1 \ |
| 5230 | -s "Handshake protocol not within min/max boundaries" \ |
| 5231 | -c "Error in protocol version" \ |
| 5232 | -S "Protocol is TLSv1.1" \ |
| 5233 | -C "Handshake was completed" |
| 5234 | |
| 5235 | run_test "Not supported version check: srv max TLS 1.0" \ |
| 5236 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 5237 | "$P_CLI" \ |
| 5238 | 1 \ |
| 5239 | -s "Error in protocol version" \ |
| 5240 | -c "Handshake protocol not within min/max boundaries" \ |
| 5241 | -S "Version: TLS1.0" \ |
| 5242 | -C "Protocol is TLSv1.0" |
| 5243 | |
| 5244 | run_test "Not supported version check: srv max TLS 1.1" \ |
| 5245 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 5246 | "$P_CLI" \ |
| 5247 | 1 \ |
| 5248 | -s "Error in protocol version" \ |
| 5249 | -c "Handshake protocol not within min/max boundaries" \ |
| 5250 | -S "Version: TLS1.1" \ |
| 5251 | -C "Protocol is TLSv1.1" |
| 5252 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5253 | # Tests for ALPN extension |
| 5254 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5255 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5256 | "$P_SRV debug_level=3" \ |
| 5257 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5258 | 0 \ |
| 5259 | -C "client hello, adding alpn extension" \ |
| 5260 | -S "found alpn extension" \ |
| 5261 | -C "got an alert message, type: \\[2:120]" \ |
| 5262 | -S "server hello, adding alpn extension" \ |
| 5263 | -C "found alpn extension " \ |
| 5264 | -C "Application Layer Protocol is" \ |
| 5265 | -S "Application Layer Protocol is" |
| 5266 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5267 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5268 | "$P_SRV debug_level=3" \ |
| 5269 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5270 | 0 \ |
| 5271 | -c "client hello, adding alpn extension" \ |
| 5272 | -s "found alpn extension" \ |
| 5273 | -C "got an alert message, type: \\[2:120]" \ |
| 5274 | -S "server hello, adding alpn extension" \ |
| 5275 | -C "found alpn extension " \ |
| 5276 | -c "Application Layer Protocol is (none)" \ |
| 5277 | -S "Application Layer Protocol is" |
| 5278 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5279 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5280 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5281 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5282 | 0 \ |
| 5283 | -C "client hello, adding alpn extension" \ |
| 5284 | -S "found alpn extension" \ |
| 5285 | -C "got an alert message, type: \\[2:120]" \ |
| 5286 | -S "server hello, adding alpn extension" \ |
| 5287 | -C "found alpn extension " \ |
| 5288 | -C "Application Layer Protocol is" \ |
| 5289 | -s "Application Layer Protocol is (none)" |
| 5290 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5291 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5292 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5293 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5294 | 0 \ |
| 5295 | -c "client hello, adding alpn extension" \ |
| 5296 | -s "found alpn extension" \ |
| 5297 | -C "got an alert message, type: \\[2:120]" \ |
| 5298 | -s "server hello, adding alpn extension" \ |
| 5299 | -c "found alpn extension" \ |
| 5300 | -c "Application Layer Protocol is abc" \ |
| 5301 | -s "Application Layer Protocol is abc" |
| 5302 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5303 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5304 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5305 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5306 | 0 \ |
| 5307 | -c "client hello, adding alpn extension" \ |
| 5308 | -s "found alpn extension" \ |
| 5309 | -C "got an alert message, type: \\[2:120]" \ |
| 5310 | -s "server hello, adding alpn extension" \ |
| 5311 | -c "found alpn extension" \ |
| 5312 | -c "Application Layer Protocol is abc" \ |
| 5313 | -s "Application Layer Protocol is abc" |
| 5314 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5315 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5316 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5317 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5318 | 0 \ |
| 5319 | -c "client hello, adding alpn extension" \ |
| 5320 | -s "found alpn extension" \ |
| 5321 | -C "got an alert message, type: \\[2:120]" \ |
| 5322 | -s "server hello, adding alpn extension" \ |
| 5323 | -c "found alpn extension" \ |
| 5324 | -c "Application Layer Protocol is 1234" \ |
| 5325 | -s "Application Layer Protocol is 1234" |
| 5326 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5327 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5328 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 5329 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5330 | 1 \ |
| 5331 | -c "client hello, adding alpn extension" \ |
| 5332 | -s "found alpn extension" \ |
| 5333 | -c "got an alert message, type: \\[2:120]" \ |
| 5334 | -S "server hello, adding alpn extension" \ |
| 5335 | -C "found alpn extension" \ |
| 5336 | -C "Application Layer Protocol is 1234" \ |
| 5337 | -S "Application Layer Protocol is 1234" |
| 5338 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 5339 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5340 | # Tests for keyUsage in leaf certificates, part 1: |
| 5341 | # server-side certificate/suite selection |
| 5342 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5343 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5344 | "$P_SRV key_file=data_files/server2.key \ |
| 5345 | crt_file=data_files/server2.ku-ds.crt" \ |
| 5346 | "$P_CLI" \ |
| 5347 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 5348 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5349 | |
| 5350 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5351 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5352 | "$P_SRV key_file=data_files/server2.key \ |
| 5353 | crt_file=data_files/server2.ku-ke.crt" \ |
| 5354 | "$P_CLI" \ |
| 5355 | 0 \ |
| 5356 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 5357 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5358 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5359 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5360 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5361 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5362 | 1 \ |
| 5363 | -C "Ciphersuite is " |
| 5364 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5365 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5366 | "$P_SRV key_file=data_files/server5.key \ |
| 5367 | crt_file=data_files/server5.ku-ds.crt" \ |
| 5368 | "$P_CLI" \ |
| 5369 | 0 \ |
| 5370 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 5371 | |
| 5372 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5373 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5374 | "$P_SRV key_file=data_files/server5.key \ |
| 5375 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5376 | "$P_CLI" \ |
| 5377 | 0 \ |
| 5378 | -c "Ciphersuite is TLS-ECDH-" |
| 5379 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5380 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5381 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5382 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5383 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5384 | 1 \ |
| 5385 | -C "Ciphersuite is " |
| 5386 | |
| 5387 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5388 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5389 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5390 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5391 | "$O_SRV -key data_files/server2.key \ |
| 5392 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5393 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5394 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5395 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5396 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5397 | -C "Processing of the Certificate handshake message failed" \ |
| 5398 | -c "Ciphersuite is TLS-" |
| 5399 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5400 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5401 | "$O_SRV -key data_files/server2.key \ |
| 5402 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5403 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5404 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5405 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5406 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5407 | -C "Processing of the Certificate handshake message failed" \ |
| 5408 | -c "Ciphersuite is TLS-" |
| 5409 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5410 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5411 | "$O_SRV -key data_files/server2.key \ |
| 5412 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5413 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5414 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5415 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5416 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5417 | -C "Processing of the Certificate handshake message failed" \ |
| 5418 | -c "Ciphersuite is TLS-" |
| 5419 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5420 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5421 | "$O_SRV -key data_files/server2.key \ |
| 5422 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5423 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5424 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5425 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5426 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5427 | -c "Processing of the Certificate handshake message failed" \ |
| 5428 | -C "Ciphersuite is TLS-" |
| 5429 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5430 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 5431 | "$O_SRV -key data_files/server2.key \ |
| 5432 | -cert data_files/server2.ku-ke.crt" \ |
| 5433 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5434 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5435 | 0 \ |
| 5436 | -c "bad certificate (usage extensions)" \ |
| 5437 | -C "Processing of the Certificate handshake message failed" \ |
| 5438 | -c "Ciphersuite is TLS-" \ |
| 5439 | -c "! Usage does not match the keyUsage extension" |
| 5440 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5441 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5442 | "$O_SRV -key data_files/server2.key \ |
| 5443 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5444 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5445 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5446 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5447 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5448 | -C "Processing of the Certificate handshake message failed" \ |
| 5449 | -c "Ciphersuite is TLS-" |
| 5450 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5451 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5452 | "$O_SRV -key data_files/server2.key \ |
| 5453 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5454 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5455 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5456 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5457 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5458 | -c "Processing of the Certificate handshake message failed" \ |
| 5459 | -C "Ciphersuite is TLS-" |
| 5460 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5461 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 5462 | "$O_SRV -key data_files/server2.key \ |
| 5463 | -cert data_files/server2.ku-ds.crt" \ |
| 5464 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5465 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5466 | 0 \ |
| 5467 | -c "bad certificate (usage extensions)" \ |
| 5468 | -C "Processing of the Certificate handshake message failed" \ |
| 5469 | -c "Ciphersuite is TLS-" \ |
| 5470 | -c "! Usage does not match the keyUsage extension" |
| 5471 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5472 | # Tests for keyUsage in leaf certificates, part 3: |
| 5473 | # server-side checking of client cert |
| 5474 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5475 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5476 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5477 | "$O_CLI -key data_files/server2.key \ |
| 5478 | -cert data_files/server2.ku-ds.crt" \ |
| 5479 | 0 \ |
| 5480 | -S "bad certificate (usage extensions)" \ |
| 5481 | -S "Processing of the Certificate handshake message failed" |
| 5482 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5483 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5484 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5485 | "$O_CLI -key data_files/server2.key \ |
| 5486 | -cert data_files/server2.ku-ke.crt" \ |
| 5487 | 0 \ |
| 5488 | -s "bad certificate (usage extensions)" \ |
| 5489 | -S "Processing of the Certificate handshake message failed" |
| 5490 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5491 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5492 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5493 | "$O_CLI -key data_files/server2.key \ |
| 5494 | -cert data_files/server2.ku-ke.crt" \ |
| 5495 | 1 \ |
| 5496 | -s "bad certificate (usage extensions)" \ |
| 5497 | -s "Processing of the Certificate handshake message failed" |
| 5498 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5499 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5500 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5501 | "$O_CLI -key data_files/server5.key \ |
| 5502 | -cert data_files/server5.ku-ds.crt" \ |
| 5503 | 0 \ |
| 5504 | -S "bad certificate (usage extensions)" \ |
| 5505 | -S "Processing of the Certificate handshake message failed" |
| 5506 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5507 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5508 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5509 | "$O_CLI -key data_files/server5.key \ |
| 5510 | -cert data_files/server5.ku-ka.crt" \ |
| 5511 | 0 \ |
| 5512 | -s "bad certificate (usage extensions)" \ |
| 5513 | -S "Processing of the Certificate handshake message failed" |
| 5514 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5515 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 5516 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5517 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5518 | "$P_SRV key_file=data_files/server5.key \ |
| 5519 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5520 | "$P_CLI" \ |
| 5521 | 0 |
| 5522 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5523 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5524 | "$P_SRV key_file=data_files/server5.key \ |
| 5525 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5526 | "$P_CLI" \ |
| 5527 | 0 |
| 5528 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5529 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5530 | "$P_SRV key_file=data_files/server5.key \ |
| 5531 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 5532 | "$P_CLI" \ |
| 5533 | 0 |
| 5534 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5535 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5536 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5537 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5538 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5539 | 1 |
| 5540 | |
| 5541 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 5542 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5543 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5544 | "$O_SRV -key data_files/server5.key \ |
| 5545 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5546 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5547 | 0 \ |
| 5548 | -C "bad certificate (usage extensions)" \ |
| 5549 | -C "Processing of the Certificate handshake message failed" \ |
| 5550 | -c "Ciphersuite is TLS-" |
| 5551 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5552 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5553 | "$O_SRV -key data_files/server5.key \ |
| 5554 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5555 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5556 | 0 \ |
| 5557 | -C "bad certificate (usage extensions)" \ |
| 5558 | -C "Processing of the Certificate handshake message failed" \ |
| 5559 | -c "Ciphersuite is TLS-" |
| 5560 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5561 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5562 | "$O_SRV -key data_files/server5.key \ |
| 5563 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5564 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5565 | 0 \ |
| 5566 | -C "bad certificate (usage extensions)" \ |
| 5567 | -C "Processing of the Certificate handshake message failed" \ |
| 5568 | -c "Ciphersuite is TLS-" |
| 5569 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5570 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5571 | "$O_SRV -key data_files/server5.key \ |
| 5572 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5573 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5574 | 1 \ |
| 5575 | -c "bad certificate (usage extensions)" \ |
| 5576 | -c "Processing of the Certificate handshake message failed" \ |
| 5577 | -C "Ciphersuite is TLS-" |
| 5578 | |
| 5579 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 5580 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5581 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5582 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5583 | "$O_CLI -key data_files/server5.key \ |
| 5584 | -cert data_files/server5.eku-cli.crt" \ |
| 5585 | 0 \ |
| 5586 | -S "bad certificate (usage extensions)" \ |
| 5587 | -S "Processing of the Certificate handshake message failed" |
| 5588 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5589 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5590 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5591 | "$O_CLI -key data_files/server5.key \ |
| 5592 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 5593 | 0 \ |
| 5594 | -S "bad certificate (usage extensions)" \ |
| 5595 | -S "Processing of the Certificate handshake message failed" |
| 5596 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5597 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5598 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5599 | "$O_CLI -key data_files/server5.key \ |
| 5600 | -cert data_files/server5.eku-cs_any.crt" \ |
| 5601 | 0 \ |
| 5602 | -S "bad certificate (usage extensions)" \ |
| 5603 | -S "Processing of the Certificate handshake message failed" |
| 5604 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5605 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5606 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5607 | "$O_CLI -key data_files/server5.key \ |
| 5608 | -cert data_files/server5.eku-cs.crt" \ |
| 5609 | 0 \ |
| 5610 | -s "bad certificate (usage extensions)" \ |
| 5611 | -S "Processing of the Certificate handshake message failed" |
| 5612 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5613 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5614 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5615 | "$O_CLI -key data_files/server5.key \ |
| 5616 | -cert data_files/server5.eku-cs.crt" \ |
| 5617 | 1 \ |
| 5618 | -s "bad certificate (usage extensions)" \ |
| 5619 | -s "Processing of the Certificate handshake message failed" |
| 5620 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5621 | # Tests for DHM parameters loading |
| 5622 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5623 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5624 | "$P_SRV" \ |
| 5625 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5626 | debug_level=3" \ |
| 5627 | 0 \ |
| 5628 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 5629 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5630 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5631 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5632 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5633 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5634 | debug_level=3" \ |
| 5635 | 0 \ |
| 5636 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 5637 | -c "value of 'DHM: G ' (2 bits)" |
| 5638 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5639 | # Tests for DHM client-side size checking |
| 5640 | |
| 5641 | run_test "DHM size: server default, client default, OK" \ |
| 5642 | "$P_SRV" \ |
| 5643 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5644 | debug_level=1" \ |
| 5645 | 0 \ |
| 5646 | -C "DHM prime too short:" |
| 5647 | |
| 5648 | run_test "DHM size: server default, client 2048, OK" \ |
| 5649 | "$P_SRV" \ |
| 5650 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5651 | debug_level=1 dhmlen=2048" \ |
| 5652 | 0 \ |
| 5653 | -C "DHM prime too short:" |
| 5654 | |
| 5655 | run_test "DHM size: server 1024, client default, OK" \ |
| 5656 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5657 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5658 | debug_level=1" \ |
| 5659 | 0 \ |
| 5660 | -C "DHM prime too short:" |
| 5661 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5662 | run_test "DHM size: server 999, client 999, OK" \ |
| 5663 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5664 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5665 | debug_level=1 dhmlen=999" \ |
| 5666 | 0 \ |
| 5667 | -C "DHM prime too short:" |
| 5668 | |
| 5669 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 5670 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5671 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5672 | debug_level=1 dhmlen=1000" \ |
| 5673 | 0 \ |
| 5674 | -C "DHM prime too short:" |
| 5675 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5676 | run_test "DHM size: server 1000, client default, rejected" \ |
| 5677 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5678 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5679 | debug_level=1" \ |
| 5680 | 1 \ |
| 5681 | -c "DHM prime too short:" |
| 5682 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5683 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 5684 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5685 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5686 | debug_level=1 dhmlen=1001" \ |
| 5687 | 1 \ |
| 5688 | -c "DHM prime too short:" |
| 5689 | |
| 5690 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 5691 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5692 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5693 | debug_level=1 dhmlen=1000" \ |
| 5694 | 1 \ |
| 5695 | -c "DHM prime too short:" |
| 5696 | |
| 5697 | run_test "DHM size: server 998, client 999, rejected" \ |
| 5698 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 5699 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5700 | debug_level=1 dhmlen=999" \ |
| 5701 | 1 \ |
| 5702 | -c "DHM prime too short:" |
| 5703 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5704 | run_test "DHM size: server default, client 2049, rejected" \ |
| 5705 | "$P_SRV" \ |
| 5706 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5707 | debug_level=1 dhmlen=2049" \ |
| 5708 | 1 \ |
| 5709 | -c "DHM prime too short:" |
| 5710 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5711 | # Tests for PSK callback |
| 5712 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5713 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5714 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 5715 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5716 | psk_identity=foo psk=abc123" \ |
| 5717 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5718 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5719 | -S "SSL - Unknown identity received" \ |
| 5720 | -S "SSL - Verification of the message MAC failed" |
| 5721 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5722 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5723 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 5724 | "$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] | 5725 | "$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] | 5726 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5727 | 0 \ |
| 5728 | -c "skip PMS generation for opaque PSK"\ |
| 5729 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5730 | -C "session hash for extended master secret"\ |
| 5731 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5732 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5733 | -S "SSL - Unknown identity received" \ |
| 5734 | -S "SSL - Verification of the message MAC failed" |
| 5735 | |
| 5736 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5737 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 5738 | "$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] | 5739 | "$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] | 5740 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5741 | 0 \ |
| 5742 | -c "skip PMS generation for opaque PSK"\ |
| 5743 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5744 | -C "session hash for extended master secret"\ |
| 5745 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5746 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5747 | -S "SSL - Unknown identity received" \ |
| 5748 | -S "SSL - Verification of the message MAC failed" |
| 5749 | |
| 5750 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5751 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 5752 | "$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] | 5753 | "$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] | 5754 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5755 | 0 \ |
| 5756 | -c "skip PMS generation for opaque PSK"\ |
| 5757 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5758 | -c "session hash for extended master secret"\ |
| 5759 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5760 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5761 | -S "SSL - Unknown identity received" \ |
| 5762 | -S "SSL - Verification of the message MAC failed" |
| 5763 | |
| 5764 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5765 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 5766 | "$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] | 5767 | "$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] | 5768 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5769 | 0 \ |
| 5770 | -c "skip PMS generation for opaque PSK"\ |
| 5771 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5772 | -c "session hash for extended master secret"\ |
| 5773 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5774 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5775 | -S "SSL - Unknown identity received" \ |
| 5776 | -S "SSL - Verification of the message MAC failed" |
| 5777 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5778 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5779 | 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] | 5780 | "$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" \ |
| 5781 | "$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] | 5782 | psk_identity=foo psk=abc123" \ |
| 5783 | 0 \ |
| 5784 | -C "skip PMS generation for opaque PSK"\ |
| 5785 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5786 | -C "session hash for extended master secret"\ |
| 5787 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5788 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5789 | -S "SSL - Unknown identity received" \ |
| 5790 | -S "SSL - Verification of the message MAC failed" |
| 5791 | |
| 5792 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5793 | 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] | 5794 | "$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" \ |
| 5795 | "$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] | 5796 | psk_identity=foo psk=abc123" \ |
| 5797 | 0 \ |
| 5798 | -C "skip PMS generation for opaque PSK"\ |
| 5799 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5800 | -C "session hash for extended master secret"\ |
| 5801 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5802 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5803 | -S "SSL - Unknown identity received" \ |
| 5804 | -S "SSL - Verification of the message MAC failed" |
| 5805 | |
| 5806 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5807 | 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] | 5808 | "$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] | 5809 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5810 | "$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] | 5811 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5812 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5813 | -c "session hash for extended master secret"\ |
| 5814 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5815 | -C "skip PMS generation for opaque PSK"\ |
| 5816 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5817 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5818 | -S "SSL - Unknown identity received" \ |
| 5819 | -S "SSL - Verification of the message MAC failed" |
| 5820 | |
| 5821 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5822 | 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] | 5823 | "$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] | 5824 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5825 | "$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] | 5826 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5827 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5828 | -c "session hash for extended master secret"\ |
| 5829 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5830 | -C "skip PMS generation for opaque PSK"\ |
| 5831 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5832 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5833 | -S "SSL - Unknown identity received" \ |
| 5834 | -S "SSL - Verification of the message MAC failed" |
| 5835 | |
| 5836 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5837 | 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] | 5838 | "$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" \ |
| 5839 | "$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] | 5840 | psk_identity=def psk=beef" \ |
| 5841 | 0 \ |
| 5842 | -C "skip PMS generation for opaque PSK"\ |
| 5843 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5844 | -C "session hash for extended master secret"\ |
| 5845 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5846 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5847 | -S "SSL - Unknown identity received" \ |
| 5848 | -S "SSL - Verification of the message MAC failed" |
| 5849 | |
| 5850 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5851 | 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] | 5852 | "$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" \ |
| 5853 | "$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] | 5854 | psk_identity=def psk=beef" \ |
| 5855 | 0 \ |
| 5856 | -C "skip PMS generation for opaque PSK"\ |
| 5857 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5858 | -C "session hash for extended master secret"\ |
| 5859 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5860 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5861 | -S "SSL - Unknown identity received" \ |
| 5862 | -S "SSL - Verification of the message MAC failed" |
| 5863 | |
| 5864 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5865 | 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] | 5866 | "$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] | 5867 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5868 | "$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] | 5869 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5870 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5871 | -c "session hash for extended master secret"\ |
| 5872 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5873 | -C "skip PMS generation for opaque PSK"\ |
| 5874 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5875 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5876 | -S "SSL - Unknown identity received" \ |
| 5877 | -S "SSL - Verification of the message MAC failed" |
| 5878 | |
| 5879 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5880 | 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] | 5881 | "$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] | 5882 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5883 | "$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] | 5884 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5885 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5886 | -c "session hash for extended master secret"\ |
| 5887 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5888 | -C "skip PMS generation for opaque PSK"\ |
| 5889 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5890 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5891 | -S "SSL - Unknown identity received" \ |
| 5892 | -S "SSL - Verification of the message MAC failed" |
| 5893 | |
| 5894 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5895 | 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] | 5896 | "$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" \ |
| 5897 | "$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] | 5898 | psk_identity=def psk=beef" \ |
| 5899 | 0 \ |
| 5900 | -C "skip PMS generation for opaque PSK"\ |
| 5901 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5902 | -C "session hash for extended master secret"\ |
| 5903 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5904 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5905 | -S "SSL - Unknown identity received" \ |
| 5906 | -S "SSL - Verification of the message MAC failed" |
| 5907 | |
| 5908 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5909 | 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] | 5910 | "$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" \ |
| 5911 | "$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] | 5912 | psk_identity=def psk=beef" \ |
| 5913 | 0 \ |
| 5914 | -C "skip PMS generation for opaque PSK"\ |
| 5915 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5916 | -C "session hash for extended master secret"\ |
| 5917 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5918 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5919 | -S "SSL - Unknown identity received" \ |
| 5920 | -S "SSL - Verification of the message MAC failed" |
| 5921 | |
| 5922 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5923 | 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] | 5924 | "$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" \ |
| 5925 | "$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] | 5926 | psk_identity=def psk=beef" \ |
| 5927 | 0 \ |
| 5928 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5929 | -C "session hash for extended master secret"\ |
| 5930 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5931 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5932 | -S "SSL - Unknown identity received" \ |
| 5933 | -S "SSL - Verification of the message MAC failed" |
| 5934 | |
| 5935 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5936 | 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] | 5937 | "$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" \ |
| 5938 | "$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] | 5939 | psk_identity=def psk=beef" \ |
| 5940 | 0 \ |
| 5941 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5942 | -C "session hash for extended master secret"\ |
| 5943 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5944 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5945 | -S "SSL - Unknown identity received" \ |
| 5946 | -S "SSL - Verification of the message MAC failed" |
| 5947 | |
| 5948 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5949 | 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] | 5950 | "$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" \ |
| 5951 | "$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] | 5952 | psk_identity=def psk=beef" \ |
| 5953 | 1 \ |
| 5954 | -s "SSL - Verification of the message MAC failed" |
| 5955 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5956 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5957 | "$P_SRV" \ |
| 5958 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5959 | psk_identity=foo psk=abc123" \ |
| 5960 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 5961 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5962 | -S "SSL - Unknown identity received" \ |
| 5963 | -S "SSL - Verification of the message MAC failed" |
| 5964 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5965 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5966 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 5967 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5968 | psk_identity=foo psk=abc123" \ |
| 5969 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5970 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5971 | -s "SSL - Unknown identity received" \ |
| 5972 | -S "SSL - Verification of the message MAC failed" |
| 5973 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5974 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5975 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5976 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5977 | psk_identity=abc psk=dead" \ |
| 5978 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5979 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5980 | -S "SSL - Unknown identity received" \ |
| 5981 | -S "SSL - Verification of the message MAC failed" |
| 5982 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5983 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5984 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5985 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5986 | psk_identity=def psk=beef" \ |
| 5987 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5988 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5989 | -S "SSL - Unknown identity received" \ |
| 5990 | -S "SSL - Verification of the message MAC failed" |
| 5991 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5992 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5993 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5994 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5995 | psk_identity=ghi psk=beef" \ |
| 5996 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5997 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5998 | -s "SSL - Unknown identity received" \ |
| 5999 | -S "SSL - Verification of the message MAC failed" |
| 6000 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6001 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6002 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6003 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6004 | psk_identity=abc psk=beef" \ |
| 6005 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6006 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6007 | -S "SSL - Unknown identity received" \ |
| 6008 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6009 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6010 | # Tests for EC J-PAKE |
| 6011 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6012 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6013 | run_test "ECJPAKE: client not configured" \ |
| 6014 | "$P_SRV debug_level=3" \ |
| 6015 | "$P_CLI debug_level=3" \ |
| 6016 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6017 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6018 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6019 | -S "found ecjpake kkpp extension" \ |
| 6020 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6021 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6022 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6023 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 6024 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6025 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6026 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6027 | run_test "ECJPAKE: server not configured" \ |
| 6028 | "$P_SRV debug_level=3" \ |
| 6029 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 6030 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6031 | 1 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6032 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6033 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6034 | -s "found ecjpake kkpp extension" \ |
| 6035 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6036 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6037 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6038 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 6039 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6040 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6041 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6042 | run_test "ECJPAKE: working, TLS" \ |
| 6043 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 6044 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 6045 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 6046 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6047 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6048 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6049 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6050 | -s "found ecjpake kkpp extension" \ |
| 6051 | -S "skip ecjpake kkpp extension" \ |
| 6052 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6053 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6054 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 6055 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6056 | -S "SSL - Verification of the message MAC failed" |
| 6057 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6058 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6059 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6060 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 6061 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 6062 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 6063 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6064 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6065 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6066 | -s "SSL - Verification of the message MAC failed" |
| 6067 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6068 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6069 | run_test "ECJPAKE: working, DTLS" \ |
| 6070 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 6071 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 6072 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6073 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6074 | -c "re-using cached ecjpake parameters" \ |
| 6075 | -S "SSL - Verification of the message MAC failed" |
| 6076 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6077 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6078 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 6079 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 6080 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 6081 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6082 | 0 \ |
| 6083 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6084 | -S "SSL - Verification of the message MAC failed" |
| 6085 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6086 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6087 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6088 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 6089 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 6090 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 6091 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6092 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6093 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6094 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6095 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 6096 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6097 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 6098 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 6099 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 6100 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 6101 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6102 | 0 |
| 6103 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 6104 | # Test for ClientHello without extensions |
| 6105 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 6106 | requires_gnutls |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 6107 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 6108 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6109 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 6110 | 0 \ |
| 6111 | -s "dumping 'client hello extensions' (0 bytes)" |
| 6112 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6113 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6114 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6115 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6116 | "$P_SRV" \ |
| 6117 | "$P_CLI request_size=100" \ |
| 6118 | 0 \ |
| 6119 | -s "Read from client: 100 bytes read$" |
| 6120 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6121 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6122 | "$P_SRV" \ |
| 6123 | "$P_CLI request_size=500" \ |
| 6124 | 0 \ |
| 6125 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6126 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6127 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6128 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6129 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6130 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6131 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6132 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6133 | 0 \ |
| 6134 | -s "Read from client: 1 bytes read" |
| 6135 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6136 | 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] | 6137 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6138 | "$P_CLI request_size=1 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6139 | 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] | 6140 | 0 \ |
| 6141 | -s "Read from client: 1 bytes read" |
| 6142 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6143 | 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] | 6144 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6145 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6146 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6147 | 0 \ |
| 6148 | -s "Read from client: 1 bytes read" |
| 6149 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6150 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6151 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6152 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6153 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6154 | 0 \ |
| 6155 | -s "Read from client: 1 bytes read" |
| 6156 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6157 | 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] | 6158 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6159 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6160 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6161 | 0 \ |
| 6162 | -s "Read from client: 1 bytes read" |
| 6163 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6164 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6165 | |
| 6166 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6167 | run_test "Small client packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6168 | "$P_SRV dtls=1 force_version=dtls12" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6169 | "$P_CLI dtls=1 request_size=1 \ |
| 6170 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6171 | 0 \ |
| 6172 | -s "Read from client: 1 bytes read" |
| 6173 | |
| 6174 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6175 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6176 | "$P_SRV dtls=1 force_version=dtls12 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6177 | "$P_CLI dtls=1 request_size=1 \ |
| 6178 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6179 | 0 \ |
| 6180 | -s "Read from client: 1 bytes read" |
| 6181 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6182 | # Tests for small server packets |
| 6183 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6184 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 6185 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6186 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6187 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6188 | 0 \ |
| 6189 | -c "Read from server: 1 bytes read" |
| 6190 | |
| 6191 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6192 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6193 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6194 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 6195 | 0 \ |
| 6196 | -c "Read from server: 1 bytes read" |
| 6197 | |
| 6198 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6199 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6200 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6201 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6202 | 0 \ |
| 6203 | -c "Read from server: 1 bytes read" |
| 6204 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6205 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 6206 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6207 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6208 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6209 | 0 \ |
| 6210 | -c "Read from server: 1 bytes read" |
| 6211 | |
| 6212 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 6213 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6214 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6215 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6216 | 0 \ |
| 6217 | -c "Read from server: 1 bytes read" |
| 6218 | |
| 6219 | # Tests for small server packets in DTLS |
| 6220 | |
| 6221 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6222 | run_test "Small server packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6223 | "$P_SRV dtls=1 response_size=1 force_version=dtls12" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6224 | "$P_CLI dtls=1 \ |
| 6225 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6226 | 0 \ |
| 6227 | -c "Read from server: 1 bytes read" |
| 6228 | |
| 6229 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6230 | run_test "Small server packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6231 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6232 | "$P_CLI dtls=1 \ |
| 6233 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6234 | 0 \ |
| 6235 | -c "Read from server: 1 bytes read" |
| 6236 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6237 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6238 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6239 | # How many fragments do we expect to write $1 bytes? |
| 6240 | fragments_for_write() { |
| 6241 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 6242 | } |
| 6243 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6244 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6245 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6246 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6247 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6248 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6249 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6250 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6251 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6252 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6253 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6254 | "$P_CLI request_size=16384 force_version=tls12 etm=0 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6255 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6256 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6257 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6258 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6259 | 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] | 6260 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6261 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6262 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6263 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6264 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6265 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6266 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6267 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6268 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6269 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6270 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6271 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6272 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6273 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6274 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6275 | 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] | 6276 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6277 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6278 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6279 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6280 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6281 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6282 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6283 | # 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] | 6284 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 6285 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6286 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6287 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6288 | 0 \ |
| 6289 | -c "Read from server: 16384 bytes read" |
| 6290 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6291 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6292 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6293 | "$P_CLI force_version=tls12 etm=0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6294 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6295 | 0 \ |
| 6296 | -s "16384 bytes written in 1 fragments" \ |
| 6297 | -c "Read from server: 16384 bytes read" |
| 6298 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6299 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6300 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6301 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6302 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6303 | 0 \ |
| 6304 | -c "Read from server: 16384 bytes read" |
| 6305 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6306 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 6307 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6308 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6309 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6310 | 0 \ |
| 6311 | -s "16384 bytes written in 1 fragments" \ |
| 6312 | -c "Read from server: 16384 bytes read" |
| 6313 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6314 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 6315 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6316 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6317 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6318 | 0 \ |
| 6319 | -c "Read from server: 16384 bytes read" |
| 6320 | |
| 6321 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 6322 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6323 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6324 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6325 | 0 \ |
| 6326 | -c "Read from server: 16384 bytes read" |
| 6327 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6328 | # Tests for restartable ECC |
| 6329 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6330 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 6331 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6332 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6333 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6334 | run_test "EC restart: TLS, default" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6335 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6336 | "$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] | 6337 | 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] | 6338 | debug_level=1" \ |
| 6339 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6340 | -C "x509_verify_cert.*4b00" \ |
| 6341 | -C "mbedtls_pk_verify.*4b00" \ |
| 6342 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6343 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6344 | |
| 6345 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6346 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6347 | run_test "EC restart: TLS, max_ops=0" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6348 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6349 | "$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] | 6350 | 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] | 6351 | debug_level=1 ec_max_ops=0" \ |
| 6352 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6353 | -C "x509_verify_cert.*4b00" \ |
| 6354 | -C "mbedtls_pk_verify.*4b00" \ |
| 6355 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6356 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6357 | |
| 6358 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6359 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6360 | run_test "EC restart: TLS, max_ops=65535" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6361 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6362 | "$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] | 6363 | 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] | 6364 | debug_level=1 ec_max_ops=65535" \ |
| 6365 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6366 | -C "x509_verify_cert.*4b00" \ |
| 6367 | -C "mbedtls_pk_verify.*4b00" \ |
| 6368 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6369 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6370 | |
| 6371 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6372 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6373 | run_test "EC restart: TLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6374 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6375 | "$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] | 6376 | 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] | 6377 | debug_level=1 ec_max_ops=1000" \ |
| 6378 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6379 | -c "x509_verify_cert.*4b00" \ |
| 6380 | -c "mbedtls_pk_verify.*4b00" \ |
| 6381 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6382 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6383 | |
| 6384 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6385 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6386 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6387 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6388 | crt_file=data_files/server5-badsign.crt \ |
| 6389 | key_file=data_files/server5.key" \ |
| 6390 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6391 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6392 | debug_level=1 ec_max_ops=1000" \ |
| 6393 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6394 | -c "x509_verify_cert.*4b00" \ |
| 6395 | -C "mbedtls_pk_verify.*4b00" \ |
| 6396 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6397 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6398 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6399 | -c "! mbedtls_ssl_handshake returned" \ |
| 6400 | -c "X509 - Certificate verification failed" |
| 6401 | |
| 6402 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6403 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6404 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6405 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6406 | crt_file=data_files/server5-badsign.crt \ |
| 6407 | key_file=data_files/server5.key" \ |
| 6408 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6409 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6410 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 6411 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6412 | -c "x509_verify_cert.*4b00" \ |
| 6413 | -c "mbedtls_pk_verify.*4b00" \ |
| 6414 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6415 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6416 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6417 | -C "! mbedtls_ssl_handshake returned" \ |
| 6418 | -C "X509 - Certificate verification failed" |
| 6419 | |
| 6420 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6421 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6422 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6423 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6424 | crt_file=data_files/server5-badsign.crt \ |
| 6425 | key_file=data_files/server5.key" \ |
| 6426 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6427 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6428 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 6429 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6430 | -C "x509_verify_cert.*4b00" \ |
| 6431 | -c "mbedtls_pk_verify.*4b00" \ |
| 6432 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6433 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6434 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6435 | -C "! mbedtls_ssl_handshake returned" \ |
| 6436 | -C "X509 - Certificate verification failed" |
| 6437 | |
| 6438 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6439 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6440 | run_test "EC restart: DTLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6441 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6442 | "$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] | 6443 | 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] | 6444 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 6445 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6446 | -c "x509_verify_cert.*4b00" \ |
| 6447 | -c "mbedtls_pk_verify.*4b00" \ |
| 6448 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6449 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6450 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6451 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6452 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6453 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6454 | "$P_SRV curves=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6455 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6456 | debug_level=1 ec_max_ops=1000" \ |
| 6457 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6458 | -c "x509_verify_cert.*4b00" \ |
| 6459 | -c "mbedtls_pk_verify.*4b00" \ |
| 6460 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6461 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6462 | |
| 6463 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6464 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6465 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6466 | "$P_SRV curves=secp256r1 psk=abc123" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6467 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 6468 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 6469 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6470 | -C "x509_verify_cert.*4b00" \ |
| 6471 | -C "mbedtls_pk_verify.*4b00" \ |
| 6472 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6473 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6474 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6475 | # Tests of asynchronous private key support in SSL |
| 6476 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6477 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6478 | run_test "SSL async private: sign, delay=0" \ |
| 6479 | "$P_SRV \ |
| 6480 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6481 | "$P_CLI" \ |
| 6482 | 0 \ |
| 6483 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6484 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6485 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6486 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6487 | run_test "SSL async private: sign, delay=1" \ |
| 6488 | "$P_SRV \ |
| 6489 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6490 | "$P_CLI" \ |
| 6491 | 0 \ |
| 6492 | -s "Async sign callback: using key slot " \ |
| 6493 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6494 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6495 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 6496 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6497 | run_test "SSL async private: sign, delay=2" \ |
| 6498 | "$P_SRV \ |
| 6499 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 6500 | "$P_CLI" \ |
| 6501 | 0 \ |
| 6502 | -s "Async sign callback: using key slot " \ |
| 6503 | -U "Async sign callback: using key slot " \ |
| 6504 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 6505 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6506 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6507 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6508 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6509 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 6510 | run_test "SSL async private: sign, SNI" \ |
| 6511 | "$P_SRV debug_level=3 \ |
| 6512 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 6513 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6514 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6515 | "$P_CLI server_name=polarssl.example" \ |
| 6516 | 0 \ |
| 6517 | -s "Async sign callback: using key slot " \ |
| 6518 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6519 | -s "parse ServerName extension" \ |
| 6520 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6521 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6522 | |
| 6523 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6524 | run_test "SSL async private: decrypt, delay=0" \ |
| 6525 | "$P_SRV \ |
| 6526 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6527 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6528 | 0 \ |
| 6529 | -s "Async decrypt callback: using key slot " \ |
| 6530 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6531 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6532 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6533 | run_test "SSL async private: decrypt, delay=1" \ |
| 6534 | "$P_SRV \ |
| 6535 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6536 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6537 | 0 \ |
| 6538 | -s "Async decrypt callback: using key slot " \ |
| 6539 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6540 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6541 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6542 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6543 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 6544 | "$P_SRV psk=abc123 \ |
| 6545 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6546 | "$P_CLI psk=abc123 \ |
| 6547 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6548 | 0 \ |
| 6549 | -s "Async decrypt callback: using key slot " \ |
| 6550 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6551 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6552 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6553 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 6554 | "$P_SRV psk=abc123 \ |
| 6555 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6556 | "$P_CLI psk=abc123 \ |
| 6557 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6558 | 0 \ |
| 6559 | -s "Async decrypt callback: using key slot " \ |
| 6560 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6561 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6562 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6563 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6564 | run_test "SSL async private: sign callback not present" \ |
| 6565 | "$P_SRV \ |
| 6566 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6567 | "$P_CLI; [ \$? -eq 1 ] && |
| 6568 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6569 | 0 \ |
| 6570 | -S "Async sign callback" \ |
| 6571 | -s "! mbedtls_ssl_handshake returned" \ |
| 6572 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 6573 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 6574 | -s "Successful connection" |
| 6575 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6576 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6577 | run_test "SSL async private: decrypt callback not present" \ |
| 6578 | "$P_SRV debug_level=1 \ |
| 6579 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 6580 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 6581 | [ \$? -eq 1 ] && $P_CLI" \ |
| 6582 | 0 \ |
| 6583 | -S "Async decrypt callback" \ |
| 6584 | -s "! mbedtls_ssl_handshake returned" \ |
| 6585 | -s "got no RSA private key" \ |
| 6586 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6587 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6588 | |
| 6589 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6590 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6591 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6592 | "$P_SRV \ |
| 6593 | async_operations=s async_private_delay1=1 \ |
| 6594 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6595 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6596 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6597 | 0 \ |
| 6598 | -s "Async sign callback: using key slot 0," \ |
| 6599 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6600 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6601 | |
| 6602 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6603 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6604 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6605 | "$P_SRV \ |
| 6606 | async_operations=s async_private_delay2=1 \ |
| 6607 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6608 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6609 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6610 | 0 \ |
| 6611 | -s "Async sign callback: using key slot 0," \ |
| 6612 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6613 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6614 | |
| 6615 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6616 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 6617 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6618 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 6619 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6620 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6621 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6622 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6623 | 0 \ |
| 6624 | -s "Async sign callback: using key slot 1," \ |
| 6625 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6626 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6627 | |
| 6628 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6629 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6630 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6631 | "$P_SRV \ |
| 6632 | async_operations=s async_private_delay1=1 \ |
| 6633 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6634 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6635 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6636 | 0 \ |
| 6637 | -s "Async sign callback: no key matches this certificate." |
| 6638 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6639 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6640 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6641 | "$P_SRV \ |
| 6642 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6643 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6644 | "$P_CLI" \ |
| 6645 | 1 \ |
| 6646 | -s "Async sign callback: injected error" \ |
| 6647 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6648 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6649 | -s "! mbedtls_ssl_handshake returned" |
| 6650 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6651 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6652 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6653 | "$P_SRV \ |
| 6654 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6655 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6656 | "$P_CLI" \ |
| 6657 | 1 \ |
| 6658 | -s "Async sign callback: using key slot " \ |
| 6659 | -S "Async resume" \ |
| 6660 | -s "Async cancel" |
| 6661 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6662 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6663 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6664 | "$P_SRV \ |
| 6665 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6666 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6667 | "$P_CLI" \ |
| 6668 | 1 \ |
| 6669 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6670 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6671 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6672 | -s "! mbedtls_ssl_handshake returned" |
| 6673 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6674 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6675 | run_test "SSL async private: decrypt, error in start" \ |
| 6676 | "$P_SRV \ |
| 6677 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6678 | async_private_error=1" \ |
| 6679 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6680 | 1 \ |
| 6681 | -s "Async decrypt callback: injected error" \ |
| 6682 | -S "Async resume" \ |
| 6683 | -S "Async cancel" \ |
| 6684 | -s "! mbedtls_ssl_handshake returned" |
| 6685 | |
| 6686 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6687 | run_test "SSL async private: decrypt, cancel after start" \ |
| 6688 | "$P_SRV \ |
| 6689 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6690 | async_private_error=2" \ |
| 6691 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6692 | 1 \ |
| 6693 | -s "Async decrypt callback: using key slot " \ |
| 6694 | -S "Async resume" \ |
| 6695 | -s "Async cancel" |
| 6696 | |
| 6697 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6698 | run_test "SSL async private: decrypt, error in resume" \ |
| 6699 | "$P_SRV \ |
| 6700 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6701 | async_private_error=3" \ |
| 6702 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6703 | 1 \ |
| 6704 | -s "Async decrypt callback: using key slot " \ |
| 6705 | -s "Async resume callback: decrypt done but injected error" \ |
| 6706 | -S "Async cancel" \ |
| 6707 | -s "! mbedtls_ssl_handshake returned" |
| 6708 | |
| 6709 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6710 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6711 | "$P_SRV \ |
| 6712 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6713 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6714 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6715 | 0 \ |
| 6716 | -s "Async cancel" \ |
| 6717 | -s "! mbedtls_ssl_handshake returned" \ |
| 6718 | -s "Async resume" \ |
| 6719 | -s "Successful connection" |
| 6720 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6721 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6722 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6723 | "$P_SRV \ |
| 6724 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6725 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6726 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6727 | 0 \ |
| 6728 | -s "! mbedtls_ssl_handshake returned" \ |
| 6729 | -s "Async resume" \ |
| 6730 | -s "Successful connection" |
| 6731 | |
| 6732 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6733 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6734 | 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] | 6735 | "$P_SRV \ |
| 6736 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 6737 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6738 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6739 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6740 | [ \$? -eq 1 ] && |
| 6741 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6742 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 6743 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6744 | -S "Async resume" \ |
| 6745 | -s "Async cancel" \ |
| 6746 | -s "! mbedtls_ssl_handshake returned" \ |
| 6747 | -s "Async sign callback: no key matches this certificate." \ |
| 6748 | -s "Successful connection" |
| 6749 | |
| 6750 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6751 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6752 | 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] | 6753 | "$P_SRV \ |
| 6754 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 6755 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6756 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6757 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6758 | [ \$? -eq 1 ] && |
| 6759 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6760 | 0 \ |
| 6761 | -s "Async resume" \ |
| 6762 | -s "! mbedtls_ssl_handshake returned" \ |
| 6763 | -s "Async sign callback: no key matches this certificate." \ |
| 6764 | -s "Successful connection" |
| 6765 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6766 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6767 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6768 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6769 | "$P_SRV \ |
| 6770 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6771 | exchanges=2 renegotiation=1" \ |
| 6772 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6773 | 0 \ |
| 6774 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6775 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6776 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6777 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6778 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6779 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6780 | "$P_SRV \ |
| 6781 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6782 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6783 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 6784 | 0 \ |
| 6785 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6786 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6787 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6788 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6789 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6790 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6791 | "$P_SRV \ |
| 6792 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6793 | exchanges=2 renegotiation=1" \ |
| 6794 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 6795 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6796 | 0 \ |
| 6797 | -s "Async decrypt callback: using key slot " \ |
| 6798 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6799 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6800 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6801 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6802 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6803 | "$P_SRV \ |
| 6804 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6805 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6806 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 6807 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6808 | 0 \ |
| 6809 | -s "Async decrypt callback: using key slot " \ |
| 6810 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6811 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6812 | # Tests for ECC extensions (rfc 4492) |
| 6813 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6814 | requires_config_enabled MBEDTLS_AES_C |
| 6815 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6816 | requires_config_enabled MBEDTLS_SHA256_C |
| 6817 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6818 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 6819 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6820 | "$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] | 6821 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 6822 | -C "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6823 | -C "client hello, adding supported_point_formats extension" \ |
| 6824 | -S "found supported elliptic curves extension" \ |
| 6825 | -S "found supported point formats extension" |
| 6826 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6827 | requires_config_enabled MBEDTLS_AES_C |
| 6828 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6829 | requires_config_enabled MBEDTLS_SHA256_C |
| 6830 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6831 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6832 | "$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] | 6833 | "$P_CLI debug_level=3" \ |
| 6834 | 0 \ |
| 6835 | -C "found supported_point_formats extension" \ |
| 6836 | -S "server hello, supported_point_formats extension" |
| 6837 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6838 | requires_config_enabled MBEDTLS_AES_C |
| 6839 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6840 | requires_config_enabled MBEDTLS_SHA256_C |
| 6841 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6842 | run_test "Force an ECC ciphersuite in the client side" \ |
| 6843 | "$P_SRV debug_level=3" \ |
| 6844 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6845 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 6846 | -c "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6847 | -c "client hello, adding supported_point_formats extension" \ |
| 6848 | -s "found supported elliptic curves extension" \ |
| 6849 | -s "found supported point formats extension" |
| 6850 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6851 | requires_config_enabled MBEDTLS_AES_C |
| 6852 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6853 | requires_config_enabled MBEDTLS_SHA256_C |
| 6854 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6855 | run_test "Force an ECC ciphersuite in the server side" \ |
| 6856 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6857 | "$P_CLI debug_level=3" \ |
| 6858 | 0 \ |
| 6859 | -c "found supported_point_formats extension" \ |
| 6860 | -s "server hello, supported_point_formats extension" |
| 6861 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6862 | # Tests for DTLS HelloVerifyRequest |
| 6863 | |
| 6864 | run_test "DTLS cookie: enabled" \ |
| 6865 | "$P_SRV dtls=1 debug_level=2" \ |
| 6866 | "$P_CLI dtls=1 debug_level=2" \ |
| 6867 | 0 \ |
| 6868 | -s "cookie verification failed" \ |
| 6869 | -s "cookie verification passed" \ |
| 6870 | -S "cookie verification skipped" \ |
| 6871 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6872 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6873 | -S "SSL - The requested feature is not available" |
| 6874 | |
| 6875 | run_test "DTLS cookie: disabled" \ |
| 6876 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 6877 | "$P_CLI dtls=1 debug_level=2" \ |
| 6878 | 0 \ |
| 6879 | -S "cookie verification failed" \ |
| 6880 | -S "cookie verification passed" \ |
| 6881 | -s "cookie verification skipped" \ |
| 6882 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6883 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6884 | -S "SSL - The requested feature is not available" |
| 6885 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6886 | run_test "DTLS cookie: default (failing)" \ |
| 6887 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 6888 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 6889 | 1 \ |
| 6890 | -s "cookie verification failed" \ |
| 6891 | -S "cookie verification passed" \ |
| 6892 | -S "cookie verification skipped" \ |
| 6893 | -C "received hello verify request" \ |
| 6894 | -S "hello verification requested" \ |
| 6895 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6896 | |
| 6897 | requires_ipv6 |
| 6898 | run_test "DTLS cookie: enabled, IPv6" \ |
| 6899 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 6900 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 6901 | 0 \ |
| 6902 | -s "cookie verification failed" \ |
| 6903 | -s "cookie verification passed" \ |
| 6904 | -S "cookie verification skipped" \ |
| 6905 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6906 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6907 | -S "SSL - The requested feature is not available" |
| 6908 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6909 | run_test "DTLS cookie: enabled, nbio" \ |
| 6910 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 6911 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6912 | 0 \ |
| 6913 | -s "cookie verification failed" \ |
| 6914 | -s "cookie verification passed" \ |
| 6915 | -S "cookie verification skipped" \ |
| 6916 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6917 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6918 | -S "SSL - The requested feature is not available" |
| 6919 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6920 | # Tests for client reconnecting from the same port with DTLS |
| 6921 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6922 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6923 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 6924 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 6925 | "$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] | 6926 | 0 \ |
| 6927 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6928 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6929 | -S "Client initiated reconnection from same port" |
| 6930 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6931 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6932 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 6933 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 6934 | "$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] | 6935 | 0 \ |
| 6936 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6937 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6938 | -s "Client initiated reconnection from same port" |
| 6939 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6940 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 6941 | 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] | 6942 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 6943 | "$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] | 6944 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6945 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6946 | -s "Client initiated reconnection from same port" |
| 6947 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6948 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 6949 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 6950 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 6951 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 6952 | 0 \ |
| 6953 | -S "The operation timed out" \ |
| 6954 | -s "Client initiated reconnection from same port" |
| 6955 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6956 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 6957 | "$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] | 6958 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 6959 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6960 | -s "The operation timed out" \ |
| 6961 | -S "Client initiated reconnection from same port" |
| 6962 | |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 6963 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 6964 | -p "$P_PXY inject_clihlo=1" \ |
| 6965 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 6966 | "$P_CLI dtls=1 exchanges=2" \ |
| 6967 | 0 \ |
| 6968 | -s "possible client reconnect from the same port" \ |
| 6969 | -S "Client initiated reconnection from same port" |
| 6970 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6971 | # Tests for various cases of client authentication with DTLS |
| 6972 | # (focused on handshake flows and message parsing) |
| 6973 | |
| 6974 | run_test "DTLS client auth: required" \ |
| 6975 | "$P_SRV dtls=1 auth_mode=required" \ |
| 6976 | "$P_CLI dtls=1" \ |
| 6977 | 0 \ |
| 6978 | -s "Verifying peer X.509 certificate... ok" |
| 6979 | |
| 6980 | run_test "DTLS client auth: optional, client has no cert" \ |
| 6981 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 6982 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 6983 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6984 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6985 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6986 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6987 | "$P_SRV dtls=1 auth_mode=none" \ |
| 6988 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 6989 | 0 \ |
| 6990 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6991 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6992 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 6993 | run_test "DTLS wrong PSK: badmac alert" \ |
| 6994 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 6995 | "$P_CLI dtls=1 psk=abc124" \ |
| 6996 | 1 \ |
| 6997 | -s "SSL - Verification of the message MAC failed" \ |
| 6998 | -c "SSL - A fatal alert message was received from our peer" |
| 6999 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7000 | # Tests for receiving fragmented handshake messages with DTLS |
| 7001 | |
| 7002 | requires_gnutls |
| 7003 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 7004 | "$G_SRV -u --mtu 2048 -a" \ |
| 7005 | "$P_CLI dtls=1 debug_level=2" \ |
| 7006 | 0 \ |
| 7007 | -C "found fragmented DTLS handshake message" \ |
| 7008 | -C "error" |
| 7009 | |
| 7010 | requires_gnutls |
| 7011 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 7012 | "$G_SRV -u --mtu 512" \ |
| 7013 | "$P_CLI dtls=1 debug_level=2" \ |
| 7014 | 0 \ |
| 7015 | -c "found fragmented DTLS handshake message" \ |
| 7016 | -C "error" |
| 7017 | |
| 7018 | requires_gnutls |
| 7019 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 7020 | "$G_SRV -u --mtu 128" \ |
| 7021 | "$P_CLI dtls=1 debug_level=2" \ |
| 7022 | 0 \ |
| 7023 | -c "found fragmented DTLS handshake message" \ |
| 7024 | -C "error" |
| 7025 | |
| 7026 | requires_gnutls |
| 7027 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 7028 | "$G_SRV -u --mtu 128" \ |
| 7029 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7030 | 0 \ |
| 7031 | -c "found fragmented DTLS handshake message" \ |
| 7032 | -C "error" |
| 7033 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7034 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7035 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7036 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 7037 | "$G_SRV -u --mtu 256" \ |
| 7038 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 7039 | 0 \ |
| 7040 | -c "found fragmented DTLS handshake message" \ |
| 7041 | -c "client hello, adding renegotiation extension" \ |
| 7042 | -c "found renegotiation extension" \ |
| 7043 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7044 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7045 | -C "error" \ |
| 7046 | -s "Extra-header:" |
| 7047 | |
| 7048 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7049 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7050 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 7051 | "$G_SRV -u --mtu 256" \ |
| 7052 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 7053 | 0 \ |
| 7054 | -c "found fragmented DTLS handshake message" \ |
| 7055 | -c "client hello, adding renegotiation extension" \ |
| 7056 | -c "found renegotiation extension" \ |
| 7057 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7058 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7059 | -C "error" \ |
| 7060 | -s "Extra-header:" |
| 7061 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 7062 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 7063 | "$O_SRV -dtls -mtu 2048" \ |
| 7064 | "$P_CLI dtls=1 debug_level=2" \ |
| 7065 | 0 \ |
| 7066 | -C "found fragmented DTLS handshake message" \ |
| 7067 | -C "error" |
| 7068 | |
| 7069 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 7070 | "$O_SRV -dtls -mtu 768" \ |
| 7071 | "$P_CLI dtls=1 debug_level=2" \ |
| 7072 | 0 \ |
| 7073 | -c "found fragmented DTLS handshake message" \ |
| 7074 | -C "error" |
| 7075 | |
| 7076 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 7077 | "$O_SRV -dtls -mtu 256" \ |
| 7078 | "$P_CLI dtls=1 debug_level=2" \ |
| 7079 | 0 \ |
| 7080 | -c "found fragmented DTLS handshake message" \ |
| 7081 | -C "error" |
| 7082 | |
| 7083 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 7084 | "$O_SRV -dtls -mtu 256" \ |
| 7085 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7086 | 0 \ |
| 7087 | -c "found fragmented DTLS handshake message" \ |
| 7088 | -C "error" |
| 7089 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7090 | # Tests for sending fragmented handshake messages with DTLS |
| 7091 | # |
| 7092 | # Use client auth when we need the client to send large messages, |
| 7093 | # and use large cert chains on both sides too (the long chains we have all use |
| 7094 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 7095 | # Sizes reached (UDP payload): |
| 7096 | # - 2037B for server certificate |
| 7097 | # - 1542B for client certificate |
| 7098 | # - 1013B for newsessionticket |
| 7099 | # - all others below 512B |
| 7100 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 7101 | |
| 7102 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7103 | requires_config_enabled MBEDTLS_RSA_C |
| 7104 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7105 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7106 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7107 | run_test "DTLS fragmenting: none (for reference)" \ |
| 7108 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7109 | crt_file=data_files/server7_int-ca.crt \ |
| 7110 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7111 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7112 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7113 | "$P_CLI dtls=1 debug_level=2 \ |
| 7114 | crt_file=data_files/server8_int-ca2.crt \ |
| 7115 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7116 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7117 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7118 | 0 \ |
| 7119 | -S "found fragmented DTLS handshake message" \ |
| 7120 | -C "found fragmented DTLS handshake message" \ |
| 7121 | -C "error" |
| 7122 | |
| 7123 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7124 | requires_config_enabled MBEDTLS_RSA_C |
| 7125 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7126 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7127 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7128 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7129 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7130 | crt_file=data_files/server7_int-ca.crt \ |
| 7131 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7132 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7133 | max_frag_len=1024" \ |
| 7134 | "$P_CLI dtls=1 debug_level=2 \ |
| 7135 | crt_file=data_files/server8_int-ca2.crt \ |
| 7136 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7137 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7138 | max_frag_len=2048" \ |
| 7139 | 0 \ |
| 7140 | -S "found fragmented DTLS handshake message" \ |
| 7141 | -c "found fragmented DTLS handshake message" \ |
| 7142 | -C "error" |
| 7143 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7144 | # With the MFL extension, the server has no way of forcing |
| 7145 | # the client to not exceed a certain MTU; hence, the following |
| 7146 | # test can't be replicated with an MTU proxy such as the one |
| 7147 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7148 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7149 | requires_config_enabled MBEDTLS_RSA_C |
| 7150 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7151 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7152 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7153 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7154 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7155 | crt_file=data_files/server7_int-ca.crt \ |
| 7156 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7157 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7158 | max_frag_len=512" \ |
| 7159 | "$P_CLI dtls=1 debug_level=2 \ |
| 7160 | crt_file=data_files/server8_int-ca2.crt \ |
| 7161 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7162 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7163 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7164 | 0 \ |
| 7165 | -S "found fragmented DTLS handshake message" \ |
| 7166 | -c "found fragmented DTLS handshake message" \ |
| 7167 | -C "error" |
| 7168 | |
| 7169 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7170 | requires_config_enabled MBEDTLS_RSA_C |
| 7171 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7172 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7173 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7174 | 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] | 7175 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 7176 | crt_file=data_files/server7_int-ca.crt \ |
| 7177 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7178 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7179 | max_frag_len=2048" \ |
| 7180 | "$P_CLI dtls=1 debug_level=2 \ |
| 7181 | crt_file=data_files/server8_int-ca2.crt \ |
| 7182 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7183 | hs_timeout=2500-60000 \ |
| 7184 | max_frag_len=1024" \ |
| 7185 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7186 | -S "found fragmented DTLS handshake message" \ |
| 7187 | -c "found fragmented DTLS handshake message" \ |
| 7188 | -C "error" |
| 7189 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7190 | # While not required by the standard defining the MFL extension |
| 7191 | # (according to which it only applies to records, not to datagrams), |
| 7192 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7193 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7194 | # to the peer. |
| 7195 | # The next test checks that no datagrams significantly larger than the |
| 7196 | # negotiated MFL are sent. |
| 7197 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7198 | requires_config_enabled MBEDTLS_RSA_C |
| 7199 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7200 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7201 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7202 | 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] | 7203 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7204 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 7205 | crt_file=data_files/server7_int-ca.crt \ |
| 7206 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7207 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7208 | max_frag_len=2048" \ |
| 7209 | "$P_CLI dtls=1 debug_level=2 \ |
| 7210 | crt_file=data_files/server8_int-ca2.crt \ |
| 7211 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7212 | hs_timeout=2500-60000 \ |
| 7213 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7214 | 0 \ |
| 7215 | -S "found fragmented DTLS handshake message" \ |
| 7216 | -c "found fragmented DTLS handshake message" \ |
| 7217 | -C "error" |
| 7218 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7219 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7220 | requires_config_enabled MBEDTLS_RSA_C |
| 7221 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7222 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7223 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7224 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7225 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7226 | crt_file=data_files/server7_int-ca.crt \ |
| 7227 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7228 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7229 | max_frag_len=2048" \ |
| 7230 | "$P_CLI dtls=1 debug_level=2 \ |
| 7231 | crt_file=data_files/server8_int-ca2.crt \ |
| 7232 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7233 | hs_timeout=2500-60000 \ |
| 7234 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7235 | 0 \ |
| 7236 | -s "found fragmented DTLS handshake message" \ |
| 7237 | -c "found fragmented DTLS handshake message" \ |
| 7238 | -C "error" |
| 7239 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7240 | # While not required by the standard defining the MFL extension |
| 7241 | # (according to which it only applies to records, not to datagrams), |
| 7242 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7243 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7244 | # to the peer. |
| 7245 | # The next test checks that no datagrams significantly larger than the |
| 7246 | # negotiated MFL are sent. |
| 7247 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7248 | requires_config_enabled MBEDTLS_RSA_C |
| 7249 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7250 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7251 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7252 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 7253 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7254 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7255 | crt_file=data_files/server7_int-ca.crt \ |
| 7256 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7257 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7258 | max_frag_len=2048" \ |
| 7259 | "$P_CLI dtls=1 debug_level=2 \ |
| 7260 | crt_file=data_files/server8_int-ca2.crt \ |
| 7261 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7262 | hs_timeout=2500-60000 \ |
| 7263 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7264 | 0 \ |
| 7265 | -s "found fragmented DTLS handshake message" \ |
| 7266 | -c "found fragmented DTLS handshake message" \ |
| 7267 | -C "error" |
| 7268 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7269 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7270 | requires_config_enabled MBEDTLS_RSA_C |
| 7271 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7272 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7273 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 7274 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7275 | crt_file=data_files/server7_int-ca.crt \ |
| 7276 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7277 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7278 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7279 | "$P_CLI dtls=1 debug_level=2 \ |
| 7280 | crt_file=data_files/server8_int-ca2.crt \ |
| 7281 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7282 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7283 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7284 | 0 \ |
| 7285 | -S "found fragmented DTLS handshake message" \ |
| 7286 | -C "found fragmented DTLS handshake message" \ |
| 7287 | -C "error" |
| 7288 | |
| 7289 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7290 | requires_config_enabled MBEDTLS_RSA_C |
| 7291 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7292 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7293 | run_test "DTLS fragmenting: client (MTU)" \ |
| 7294 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7295 | crt_file=data_files/server7_int-ca.crt \ |
| 7296 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7297 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7298 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7299 | "$P_CLI dtls=1 debug_level=2 \ |
| 7300 | crt_file=data_files/server8_int-ca2.crt \ |
| 7301 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7302 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7303 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7304 | 0 \ |
| 7305 | -s "found fragmented DTLS handshake message" \ |
| 7306 | -C "found fragmented DTLS handshake message" \ |
| 7307 | -C "error" |
| 7308 | |
| 7309 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7310 | requires_config_enabled MBEDTLS_RSA_C |
| 7311 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7312 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7313 | run_test "DTLS fragmenting: server (MTU)" \ |
| 7314 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7315 | crt_file=data_files/server7_int-ca.crt \ |
| 7316 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7317 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7318 | mtu=512" \ |
| 7319 | "$P_CLI dtls=1 debug_level=2 \ |
| 7320 | crt_file=data_files/server8_int-ca2.crt \ |
| 7321 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7322 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7323 | mtu=2048" \ |
| 7324 | 0 \ |
| 7325 | -S "found fragmented DTLS handshake message" \ |
| 7326 | -c "found fragmented DTLS handshake message" \ |
| 7327 | -C "error" |
| 7328 | |
| 7329 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7330 | requires_config_enabled MBEDTLS_RSA_C |
| 7331 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7332 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7333 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7334 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7335 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7336 | crt_file=data_files/server7_int-ca.crt \ |
| 7337 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7338 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 7339 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7340 | "$P_CLI dtls=1 debug_level=2 \ |
| 7341 | crt_file=data_files/server8_int-ca2.crt \ |
| 7342 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7343 | hs_timeout=2500-60000 \ |
| 7344 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7345 | 0 \ |
| 7346 | -s "found fragmented DTLS handshake message" \ |
| 7347 | -c "found fragmented DTLS handshake message" \ |
| 7348 | -C "error" |
| 7349 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7350 | # 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] | 7351 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7352 | requires_config_enabled MBEDTLS_RSA_C |
| 7353 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7354 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7355 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7356 | requires_config_enabled MBEDTLS_AES_C |
| 7357 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7358 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7359 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 7360 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7361 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7362 | crt_file=data_files/server7_int-ca.crt \ |
| 7363 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7364 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7365 | mtu=512" \ |
| 7366 | "$P_CLI dtls=1 debug_level=2 \ |
| 7367 | crt_file=data_files/server8_int-ca2.crt \ |
| 7368 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7369 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7370 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7371 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7372 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7373 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7374 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7375 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7376 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7377 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7378 | # 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] | 7379 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 7380 | # retransmissions, but in some cases (like both the server and client using |
| 7381 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 7382 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 7383 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7384 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7385 | requires_config_enabled MBEDTLS_RSA_C |
| 7386 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7387 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7388 | requires_config_enabled MBEDTLS_AES_C |
| 7389 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7390 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7391 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7392 | -p "$P_PXY mtu=508" \ |
| 7393 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7394 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7395 | key_file=data_files/server7.key \ |
| 7396 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7397 | "$P_CLI dtls=1 debug_level=2 \ |
| 7398 | crt_file=data_files/server8_int-ca2.crt \ |
| 7399 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7400 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7401 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7402 | 0 \ |
| 7403 | -s "found fragmented DTLS handshake message" \ |
| 7404 | -c "found fragmented DTLS handshake message" \ |
| 7405 | -C "error" |
| 7406 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7407 | # 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] | 7408 | only_with_valgrind |
| 7409 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7410 | requires_config_enabled MBEDTLS_RSA_C |
| 7411 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7412 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7413 | requires_config_enabled MBEDTLS_AES_C |
| 7414 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7415 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7416 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7417 | -p "$P_PXY mtu=508" \ |
| 7418 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7419 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7420 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7421 | hs_timeout=250-10000" \ |
| 7422 | "$P_CLI dtls=1 debug_level=2 \ |
| 7423 | crt_file=data_files/server8_int-ca2.crt \ |
| 7424 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7425 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7426 | hs_timeout=250-10000" \ |
| 7427 | 0 \ |
| 7428 | -s "found fragmented DTLS handshake message" \ |
| 7429 | -c "found fragmented DTLS handshake message" \ |
| 7430 | -C "error" |
| 7431 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7432 | # 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] | 7433 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7434 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7435 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7436 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7437 | requires_config_enabled MBEDTLS_RSA_C |
| 7438 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7439 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7440 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7441 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7442 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7443 | crt_file=data_files/server7_int-ca.crt \ |
| 7444 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7445 | hs_timeout=10000-60000 \ |
| 7446 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7447 | "$P_CLI dtls=1 debug_level=2 \ |
| 7448 | crt_file=data_files/server8_int-ca2.crt \ |
| 7449 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7450 | hs_timeout=10000-60000 \ |
| 7451 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7452 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7453 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7454 | -s "found fragmented DTLS handshake message" \ |
| 7455 | -c "found fragmented DTLS handshake message" \ |
| 7456 | -C "error" |
| 7457 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7458 | # 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] | 7459 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 7460 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7461 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7462 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7463 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7464 | requires_config_enabled MBEDTLS_RSA_C |
| 7465 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7466 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7467 | requires_config_enabled MBEDTLS_AES_C |
| 7468 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7469 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7470 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7471 | -p "$P_PXY mtu=512" \ |
| 7472 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7473 | crt_file=data_files/server7_int-ca.crt \ |
| 7474 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7475 | hs_timeout=10000-60000 \ |
| 7476 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7477 | "$P_CLI dtls=1 debug_level=2 \ |
| 7478 | crt_file=data_files/server8_int-ca2.crt \ |
| 7479 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7480 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7481 | hs_timeout=10000-60000 \ |
| 7482 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7483 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7484 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7485 | -s "found fragmented DTLS handshake message" \ |
| 7486 | -c "found fragmented DTLS handshake message" \ |
| 7487 | -C "error" |
| 7488 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7489 | not_with_valgrind # spurious autoreduction due to timeout |
| 7490 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7491 | requires_config_enabled MBEDTLS_RSA_C |
| 7492 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7493 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7494 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7495 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7496 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7497 | crt_file=data_files/server7_int-ca.crt \ |
| 7498 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7499 | hs_timeout=10000-60000 \ |
| 7500 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7501 | "$P_CLI dtls=1 debug_level=2 \ |
| 7502 | crt_file=data_files/server8_int-ca2.crt \ |
| 7503 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7504 | hs_timeout=10000-60000 \ |
| 7505 | mtu=1024 nbio=2" \ |
| 7506 | 0 \ |
| 7507 | -S "autoreduction" \ |
| 7508 | -s "found fragmented DTLS handshake message" \ |
| 7509 | -c "found fragmented DTLS handshake message" \ |
| 7510 | -C "error" |
| 7511 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7512 | # 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] | 7513 | not_with_valgrind # spurious autoreduction due to timeout |
| 7514 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7515 | requires_config_enabled MBEDTLS_RSA_C |
| 7516 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7517 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7518 | requires_config_enabled MBEDTLS_AES_C |
| 7519 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7520 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7521 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 7522 | -p "$P_PXY mtu=512" \ |
| 7523 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7524 | crt_file=data_files/server7_int-ca.crt \ |
| 7525 | key_file=data_files/server7.key \ |
| 7526 | hs_timeout=10000-60000 \ |
| 7527 | mtu=512 nbio=2" \ |
| 7528 | "$P_CLI dtls=1 debug_level=2 \ |
| 7529 | crt_file=data_files/server8_int-ca2.crt \ |
| 7530 | key_file=data_files/server8.key \ |
| 7531 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7532 | hs_timeout=10000-60000 \ |
| 7533 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7534 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7535 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7536 | -s "found fragmented DTLS handshake message" \ |
| 7537 | -c "found fragmented DTLS handshake message" \ |
| 7538 | -C "error" |
| 7539 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7540 | # 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] | 7541 | # This ensures things still work after session_reset(). |
| 7542 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7543 | # Since we don't support reading fragmented ClientHello yet, |
| 7544 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 7545 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7546 | # An autoreduction on the client-side might happen if the server is |
| 7547 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 7548 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7549 | # resumed listening, which would result in a spurious autoreduction. |
| 7550 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7551 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7552 | requires_config_enabled MBEDTLS_RSA_C |
| 7553 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7554 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7555 | requires_config_enabled MBEDTLS_AES_C |
| 7556 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7557 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7558 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 7559 | -p "$P_PXY mtu=1450" \ |
| 7560 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7561 | crt_file=data_files/server7_int-ca.crt \ |
| 7562 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7563 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7564 | mtu=1450" \ |
| 7565 | "$P_CLI dtls=1 debug_level=2 \ |
| 7566 | crt_file=data_files/server8_int-ca2.crt \ |
| 7567 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7568 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7569 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 7570 | 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] | 7571 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7572 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7573 | -s "found fragmented DTLS handshake message" \ |
| 7574 | -c "found fragmented DTLS handshake message" \ |
| 7575 | -C "error" |
| 7576 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7577 | # An autoreduction on the client-side might happen if the server is |
| 7578 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7579 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7580 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7581 | requires_config_enabled MBEDTLS_RSA_C |
| 7582 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7583 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7584 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7585 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7586 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7587 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7588 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 7589 | -p "$P_PXY mtu=512" \ |
| 7590 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7591 | crt_file=data_files/server7_int-ca.crt \ |
| 7592 | key_file=data_files/server7.key \ |
| 7593 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7594 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7595 | mtu=512" \ |
| 7596 | "$P_CLI dtls=1 debug_level=2 \ |
| 7597 | crt_file=data_files/server8_int-ca2.crt \ |
| 7598 | key_file=data_files/server8.key \ |
| 7599 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7600 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7601 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7602 | mtu=512" \ |
| 7603 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7604 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7605 | -s "found fragmented DTLS handshake message" \ |
| 7606 | -c "found fragmented DTLS handshake message" \ |
| 7607 | -C "error" |
| 7608 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7609 | # An autoreduction on the client-side might happen if the server is |
| 7610 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7611 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7612 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7613 | requires_config_enabled MBEDTLS_RSA_C |
| 7614 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7615 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7616 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7617 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7618 | requires_config_enabled MBEDTLS_AES_C |
| 7619 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7620 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7621 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 7622 | -p "$P_PXY mtu=512" \ |
| 7623 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7624 | crt_file=data_files/server7_int-ca.crt \ |
| 7625 | key_file=data_files/server7.key \ |
| 7626 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7627 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7628 | mtu=512" \ |
| 7629 | "$P_CLI dtls=1 debug_level=2 \ |
| 7630 | crt_file=data_files/server8_int-ca2.crt \ |
| 7631 | key_file=data_files/server8.key \ |
| 7632 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7633 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7634 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7635 | mtu=512" \ |
| 7636 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7637 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7638 | -s "found fragmented DTLS handshake message" \ |
| 7639 | -c "found fragmented DTLS handshake message" \ |
| 7640 | -C "error" |
| 7641 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7642 | # An autoreduction on the client-side might happen if the server is |
| 7643 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7644 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7645 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7646 | requires_config_enabled MBEDTLS_RSA_C |
| 7647 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7648 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7649 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7650 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7651 | requires_config_enabled MBEDTLS_AES_C |
| 7652 | requires_config_enabled MBEDTLS_CCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7653 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7654 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7655 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7656 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7657 | crt_file=data_files/server7_int-ca.crt \ |
| 7658 | key_file=data_files/server7.key \ |
| 7659 | exchanges=2 renegotiation=1 \ |
| 7660 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7661 | hs_timeout=10000-60000 \ |
| 7662 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7663 | "$P_CLI dtls=1 debug_level=2 \ |
| 7664 | crt_file=data_files/server8_int-ca2.crt \ |
| 7665 | key_file=data_files/server8.key \ |
| 7666 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7667 | hs_timeout=10000-60000 \ |
| 7668 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7669 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7670 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7671 | -s "found fragmented DTLS handshake message" \ |
| 7672 | -c "found fragmented DTLS handshake message" \ |
| 7673 | -C "error" |
| 7674 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7675 | # An autoreduction on the client-side might happen if the server is |
| 7676 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7677 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7678 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7679 | requires_config_enabled MBEDTLS_RSA_C |
| 7680 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7681 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7682 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7683 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7684 | requires_config_enabled MBEDTLS_AES_C |
| 7685 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7686 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7687 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7688 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7689 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7690 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7691 | crt_file=data_files/server7_int-ca.crt \ |
| 7692 | key_file=data_files/server7.key \ |
| 7693 | exchanges=2 renegotiation=1 \ |
| 7694 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7695 | hs_timeout=10000-60000 \ |
| 7696 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7697 | "$P_CLI dtls=1 debug_level=2 \ |
| 7698 | crt_file=data_files/server8_int-ca2.crt \ |
| 7699 | key_file=data_files/server8.key \ |
| 7700 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7701 | hs_timeout=10000-60000 \ |
| 7702 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7703 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7704 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7705 | -s "found fragmented DTLS handshake message" \ |
| 7706 | -c "found fragmented DTLS handshake message" \ |
| 7707 | -C "error" |
| 7708 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7709 | # An autoreduction on the client-side might happen if the server is |
| 7710 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7711 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7712 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7713 | requires_config_enabled MBEDTLS_RSA_C |
| 7714 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7715 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7716 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7717 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7718 | requires_config_enabled MBEDTLS_AES_C |
| 7719 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7720 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7721 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7722 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7723 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7724 | crt_file=data_files/server7_int-ca.crt \ |
| 7725 | key_file=data_files/server7.key \ |
| 7726 | exchanges=2 renegotiation=1 \ |
| 7727 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7728 | hs_timeout=10000-60000 \ |
| 7729 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7730 | "$P_CLI dtls=1 debug_level=2 \ |
| 7731 | crt_file=data_files/server8_int-ca2.crt \ |
| 7732 | key_file=data_files/server8.key \ |
| 7733 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7734 | hs_timeout=10000-60000 \ |
| 7735 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7736 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7737 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7738 | -s "found fragmented DTLS handshake message" \ |
| 7739 | -c "found fragmented DTLS handshake message" \ |
| 7740 | -C "error" |
| 7741 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7742 | # 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] | 7743 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7744 | requires_config_enabled MBEDTLS_RSA_C |
| 7745 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7746 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7747 | requires_config_enabled MBEDTLS_AES_C |
| 7748 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7749 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7750 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7751 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 7752 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7753 | "$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] | 7754 | crt_file=data_files/server7_int-ca.crt \ |
| 7755 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7756 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7757 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7758 | crt_file=data_files/server8_int-ca2.crt \ |
| 7759 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7760 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7761 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7762 | 0 \ |
| 7763 | -s "found fragmented DTLS handshake message" \ |
| 7764 | -c "found fragmented DTLS handshake message" \ |
| 7765 | -C "error" |
| 7766 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7767 | # 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] | 7768 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7769 | requires_config_enabled MBEDTLS_RSA_C |
| 7770 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7771 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7772 | requires_config_enabled MBEDTLS_AES_C |
| 7773 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7774 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7775 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7776 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 7777 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 7778 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7779 | crt_file=data_files/server7_int-ca.crt \ |
| 7780 | key_file=data_files/server7.key \ |
| 7781 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7782 | "$P_CLI dtls=1 debug_level=2 \ |
| 7783 | crt_file=data_files/server8_int-ca2.crt \ |
| 7784 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7785 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7786 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7787 | 0 \ |
| 7788 | -s "found fragmented DTLS handshake message" \ |
| 7789 | -c "found fragmented DTLS handshake message" \ |
| 7790 | -C "error" |
| 7791 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7792 | # interop tests for DTLS fragmentating with reliable connection |
| 7793 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7794 | # here and below we just want to test that the we fragment in a way that |
| 7795 | # pleases other implementations, so we don't need the peer to fragment |
| 7796 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7797 | requires_config_enabled MBEDTLS_RSA_C |
| 7798 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7799 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7800 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7801 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7802 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 7803 | "$G_SRV -u" \ |
| 7804 | "$P_CLI dtls=1 debug_level=2 \ |
| 7805 | crt_file=data_files/server8_int-ca2.crt \ |
| 7806 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7807 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7808 | 0 \ |
| 7809 | -c "fragmenting handshake message" \ |
| 7810 | -C "error" |
| 7811 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 7812 | # We use --insecure for the GnuTLS client because it expects |
| 7813 | # the hostname / IP it connects to to be the name used in the |
| 7814 | # certificate obtained from the server. Here, however, it |
| 7815 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 7816 | # as the server name in the certificate. This will make the |
| 7817 | # certifiate validation fail, but passing --insecure makes |
| 7818 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7819 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7820 | requires_config_enabled MBEDTLS_RSA_C |
| 7821 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7822 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7823 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 7824 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7825 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7826 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7827 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7828 | crt_file=data_files/server7_int-ca.crt \ |
| 7829 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7830 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7831 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7832 | 0 \ |
| 7833 | -s "fragmenting handshake message" |
| 7834 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7835 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7836 | requires_config_enabled MBEDTLS_RSA_C |
| 7837 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7838 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7839 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7840 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 7841 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7842 | "$P_CLI dtls=1 debug_level=2 \ |
| 7843 | crt_file=data_files/server8_int-ca2.crt \ |
| 7844 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7845 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7846 | 0 \ |
| 7847 | -c "fragmenting handshake message" \ |
| 7848 | -C "error" |
| 7849 | |
| 7850 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7851 | requires_config_enabled MBEDTLS_RSA_C |
| 7852 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7853 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7854 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7855 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 7856 | "$P_SRV dtls=1 debug_level=2 \ |
| 7857 | crt_file=data_files/server7_int-ca.crt \ |
| 7858 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7859 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7860 | "$O_CLI -dtls1_2" \ |
| 7861 | 0 \ |
| 7862 | -s "fragmenting handshake message" |
| 7863 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7864 | # interop tests for DTLS fragmentating with unreliable connection |
| 7865 | # |
| 7866 | # again we just want to test that the we fragment in a way that |
| 7867 | # pleases other implementations, so we don't need the peer to fragment |
| 7868 | requires_gnutls_next |
| 7869 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7870 | requires_config_enabled MBEDTLS_RSA_C |
| 7871 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7872 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7873 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7874 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7875 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 7876 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7877 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7878 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7879 | crt_file=data_files/server8_int-ca2.crt \ |
| 7880 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7881 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7882 | 0 \ |
| 7883 | -c "fragmenting handshake message" \ |
| 7884 | -C "error" |
| 7885 | |
| 7886 | requires_gnutls_next |
| 7887 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7888 | requires_config_enabled MBEDTLS_RSA_C |
| 7889 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7890 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7891 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7892 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7893 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 7894 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7895 | "$P_SRV dtls=1 debug_level=2 \ |
| 7896 | crt_file=data_files/server7_int-ca.crt \ |
| 7897 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7898 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 7899 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7900 | 0 \ |
| 7901 | -s "fragmenting handshake message" |
| 7902 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7903 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 7904 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7905 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7906 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 7907 | ## (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] | 7908 | skip_next_test |
| 7909 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7910 | requires_config_enabled MBEDTLS_RSA_C |
| 7911 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7912 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7913 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7914 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7915 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 7916 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7917 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7918 | "$P_CLI dtls=1 debug_level=2 \ |
| 7919 | crt_file=data_files/server8_int-ca2.crt \ |
| 7920 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7921 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7922 | 0 \ |
| 7923 | -c "fragmenting handshake message" \ |
| 7924 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7925 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7926 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7927 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7928 | requires_config_enabled MBEDTLS_RSA_C |
| 7929 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7930 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7931 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7932 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7933 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 7934 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7935 | "$P_SRV dtls=1 debug_level=2 \ |
| 7936 | crt_file=data_files/server7_int-ca.crt \ |
| 7937 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7938 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7939 | "$O_CLI -dtls1_2" \ |
| 7940 | 0 \ |
| 7941 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7942 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7943 | # Tests for DTLS-SRTP (RFC 5764) |
| 7944 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7945 | run_test "DTLS-SRTP all profiles supported" \ |
| 7946 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7947 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7948 | 0 \ |
| 7949 | -s "found use_srtp extension" \ |
| 7950 | -s "found srtp profile" \ |
| 7951 | -s "selected srtp profile" \ |
| 7952 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7953 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7954 | -c "client hello, adding use_srtp extension" \ |
| 7955 | -c "found use_srtp extension" \ |
| 7956 | -c "found srtp profile" \ |
| 7957 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7958 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7959 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7960 | -C "error" |
| 7961 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7962 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7963 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7964 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 7965 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7966 | "$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] | 7967 | 0 \ |
| 7968 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7969 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 7970 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7971 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7972 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7973 | -c "client hello, adding use_srtp extension" \ |
| 7974 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7975 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7976 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7977 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7978 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7979 | -C "error" |
| 7980 | |
| 7981 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7982 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7983 | "$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] | 7984 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7985 | 0 \ |
| 7986 | -s "found use_srtp extension" \ |
| 7987 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7988 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7989 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7990 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7991 | -c "client hello, adding use_srtp extension" \ |
| 7992 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7993 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7994 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7995 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7996 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7997 | -C "error" |
| 7998 | |
| 7999 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8000 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 8001 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8002 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8003 | 0 \ |
| 8004 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8005 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8006 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8007 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8008 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8009 | -c "client hello, adding use_srtp extension" \ |
| 8010 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8011 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8012 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8013 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8014 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8015 | -C "error" |
| 8016 | |
| 8017 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8018 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 8019 | "$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] | 8020 | "$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] | 8021 | 0 \ |
| 8022 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8023 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8024 | -S "selected srtp profile" \ |
| 8025 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8026 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8027 | -c "client hello, adding use_srtp extension" \ |
| 8028 | -C "found use_srtp extension" \ |
| 8029 | -C "found srtp profile" \ |
| 8030 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8031 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8032 | -C "error" |
| 8033 | |
| 8034 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8035 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 8036 | "$P_SRV dtls=1 debug_level=3" \ |
| 8037 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8038 | 0 \ |
| 8039 | -s "found use_srtp extension" \ |
| 8040 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8041 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8042 | -c "client hello, adding use_srtp extension" \ |
| 8043 | -C "found use_srtp extension" \ |
| 8044 | -C "found srtp profile" \ |
| 8045 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8046 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8047 | -C "error" |
| 8048 | |
| 8049 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8050 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 8051 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 8052 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8053 | 0 \ |
| 8054 | -s "found use_srtp extension" \ |
| 8055 | -s "found srtp profile" \ |
| 8056 | -s "selected srtp profile" \ |
| 8057 | -s "server hello, adding use_srtp extension" \ |
| 8058 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8059 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8060 | -c "client hello, adding use_srtp extension" \ |
| 8061 | -c "found use_srtp extension" \ |
| 8062 | -c "found srtp profile" \ |
| 8063 | -c "selected srtp profile" \ |
| 8064 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8065 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8066 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8067 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 8068 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8069 | -C "error" |
| 8070 | |
| 8071 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8072 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 8073 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8074 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8075 | 0 \ |
| 8076 | -s "found use_srtp extension" \ |
| 8077 | -s "found srtp profile" \ |
| 8078 | -s "selected srtp profile" \ |
| 8079 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8080 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 8081 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8082 | -S "dumping 'using mki' (8 bytes)" \ |
| 8083 | -c "client hello, adding use_srtp extension" \ |
| 8084 | -c "found use_srtp extension" \ |
| 8085 | -c "found srtp profile" \ |
| 8086 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8087 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 8088 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8089 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8090 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8091 | -C "dumping 'received mki' (8 bytes)" \ |
| 8092 | -C "error" |
| 8093 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8094 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8095 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 8096 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8097 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8098 | 0 \ |
| 8099 | -s "found use_srtp extension" \ |
| 8100 | -s "found srtp profile" \ |
| 8101 | -s "selected srtp profile" \ |
| 8102 | -s "server hello, adding use_srtp extension" \ |
| 8103 | -s "DTLS-SRTP key material is"\ |
| 8104 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 8105 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 8106 | |
| 8107 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8108 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 8109 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8110 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8111 | 0 \ |
| 8112 | -s "found use_srtp extension" \ |
| 8113 | -s "found srtp profile" \ |
| 8114 | -s "selected srtp profile" \ |
| 8115 | -s "server hello, adding use_srtp extension" \ |
| 8116 | -s "DTLS-SRTP key material is"\ |
| 8117 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 8118 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8119 | |
| 8120 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8121 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 8122 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8123 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8124 | 0 \ |
| 8125 | -s "found use_srtp extension" \ |
| 8126 | -s "found srtp profile" \ |
| 8127 | -s "selected srtp profile" \ |
| 8128 | -s "server hello, adding use_srtp extension" \ |
| 8129 | -s "DTLS-SRTP key material is"\ |
| 8130 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 8131 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8132 | |
| 8133 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8134 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 8135 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8136 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8137 | 0 \ |
| 8138 | -s "found use_srtp extension" \ |
| 8139 | -s "found srtp profile" \ |
| 8140 | -s "selected srtp profile" \ |
| 8141 | -s "server hello, adding use_srtp extension" \ |
| 8142 | -s "DTLS-SRTP key material is"\ |
| 8143 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 8144 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8145 | |
| 8146 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8147 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 8148 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8149 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8150 | 0 \ |
| 8151 | -s "found use_srtp extension" \ |
| 8152 | -s "found srtp profile" \ |
| 8153 | -s "selected srtp profile" \ |
| 8154 | -s "server hello, adding use_srtp extension" \ |
| 8155 | -s "DTLS-SRTP key material is"\ |
| 8156 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 8157 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8158 | |
| 8159 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8160 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 8161 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 8162 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8163 | 0 \ |
| 8164 | -s "found use_srtp extension" \ |
| 8165 | -s "found srtp profile" \ |
| 8166 | -S "selected srtp profile" \ |
| 8167 | -S "server hello, adding use_srtp extension" \ |
| 8168 | -S "DTLS-SRTP key material is"\ |
| 8169 | -C "SRTP Extension negotiated, profile" |
| 8170 | |
| 8171 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8172 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 8173 | "$P_SRV dtls=1 debug_level=3" \ |
| 8174 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8175 | 0 \ |
| 8176 | -s "found use_srtp extension" \ |
| 8177 | -S "server hello, adding use_srtp extension" \ |
| 8178 | -S "DTLS-SRTP key material is"\ |
| 8179 | -C "SRTP Extension negotiated, profile" |
| 8180 | |
| 8181 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8182 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 8183 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8184 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8185 | 0 \ |
| 8186 | -c "client hello, adding use_srtp extension" \ |
| 8187 | -c "found use_srtp extension" \ |
| 8188 | -c "found srtp profile" \ |
| 8189 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 8190 | -c "DTLS-SRTP key material is"\ |
| 8191 | -C "error" |
| 8192 | |
| 8193 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8194 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 8195 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8196 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8197 | 0 \ |
| 8198 | -c "client hello, adding use_srtp extension" \ |
| 8199 | -c "found use_srtp extension" \ |
| 8200 | -c "found srtp profile" \ |
| 8201 | -c "selected srtp profile" \ |
| 8202 | -c "DTLS-SRTP key material is"\ |
| 8203 | -C "error" |
| 8204 | |
| 8205 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8206 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 8207 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8208 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8209 | 0 \ |
| 8210 | -c "client hello, adding use_srtp extension" \ |
| 8211 | -c "found use_srtp extension" \ |
| 8212 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8213 | -c "selected srtp profile" \ |
| 8214 | -c "DTLS-SRTP key material is"\ |
| 8215 | -C "error" |
| 8216 | |
| 8217 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8218 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 8219 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8220 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8221 | 0 \ |
| 8222 | -c "client hello, adding use_srtp extension" \ |
| 8223 | -c "found use_srtp extension" \ |
| 8224 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8225 | -c "selected srtp profile" \ |
| 8226 | -c "DTLS-SRTP key material is"\ |
| 8227 | -C "error" |
| 8228 | |
| 8229 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8230 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 8231 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8232 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8233 | 0 \ |
| 8234 | -c "client hello, adding use_srtp extension" \ |
| 8235 | -c "found use_srtp extension" \ |
| 8236 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8237 | -c "selected srtp profile" \ |
| 8238 | -c "DTLS-SRTP key material is"\ |
| 8239 | -C "error" |
| 8240 | |
| 8241 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8242 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 8243 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8244 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 8245 | 0 \ |
| 8246 | -c "client hello, adding use_srtp extension" \ |
| 8247 | -C "found use_srtp extension" \ |
| 8248 | -C "found srtp profile" \ |
| 8249 | -C "selected srtp profile" \ |
| 8250 | -C "DTLS-SRTP key material is"\ |
| 8251 | -C "error" |
| 8252 | |
| 8253 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8254 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 8255 | "$O_SRV -dtls" \ |
| 8256 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8257 | 0 \ |
| 8258 | -c "client hello, adding use_srtp extension" \ |
| 8259 | -C "found use_srtp extension" \ |
| 8260 | -C "found srtp profile" \ |
| 8261 | -C "selected srtp profile" \ |
| 8262 | -C "DTLS-SRTP key material is"\ |
| 8263 | -C "error" |
| 8264 | |
| 8265 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8266 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 8267 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8268 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8269 | 0 \ |
| 8270 | -c "client hello, adding use_srtp extension" \ |
| 8271 | -c "found use_srtp extension" \ |
| 8272 | -c "found srtp profile" \ |
| 8273 | -c "selected srtp profile" \ |
| 8274 | -c "DTLS-SRTP key material is"\ |
| 8275 | -c "DTLS-SRTP no mki value negotiated"\ |
| 8276 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8277 | -C "dumping 'received mki' (8 bytes)" \ |
| 8278 | -C "error" |
| 8279 | |
| 8280 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8281 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8282 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8283 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8284 | "$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] | 8285 | 0 \ |
| 8286 | -s "found use_srtp extension" \ |
| 8287 | -s "found srtp profile" \ |
| 8288 | -s "selected srtp profile" \ |
| 8289 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8290 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8291 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 8292 | |
| 8293 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8294 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8295 | 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] | 8296 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8297 | "$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] | 8298 | 0 \ |
| 8299 | -s "found use_srtp extension" \ |
| 8300 | -s "found srtp profile" \ |
| 8301 | -s "selected srtp profile" \ |
| 8302 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8303 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8304 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 8305 | |
| 8306 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8307 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8308 | 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] | 8309 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8310 | "$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] | 8311 | 0 \ |
| 8312 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8313 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8314 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8315 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8316 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8317 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 8318 | |
| 8319 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8320 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8321 | 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] | 8322 | "$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] | 8323 | "$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] | 8324 | 0 \ |
| 8325 | -s "found use_srtp extension" \ |
| 8326 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8327 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8328 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8329 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8330 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 8331 | |
| 8332 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8333 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8334 | 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] | 8335 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8336 | "$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] | 8337 | 0 \ |
| 8338 | -s "found use_srtp extension" \ |
| 8339 | -s "found srtp profile" \ |
| 8340 | -s "selected srtp profile" \ |
| 8341 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8342 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8343 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 8344 | |
| 8345 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8346 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8347 | 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] | 8348 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 8349 | "$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] | 8350 | 0 \ |
| 8351 | -s "found use_srtp extension" \ |
| 8352 | -s "found srtp profile" \ |
| 8353 | -S "selected srtp profile" \ |
| 8354 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8355 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8356 | -C "SRTP profile:" |
| 8357 | |
| 8358 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8359 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8360 | 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] | 8361 | "$P_SRV dtls=1 debug_level=3" \ |
| 8362 | "$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] | 8363 | 0 \ |
| 8364 | -s "found use_srtp extension" \ |
| 8365 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8366 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8367 | -C "SRTP profile:" |
| 8368 | |
| 8369 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8370 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8371 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 8372 | "$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" \ |
| 8373 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8374 | 0 \ |
| 8375 | -c "client hello, adding use_srtp extension" \ |
| 8376 | -c "found use_srtp extension" \ |
| 8377 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8378 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8379 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8380 | -C "error" |
| 8381 | |
| 8382 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8383 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8384 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 8385 | "$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" \ |
| 8386 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8387 | 0 \ |
| 8388 | -c "client hello, adding use_srtp extension" \ |
| 8389 | -c "found use_srtp extension" \ |
| 8390 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8391 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8392 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8393 | -C "error" |
| 8394 | |
| 8395 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8396 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8397 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 8398 | "$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" \ |
| 8399 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8400 | 0 \ |
| 8401 | -c "client hello, adding use_srtp extension" \ |
| 8402 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8403 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8404 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8405 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8406 | -C "error" |
| 8407 | |
| 8408 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8409 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8410 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 8411 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8412 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8413 | 0 \ |
| 8414 | -c "client hello, adding use_srtp extension" \ |
| 8415 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8416 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8417 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8418 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8419 | -C "error" |
| 8420 | |
| 8421 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8422 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8423 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 8424 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8425 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8426 | 0 \ |
| 8427 | -c "client hello, adding use_srtp extension" \ |
| 8428 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8429 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8430 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8431 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8432 | -C "error" |
| 8433 | |
| 8434 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8435 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8436 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 8437 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8438 | "$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] | 8439 | 0 \ |
| 8440 | -c "client hello, adding use_srtp extension" \ |
| 8441 | -C "found use_srtp extension" \ |
| 8442 | -C "found srtp profile" \ |
| 8443 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8444 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8445 | -C "error" |
| 8446 | |
| 8447 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8448 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8449 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 8450 | "$G_SRV -u" \ |
| 8451 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8452 | 0 \ |
| 8453 | -c "client hello, adding use_srtp extension" \ |
| 8454 | -C "found use_srtp extension" \ |
| 8455 | -C "found srtp profile" \ |
| 8456 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8457 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8458 | -C "error" |
| 8459 | |
| 8460 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8461 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8462 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 8463 | "$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" \ |
| 8464 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8465 | 0 \ |
| 8466 | -c "client hello, adding use_srtp extension" \ |
| 8467 | -c "found use_srtp extension" \ |
| 8468 | -c "found srtp profile" \ |
| 8469 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8470 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 8471 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8472 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8473 | -c "dumping 'received mki' (8 bytes)" \ |
| 8474 | -C "error" |
| 8475 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 8476 | # Tests for specific things with "unreliable" UDP connection |
| 8477 | |
| 8478 | not_with_valgrind # spurious resend due to timeout |
| 8479 | run_test "DTLS proxy: reference" \ |
| 8480 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8481 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 8482 | "$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] | 8483 | 0 \ |
| 8484 | -C "replayed record" \ |
| 8485 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 8486 | -C "Buffer record from epoch" \ |
| 8487 | -S "Buffer record from epoch" \ |
| 8488 | -C "ssl_buffer_message" \ |
| 8489 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8490 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8491 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8492 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8493 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8494 | -c "HTTP/1.0 200 OK" |
| 8495 | |
| 8496 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8497 | run_test "DTLS proxy: duplicate every packet" \ |
| 8498 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8499 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 8500 | "$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] | 8501 | 0 \ |
| 8502 | -c "replayed record" \ |
| 8503 | -s "replayed record" \ |
| 8504 | -c "record from another epoch" \ |
| 8505 | -s "record from another epoch" \ |
| 8506 | -S "resend" \ |
| 8507 | -s "Extra-header:" \ |
| 8508 | -c "HTTP/1.0 200 OK" |
| 8509 | |
| 8510 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 8511 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8512 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 8513 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8514 | 0 \ |
| 8515 | -c "replayed record" \ |
| 8516 | -S "replayed record" \ |
| 8517 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8518 | -s "record from another epoch" \ |
| 8519 | -c "resend" \ |
| 8520 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8521 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8522 | -c "HTTP/1.0 200 OK" |
| 8523 | |
| 8524 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 8525 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8526 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8527 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8528 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8529 | -c "next record in same datagram" \ |
| 8530 | -s "next record in same datagram" |
| 8531 | |
| 8532 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 8533 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8534 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8535 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8536 | 0 \ |
| 8537 | -c "next record in same datagram" \ |
| 8538 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8539 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8540 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 8541 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8542 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 8543 | "$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] | 8544 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8545 | -c "discarding invalid record (mac)" \ |
| 8546 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8547 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8548 | -c "HTTP/1.0 200 OK" \ |
| 8549 | -S "too many records with bad MAC" \ |
| 8550 | -S "Verification of the message MAC failed" |
| 8551 | |
| 8552 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 8553 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8554 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 8555 | "$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] | 8556 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8557 | -C "discarding invalid record (mac)" \ |
| 8558 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8559 | -S "Extra-header:" \ |
| 8560 | -C "HTTP/1.0 200 OK" \ |
| 8561 | -s "too many records with bad MAC" \ |
| 8562 | -s "Verification of the message MAC failed" |
| 8563 | |
| 8564 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 8565 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8566 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 8567 | "$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] | 8568 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8569 | -c "discarding invalid record (mac)" \ |
| 8570 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8571 | -s "Extra-header:" \ |
| 8572 | -c "HTTP/1.0 200 OK" \ |
| 8573 | -S "too many records with bad MAC" \ |
| 8574 | -S "Verification of the message MAC failed" |
| 8575 | |
| 8576 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 8577 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8578 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 8579 | "$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] | 8580 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8581 | -c "discarding invalid record (mac)" \ |
| 8582 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8583 | -s "Extra-header:" \ |
| 8584 | -c "HTTP/1.0 200 OK" \ |
| 8585 | -s "too many records with bad MAC" \ |
| 8586 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8587 | |
| 8588 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 8589 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 8590 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 8591 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8592 | 0 \ |
| 8593 | -c "record from another epoch" \ |
| 8594 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8595 | -s "Extra-header:" \ |
| 8596 | -c "HTTP/1.0 200 OK" |
| 8597 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8598 | # Tests for reordering support with DTLS |
| 8599 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8600 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 8601 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8602 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8603 | hs_timeout=2500-60000" \ |
| 8604 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8605 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8606 | 0 \ |
| 8607 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8608 | -c "Next handshake message has been buffered - load"\ |
| 8609 | -S "Buffering HS message" \ |
| 8610 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8611 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8612 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8613 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8614 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8615 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8616 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 8617 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8618 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8619 | hs_timeout=2500-60000" \ |
| 8620 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8621 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8622 | 0 \ |
| 8623 | -c "Buffering HS message" \ |
| 8624 | -c "found fragmented DTLS handshake message"\ |
| 8625 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 8626 | -c "Next handshake message has been buffered - load"\ |
| 8627 | -S "Buffering HS message" \ |
| 8628 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8629 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8630 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8631 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8632 | -S "Remember CCS message" |
| 8633 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8634 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 8635 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 8636 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 8637 | # while keeping the ServerKeyExchange. |
| 8638 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 8639 | 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] | 8640 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8641 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8642 | hs_timeout=2500-60000" \ |
| 8643 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8644 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8645 | 0 \ |
| 8646 | -c "Buffering HS message" \ |
| 8647 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8648 | -C "attempt to make space by freeing buffered messages" \ |
| 8649 | -S "Buffering HS message" \ |
| 8650 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8651 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8652 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8653 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8654 | -S "Remember CCS message" |
| 8655 | |
| 8656 | # The size constraints ensure that the delayed certificate message can't |
| 8657 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 8658 | # when dropping it first. |
| 8659 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 8660 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 8661 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 8662 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8663 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8664 | hs_timeout=2500-60000" \ |
| 8665 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8666 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8667 | 0 \ |
| 8668 | -c "Buffering HS message" \ |
| 8669 | -c "attempt to make space by freeing buffered future messages" \ |
| 8670 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8671 | -S "Buffering HS message" \ |
| 8672 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8673 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8674 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8675 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8676 | -S "Remember CCS message" |
| 8677 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8678 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 8679 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8680 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 8681 | hs_timeout=2500-60000" \ |
| 8682 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8683 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8684 | 0 \ |
| 8685 | -C "Buffering HS message" \ |
| 8686 | -C "Next handshake message has been buffered - load"\ |
| 8687 | -s "Buffering HS message" \ |
| 8688 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8689 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8690 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8691 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8692 | -S "Remember CCS message" |
| 8693 | |
| 8694 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 8695 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8696 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8697 | hs_timeout=2500-60000" \ |
| 8698 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8699 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8700 | 0 \ |
| 8701 | -C "Buffering HS message" \ |
| 8702 | -C "Next handshake message has been buffered - load"\ |
| 8703 | -S "Buffering HS message" \ |
| 8704 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8705 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8706 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8707 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8708 | -S "Remember CCS message" |
| 8709 | |
| 8710 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 8711 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8712 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8713 | hs_timeout=2500-60000" \ |
| 8714 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8715 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8716 | 0 \ |
| 8717 | -C "Buffering HS message" \ |
| 8718 | -C "Next handshake message has been buffered - load"\ |
| 8719 | -S "Buffering HS message" \ |
| 8720 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8721 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8722 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8723 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8724 | -s "Remember CCS message" |
| 8725 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8726 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8727 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8728 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8729 | hs_timeout=2500-60000" \ |
| 8730 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8731 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 8732 | 0 \ |
| 8733 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8734 | -s "Found buffered record from current epoch - load" \ |
| 8735 | -c "Buffer record from epoch 1" \ |
| 8736 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8737 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8738 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 8739 | # from the server are delayed, so that the encrypted Finished message |
| 8740 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 8741 | # in afterwards, the encrypted Finished message must be freed in order |
| 8742 | # to make space for the NewSessionTicket to be reassembled. |
| 8743 | # This works only in very particular circumstances: |
| 8744 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 8745 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 8746 | # the encrypted Finished message. |
| 8747 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 8748 | # needs to be fragmented. |
| 8749 | # - All messages sent by the server must be small enough to be either sent |
| 8750 | # without fragmentation or be reassembled within the bounds of |
| 8751 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 8752 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 8753 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 8754 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8755 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 8756 | -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] | 8757 | "$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] | 8758 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 8759 | 0 \ |
| 8760 | -s "Buffer record from epoch 1" \ |
| 8761 | -s "Found buffered record from current epoch - load" \ |
| 8762 | -c "Buffer record from epoch 1" \ |
| 8763 | -C "Found buffered record from current epoch - load" \ |
| 8764 | -c "Enough space available after freeing future epoch record" |
| 8765 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 8766 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 8767 | |
| 8768 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8769 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 8770 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8771 | "$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] | 8772 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8773 | "$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] | 8774 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8775 | 0 \ |
| 8776 | -s "Extra-header:" \ |
| 8777 | -c "HTTP/1.0 200 OK" |
| 8778 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8779 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8780 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 8781 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8782 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8783 | "$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] | 8784 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8785 | 0 \ |
| 8786 | -s "Extra-header:" \ |
| 8787 | -c "HTTP/1.0 200 OK" |
| 8788 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8789 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8790 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 8791 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8792 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8793 | "$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] | 8794 | 0 \ |
| 8795 | -s "Extra-header:" \ |
| 8796 | -c "HTTP/1.0 200 OK" |
| 8797 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8798 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8799 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 8800 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8801 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 8802 | "$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] | 8803 | 0 \ |
| 8804 | -s "Extra-header:" \ |
| 8805 | -c "HTTP/1.0 200 OK" |
| 8806 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8807 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8808 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 8809 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8810 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 8811 | "$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] | 8812 | 0 \ |
| 8813 | -s "Extra-header:" \ |
| 8814 | -c "HTTP/1.0 200 OK" |
| 8815 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8816 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8817 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 8818 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8819 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 8820 | "$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] | 8821 | 0 \ |
| 8822 | -s "Extra-header:" \ |
| 8823 | -c "HTTP/1.0 200 OK" |
| 8824 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8825 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8826 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 8827 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8828 | "$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] | 8829 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8830 | "$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] | 8831 | 0 \ |
| 8832 | -s "Extra-header:" \ |
| 8833 | -c "HTTP/1.0 200 OK" |
| 8834 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8835 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 8836 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 8837 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8838 | "$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] | 8839 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8840 | "$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] | 8841 | 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] | 8842 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8843 | 0 \ |
| 8844 | -s "a session has been resumed" \ |
| 8845 | -c "a session has been resumed" \ |
| 8846 | -s "Extra-header:" \ |
| 8847 | -c "HTTP/1.0 200 OK" |
| 8848 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8849 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 8850 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 8851 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8852 | "$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] | 8853 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8854 | "$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] | 8855 | 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] | 8856 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 8857 | 0 \ |
| 8858 | -s "a session has been resumed" \ |
| 8859 | -c "a session has been resumed" \ |
| 8860 | -s "Extra-header:" \ |
| 8861 | -c "HTTP/1.0 200 OK" |
| 8862 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8863 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8864 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8865 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8866 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8867 | "$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] | 8868 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8869 | "$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] | 8870 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8871 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8872 | 0 \ |
| 8873 | -c "=> renegotiate" \ |
| 8874 | -s "=> renegotiate" \ |
| 8875 | -s "Extra-header:" \ |
| 8876 | -c "HTTP/1.0 200 OK" |
| 8877 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8878 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8879 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8880 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 8881 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8882 | "$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] | 8883 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8884 | "$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] | 8885 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8886 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8887 | 0 \ |
| 8888 | -c "=> renegotiate" \ |
| 8889 | -s "=> renegotiate" \ |
| 8890 | -s "Extra-header:" \ |
| 8891 | -c "HTTP/1.0 200 OK" |
| 8892 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8893 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8894 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8895 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 8896 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8897 | "$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] | 8898 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8899 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8900 | "$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] | 8901 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8902 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8903 | 0 \ |
| 8904 | -c "=> renegotiate" \ |
| 8905 | -s "=> renegotiate" \ |
| 8906 | -s "Extra-header:" \ |
| 8907 | -c "HTTP/1.0 200 OK" |
| 8908 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8909 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8910 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8911 | 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] | 8912 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8913 | "$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] | 8914 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8915 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8916 | "$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] | 8917 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8918 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8919 | 0 \ |
| 8920 | -c "=> renegotiate" \ |
| 8921 | -s "=> renegotiate" \ |
| 8922 | -s "Extra-header:" \ |
| 8923 | -c "HTTP/1.0 200 OK" |
| 8924 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8925 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 8926 | ## all versions installed on the CI machines), reported here: |
| 8927 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 8928 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8929 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 8930 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8931 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8932 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8933 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8934 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8935 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8936 | "$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] | 8937 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8938 | -c "HTTP/1.0 200 OK" |
| 8939 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8940 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8941 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8942 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8943 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 8944 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8945 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8946 | "$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] | 8947 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8948 | -c "HTTP/1.0 200 OK" |
| 8949 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8950 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8951 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8952 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8953 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 8954 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8955 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8956 | "$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] | 8957 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8958 | -c "HTTP/1.0 200 OK" |
| 8959 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 8960 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8961 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8962 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8963 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 8964 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 8965 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8966 | "$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] | 8967 | 0 \ |
| 8968 | -s "Extra-header:" \ |
| 8969 | -c "Extra-header:" |
| 8970 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8971 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8972 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8973 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8974 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 8975 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8976 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8977 | "$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] | 8978 | 0 \ |
| 8979 | -s "Extra-header:" \ |
| 8980 | -c "Extra-header:" |
| 8981 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8982 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8983 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8984 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8985 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 8986 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8987 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8988 | "$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] | 8989 | 0 \ |
| 8990 | -s "Extra-header:" \ |
| 8991 | -c "Extra-header:" |
| 8992 | |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8993 | run_test "export keys functionality" \ |
| 8994 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 8995 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 8996 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 8997 | -c "EAP-TLS key material is:"\ |
| 8998 | -s "EAP-TLS key material is:"\ |
| 8999 | -c "EAP-TLS IV is:" \ |
| 9000 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 9001 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 9002 | # openssl feature tests: check if tls1.3 exists. |
| 9003 | requires_openssl_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9004 | run_test "TLS 1.3: Test openssl tls1_3 feature" \ |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 9005 | "$O_NEXT_SRV -tls1_3 -msg" \ |
| 9006 | "$O_NEXT_CLI -tls1_3 -msg" \ |
| 9007 | 0 \ |
| 9008 | -c "TLS 1.3" \ |
| 9009 | -s "TLS 1.3" |
| 9010 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 9011 | # 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] | 9012 | requires_gnutls_tls1_3 |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 9013 | requires_gnutls_next_no_ticket |
| 9014 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9015 | run_test "TLS 1.3: Test gnutls tls1_3 feature" \ |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 9016 | "$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] | 9017 | "$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] | 9018 | 0 \ |
| 9019 | -s "Version: TLS1.3" \ |
| 9020 | -c "Version: TLS1.3" |
| 9021 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 9022 | # TLS1.3 test cases |
| 9023 | # TODO: remove or rewrite this test case if #4832 is resolved. |
| 9024 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9025 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 9026 | skip_handshake_stage_check |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9027 | run_test "TLS 1.3: Not supported version check: tls12 and tls13" \ |
Xiaofei Bai | d25fab6 | 2021-12-02 06:36:27 +0000 | [diff] [blame] | 9028 | "$P_SRV debug_level=1 min_version=tls12 max_version=tls13" \ |
| 9029 | "$P_CLI debug_level=1 min_version=tls12 max_version=tls13" \ |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 9030 | 1 \ |
| 9031 | -s "SSL - The requested feature is not available" \ |
| 9032 | -c "SSL - The requested feature is not available" \ |
| 9033 | -s "Hybrid TLS 1.2 + TLS 1.3 configurations are not yet supported" \ |
| 9034 | -c "Hybrid TLS 1.2 + TLS 1.3 configurations are not yet supported" |
| 9035 | |
Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 9036 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9037 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9038 | run_test "TLS 1.3: handshake dispatch test: tls13 only" \ |
Xiaofei Bai | d25fab6 | 2021-12-02 06:36:27 +0000 | [diff] [blame] | 9039 | "$P_SRV debug_level=2 min_version=tls13 max_version=tls13" \ |
| 9040 | "$P_CLI debug_level=2 min_version=tls13 max_version=tls13" \ |
Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 9041 | 1 \ |
Jerry Yu | e3b3412 | 2021-09-28 17:53:35 +0800 | [diff] [blame] | 9042 | -s "tls13 server state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 9043 | -c "tls13 client state: MBEDTLS_SSL_HELLO_REQUEST" |
Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 9044 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 9045 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9046 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9047 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9048 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9049 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9050 | run_test "TLS 1.3: minimal feature sets - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9051 | "$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] | 9052 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 9053 | 0 \ |
Jerry Yu | cdcc55f | 2021-11-11 13:26:33 +0800 | [diff] [blame] | 9054 | -c "tls13 client state: MBEDTLS_SSL_HELLO_REQUEST(0)" \ |
| 9055 | -c "tls13 client state: MBEDTLS_SSL_SERVER_HELLO(2)" \ |
| 9056 | -c "tls13 client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS(19)" \ |
| 9057 | -c "tls13 client state: MBEDTLS_SSL_CERTIFICATE_REQUEST(5)" \ |
| 9058 | -c "tls13 client state: MBEDTLS_SSL_SERVER_CERTIFICATE(3)" \ |
| 9059 | -c "tls13 client state: MBEDTLS_SSL_CERTIFICATE_VERIFY(9)" \ |
| 9060 | -c "tls13 client state: MBEDTLS_SSL_SERVER_FINISHED(13)" \ |
| 9061 | -c "tls13 client state: MBEDTLS_SSL_CLIENT_FINISHED(11)" \ |
| 9062 | -c "tls13 client state: MBEDTLS_SSL_FLUSH_BUFFERS(14)" \ |
| 9063 | -c "tls13 client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP(15)" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 9064 | -c "<= ssl_tls13_process_server_hello" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 9065 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 9066 | -c "ECDH curve: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 9067 | -c "=> ssl_tls13_process_server_hello" \ |
Jerry Yu | daac359 | 2021-10-29 20:01:42 +0800 | [diff] [blame] | 9068 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 9069 | -c "Certificate verification flags clear" \ |
Jerry Yu | 5398c10 | 2021-11-05 13:32:38 +0800 | [diff] [blame] | 9070 | -c "=> parse certificate verify" \ |
| 9071 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 9072 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 9073 | -c "<= parse finished message" \ |
| 9074 | -c "HTTP/1.0 200 ok" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 9075 | |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 9076 | requires_gnutls_tls1_3 |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 9077 | requires_gnutls_next_no_ticket |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9078 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9079 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9080 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9081 | requires_config_enabled MBEDTLS_SSL_CLI_C |
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 | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9198 | run_test "TLS 1.3: CertificateRequest check - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9199 | "$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] | 9200 | "$P_CLI debug_level=4 force_version=tls13 " \ |
Jerry Yu | 936dffd | 2021-11-22 18:34:36 +0800 | [diff] [blame] | 9201 | 1 \ |
Xiaofei Bai | 5d8598e | 2022-01-11 05:56:06 +0000 | [diff] [blame] | 9202 | -c "=> parse certificate request" \ |
Xiaofei Bai | 69fcd39 | 2022-01-20 08:25:00 +0000 | [diff] [blame] | 9203 | -c "got a certificate request" \ |
Xiaofei Bai | 5d8598e | 2022-01-11 05:56:06 +0000 | [diff] [blame] | 9204 | -c "<= parse certificate request" |
Jerry Yu | 936dffd | 2021-11-22 18:34:36 +0800 | [diff] [blame] | 9205 | |
| 9206 | requires_gnutls_tls1_3 |
| 9207 | requires_gnutls_next_no_ticket |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9208 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9209 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9210 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9211 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9212 | run_test "TLS 1.3: CertificateRequest check - gnutls" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9213 | "$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] | 9214 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
Jerry Yu | 936dffd | 2021-11-22 18:34:36 +0800 | [diff] [blame] | 9215 | 1 \ |
Xiaofei Bai | 5d8598e | 2022-01-11 05:56:06 +0000 | [diff] [blame] | 9216 | -c "=> parse certificate request" \ |
Xiaofei Bai | 69fcd39 | 2022-01-20 08:25:00 +0000 | [diff] [blame] | 9217 | -c "got a certificate request" \ |
Xiaofei Bai | 5d8598e | 2022-01-11 05:56:06 +0000 | [diff] [blame] | 9218 | -c "<= parse certificate request" |
Jerry Yu | 936dffd | 2021-11-22 18:34:36 +0800 | [diff] [blame] | 9219 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9220 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9221 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9222 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9223 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 9224 | requires_openssl_tls1_3 |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 9225 | run_test "TLS 1.3: HelloRetryRequest check, ciphersuite TLS_AES_128_GCM_SHA256 - openssl" \ |
| 9226 | "$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" \ |
| 9227 | "$P_CLI debug_level=4 force_version=tls13" \ |
| 9228 | 0 \ |
| 9229 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 9230 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
| 9231 | -c "tls13 client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 9232 | -c "HTTP/1.0 200 ok" |
| 9233 | |
| 9234 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 9235 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 9236 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9237 | requires_config_enabled MBEDTLS_SSL_CLI_C |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 9238 | requires_openssl_tls1_3 |
| 9239 | 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] | 9240 | "$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] | 9241 | "$P_CLI debug_level=4 force_version=tls13" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 9242 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 9243 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 9244 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
| 9245 | -c "tls13 client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 9246 | -c "HTTP/1.0 200 ok" |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 9247 | |
| 9248 | requires_gnutls_tls1_3 |
| 9249 | requires_gnutls_next_no_ticket |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9250 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9251 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9252 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9253 | requires_config_enabled MBEDTLS_SSL_CLI_C |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 9254 | run_test "TLS 1.3: HelloRetryRequest check, ciphersuite TLS_AES_128_GCM_SHA256 - gnutls" \ |
| 9255 | "$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" \ |
| 9256 | "$P_CLI debug_level=4 force_version=tls13" \ |
| 9257 | 0 \ |
| 9258 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 9259 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
| 9260 | -c "tls13 client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 9261 | -c "HTTP/1.0 200 OK" |
| 9262 | |
| 9263 | requires_gnutls_tls1_3 |
| 9264 | requires_gnutls_next_no_ticket |
| 9265 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 9266 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 9267 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9268 | requires_config_enabled MBEDTLS_SSL_CLI_C |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 9269 | 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] | 9270 | "$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] | 9271 | "$P_CLI debug_level=4 force_version=tls13" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 9272 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 9273 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 9274 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
| 9275 | -c "tls13 client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 9276 | -c "HTTP/1.0 200 OK" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9277 | |
Gilles Peskine | 2baaf60 | 2022-01-07 15:46:12 +0100 | [diff] [blame] | 9278 | for i in opt-testcases/*.sh |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 9279 | do |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 9280 | TEST_SUITE_NAME=${i##*/} |
| 9281 | TEST_SUITE_NAME=${TEST_SUITE_NAME%.*} |
| 9282 | . "$i" |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 9283 | done |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 9284 | unset TEST_SUITE_NAME |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 9285 | |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9286 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9287 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9288 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9289 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9290 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 9291 | 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] | 9292 | "$O_NEXT_SRV -msg -tls1_3 -no_middlebox -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
| 9293 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
| 9294 | 0 \ |
| 9295 | -c "HTTP/1.0 200 ok" |
| 9296 | |
| 9297 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9298 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9299 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9300 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9301 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 9302 | 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] | 9303 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
| 9304 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
| 9305 | 1 \ |
| 9306 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 9307 | |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 9308 | requires_gnutls_tls1_3 |
| 9309 | requires_gnutls_next_no_ticket |
| 9310 | requires_gnutls_next_disable_tls13_compat |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9311 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 9312 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 9313 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9314 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 9315 | run_test "TLS 1.3 m->G both peers do not support middlebox compatibility" \ |
| 9316 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE --disable-client-cert" \ |
| 9317 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
| 9318 | 0 \ |
| 9319 | -c "HTTP/1.0 200 OK" |
| 9320 | |
| 9321 | requires_gnutls_tls1_3 |
| 9322 | requires_gnutls_next_no_ticket |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9323 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 9324 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 9325 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9326 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 9327 | run_test "TLS 1.3 m->G server with middlebox compat support, not client" \ |
| 9328 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --disable-client-cert" \ |
| 9329 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
| 9330 | 1 \ |
| 9331 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 9332 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 9333 | # Test heap memory usage after handshake |
| 9334 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 9335 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 9336 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9337 | requires_max_content_len 16384 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 9338 | run_tests_memory_after_hanshake |
| 9339 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 9340 | # Final report |
| 9341 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9342 | echo "------------------------------------------------------------------------" |
| 9343 | |
| 9344 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 9345 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9346 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 9347 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9348 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 9349 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 9350 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9351 | |
| 9352 | exit $FAILS |