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} |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 48 | : ${OPENSSL_CMD:=openssl} # OPENSSL would conflict with the build system |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 49 | : ${GNUTLS_CLI:=gnutls-cli} |
| 50 | : ${GNUTLS_SERV:=gnutls-serv} |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 51 | : ${PERL:=perl} |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 52 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 53 | guess_config_name() { |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 54 | 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] | 55 | echo "default" |
| 56 | else |
| 57 | echo "unknown" |
| 58 | fi |
| 59 | } |
| 60 | : ${MBEDTLS_TEST_OUTCOME_FILE=} |
| 61 | : ${MBEDTLS_TEST_CONFIGURATION:="$(guess_config_name)"} |
| 62 | : ${MBEDTLS_TEST_PLATFORM:="$(uname -s | tr -c \\n0-9A-Za-z _)-$(uname -m | tr -c \\n0-9A-Za-z _)"} |
| 63 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 64 | 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] | 65 | 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] | 66 | 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] | 67 | 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] | 68 | TCP_CLIENT="$PERL scripts/tcp_client.pl" |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 69 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 70 | # alternative versions of OpenSSL and GnuTLS (no default path) |
| 71 | |
| 72 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 73 | O_LEGACY_SRV="$OPENSSL_LEGACY s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
| 74 | O_LEGACY_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_LEGACY s_client" |
| 75 | else |
| 76 | O_LEGACY_SRV=false |
| 77 | O_LEGACY_CLI=false |
| 78 | fi |
| 79 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 80 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
XiaokangQian | 30f5560 | 2021-11-24 01:54:50 +0000 | [diff] [blame] | 81 | O_NEXT_SRV="$OPENSSL_NEXT s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
XiaokangQian | 07c5547 | 2021-11-23 08:30:14 +0000 | [diff] [blame] | 82 | O_NEXT_SRV_RSA="$OPENSSL_NEXT s_server -www -cert data_files/server2-sha256.crt -key data_files/server2.key" |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 83 | O_NEXT_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_NEXT s_client" |
| 84 | else |
| 85 | O_NEXT_SRV=false |
XiaokangQian | 3887ab5 | 2021-11-22 07:14:39 +0000 | [diff] [blame] | 86 | O_NEXT_SRV_RSA=false |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 87 | O_NEXT_CLI=false |
| 88 | fi |
| 89 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 90 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 91 | G_NEXT_SRV="$GNUTLS_NEXT_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
XiaokangQian | 07c5547 | 2021-11-23 08:30:14 +0000 | [diff] [blame] | 92 | G_NEXT_SRV_RSA="$GNUTLS_NEXT_SERV --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 93 | else |
| 94 | G_NEXT_SRV=false |
XiaokangQian | d150189 | 2021-11-22 04:06:52 +0000 | [diff] [blame] | 95 | G_NEXT_SRV_RSA=false |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 96 | fi |
| 97 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 98 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 99 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile data_files/test-ca_cat12.crt" |
| 100 | else |
| 101 | G_NEXT_CLI=false |
| 102 | fi |
| 103 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 104 | TESTS=0 |
| 105 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 106 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 107 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 108 | CONFIG_H='../include/mbedtls/mbedtls_config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 109 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 110 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 111 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 112 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 113 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 114 | SHOW_TEST_NUMBER=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 115 | RUN_TEST_NUMBER='' |
| 116 | |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 117 | PRESERVE_LOGS=0 |
| 118 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 119 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 120 | # port which is this plus 10000. Each port number may be independently |
| 121 | # overridden by a command line option. |
| 122 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 123 | PXY_PORT=$((SRV_PORT + 10000)) |
| 124 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 125 | print_usage() { |
| 126 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 127 | printf " -h|--help\tPrint this help.\n" |
| 128 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 129 | printf " -f|--filter\tOnly matching tests are executed (substring or BRE)\n" |
| 130 | printf " -e|--exclude\tMatching tests are excluded (substring or BRE)\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 131 | 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] | 132 | 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] | 133 | printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 134 | printf " --outcome-file\tFile where test outcomes are written\n" |
| 135 | printf " \t(default: \$MBEDTLS_TEST_OUTCOME_FILE, none if empty)\n" |
| 136 | printf " --port \tTCP/UDP port (default: randomish 1xxxx)\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 137 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 138 | 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] | 139 | } |
| 140 | |
| 141 | get_options() { |
| 142 | while [ $# -gt 0 ]; do |
| 143 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 144 | -f|--filter) |
| 145 | shift; FILTER=$1 |
| 146 | ;; |
| 147 | -e|--exclude) |
| 148 | shift; EXCLUDE=$1 |
| 149 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 150 | -m|--memcheck) |
| 151 | MEMCHECK=1 |
| 152 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 153 | -n|--number) |
| 154 | shift; RUN_TEST_NUMBER=$1 |
| 155 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 156 | -s|--show-numbers) |
| 157 | SHOW_TEST_NUMBER=1 |
| 158 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 159 | -p|--preserve-logs) |
| 160 | PRESERVE_LOGS=1 |
| 161 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 162 | --port) |
| 163 | shift; SRV_PORT=$1 |
| 164 | ;; |
| 165 | --proxy-port) |
| 166 | shift; PXY_PORT=$1 |
| 167 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 168 | --seed) |
| 169 | shift; SEED="$1" |
| 170 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 171 | -h|--help) |
| 172 | print_usage |
| 173 | exit 0 |
| 174 | ;; |
| 175 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 176 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 177 | print_usage |
| 178 | exit 1 |
| 179 | ;; |
| 180 | esac |
| 181 | shift |
| 182 | done |
| 183 | } |
| 184 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 185 | # Make the outcome file path relative to the original directory, not |
| 186 | # to .../tests |
| 187 | case "$MBEDTLS_TEST_OUTCOME_FILE" in |
| 188 | [!/]*) |
| 189 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" |
| 190 | ;; |
| 191 | esac |
| 192 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 193 | # Read boolean configuration options from mbedtls_config.h for easy and quick |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 194 | # testing. Skip non-boolean options (with something other than spaces |
| 195 | # and a comment after "#define SYMBOL"). The variable contains a |
| 196 | # space-separated list of symbols. |
| 197 | CONFIGS_ENABLED=" $(<"$CONFIG_H" \ |
| 198 | sed -n 's!^ *#define *\([A-Za-z][0-9A-Z_a-z]*\) *\(/*\)*!\1!p' | |
| 199 | tr '\n' ' ')" |
| 200 | |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 201 | # Skip next test; use this macro to skip tests which are legitimate |
| 202 | # in theory and expected to be re-introduced at some point, but |
| 203 | # aren't expected to succeed at the moment due to problems outside |
| 204 | # our control (such as bugs in other TLS implementations). |
| 205 | skip_next_test() { |
| 206 | SKIP_NEXT="YES" |
| 207 | } |
| 208 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 209 | # 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] | 210 | requires_config_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 211 | case $CONFIGS_ENABLED in |
| 212 | *" $1 "*) :;; |
| 213 | *) SKIP_NEXT="YES";; |
| 214 | esac |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 215 | } |
| 216 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 217 | # 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] | 218 | requires_config_disabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 219 | case $CONFIGS_ENABLED in |
| 220 | *" $1 "*) SKIP_NEXT="YES";; |
| 221 | esac |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 222 | } |
| 223 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 224 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 225 | # This function uses the query_config command line option to query the |
| 226 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 227 | # program. The command will always return a success value if the |
| 228 | # configuration is defined and the value will be printed to stdout. |
| 229 | # |
| 230 | # Note that if the configuration is not defined or is defined to nothing, |
| 231 | # the output of this function will be an empty string. |
| 232 | ${P_SRV} "query_config=${1}" |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 233 | } |
| 234 | |
| 235 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 236 | VAL="$( get_config_value_or_default "$1" )" |
| 237 | if [ -z "$VAL" ]; then |
| 238 | # Should never happen |
| 239 | echo "Mbed TLS configuration $1 is not defined" |
| 240 | exit 1 |
| 241 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 242 | SKIP_NEXT="YES" |
| 243 | fi |
| 244 | } |
| 245 | |
| 246 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 247 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 248 | if [ -z "$VAL" ]; then |
| 249 | # Should never happen |
| 250 | echo "Mbed TLS configuration $1 is not defined" |
| 251 | exit 1 |
| 252 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 253 | SKIP_NEXT="YES" |
| 254 | fi |
| 255 | } |
| 256 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 257 | requires_config_value_equals() { |
| 258 | VAL=$( get_config_value_or_default "$1" ) |
| 259 | if [ -z "$VAL" ]; then |
| 260 | # Should never happen |
| 261 | echo "Mbed TLS configuration $1 is not defined" |
| 262 | exit 1 |
| 263 | elif [ "$VAL" -ne "$2" ]; then |
| 264 | SKIP_NEXT="YES" |
| 265 | fi |
| 266 | } |
| 267 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 268 | # Space-separated list of ciphersuites supported by this build of |
| 269 | # Mbed TLS. |
| 270 | P_CIPHERSUITES=" $($P_CLI --help 2>/dev/null | |
XiaokangQian | 4b82ca1 | 2021-11-18 08:27:17 +0000 | [diff] [blame] | 271 | grep 'TLS-\|TLS1-3' | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 272 | tr -s ' \n' ' ')" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 273 | requires_ciphersuite_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 274 | case $P_CIPHERSUITES in |
| 275 | *" $1 "*) :;; |
| 276 | *) SKIP_NEXT="YES";; |
| 277 | esac |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 278 | } |
| 279 | |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 280 | # maybe_requires_ciphersuite_enabled CMD [RUN_TEST_OPTION...] |
| 281 | # If CMD (call to a TLS client or server program) requires a specific |
| 282 | # ciphersuite, arrange to only run the test case if this ciphersuite is |
Dave Rodgman | c424098 | 2021-06-29 19:53:16 +0100 | [diff] [blame] | 283 | # enabled. |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 284 | maybe_requires_ciphersuite_enabled() { |
| 285 | case "$1" in |
| 286 | *\ force_ciphersuite=*) :;; |
| 287 | *) return;; # No specific required ciphersuite |
| 288 | esac |
| 289 | ciphersuite="${1##*\ force_ciphersuite=}" |
| 290 | ciphersuite="${ciphersuite%%[!-0-9A-Z_a-z]*}" |
| 291 | shift |
| 292 | |
Dave Rodgman | c424098 | 2021-06-29 19:53:16 +0100 | [diff] [blame] | 293 | requires_ciphersuite_enabled "$ciphersuite" |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 294 | |
| 295 | unset ciphersuite |
| 296 | } |
| 297 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 298 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 299 | requires_openssl_with_fallback_scsv() { |
| 300 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 301 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 302 | then |
| 303 | OPENSSL_HAS_FBSCSV="YES" |
| 304 | else |
| 305 | OPENSSL_HAS_FBSCSV="NO" |
| 306 | fi |
| 307 | fi |
| 308 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 309 | SKIP_NEXT="YES" |
| 310 | fi |
| 311 | } |
| 312 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 313 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 314 | requires_max_content_len() { |
| 315 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 316 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 317 | } |
| 318 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 319 | # skip next test if GnuTLS isn't available |
| 320 | requires_gnutls() { |
| 321 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 322 | 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] | 323 | GNUTLS_AVAILABLE="YES" |
| 324 | else |
| 325 | GNUTLS_AVAILABLE="NO" |
| 326 | fi |
| 327 | fi |
| 328 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 329 | SKIP_NEXT="YES" |
| 330 | fi |
| 331 | } |
| 332 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 333 | # skip next test if GnuTLS-next isn't available |
| 334 | requires_gnutls_next() { |
| 335 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 336 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 337 | GNUTLS_NEXT_AVAILABLE="YES" |
| 338 | else |
| 339 | GNUTLS_NEXT_AVAILABLE="NO" |
| 340 | fi |
| 341 | fi |
| 342 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 343 | SKIP_NEXT="YES" |
| 344 | fi |
| 345 | } |
| 346 | |
| 347 | # skip next test if OpenSSL-legacy isn't available |
| 348 | requires_openssl_legacy() { |
| 349 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 350 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 351 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 352 | else |
| 353 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 354 | fi |
| 355 | fi |
| 356 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 357 | SKIP_NEXT="YES" |
| 358 | fi |
| 359 | } |
| 360 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 361 | requires_openssl_next() { |
| 362 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then |
| 363 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then |
| 364 | OPENSSL_NEXT_AVAILABLE="YES" |
| 365 | else |
| 366 | OPENSSL_NEXT_AVAILABLE="NO" |
| 367 | fi |
| 368 | fi |
| 369 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 370 | SKIP_NEXT="YES" |
| 371 | fi |
| 372 | } |
| 373 | |
| 374 | # skip next test if tls1_3 is not available |
| 375 | requires_openssl_tls1_3() { |
| 376 | requires_openssl_next |
| 377 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 378 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 379 | fi |
| 380 | if [ -z "${OPENSSL_TLS1_3_AVAILABLE:-}" ]; then |
| 381 | if $OPENSSL_NEXT s_client -help 2>&1 | grep tls1_3 >/dev/null |
| 382 | then |
| 383 | OPENSSL_TLS1_3_AVAILABLE="YES" |
| 384 | else |
| 385 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 386 | fi |
| 387 | fi |
| 388 | if [ "$OPENSSL_TLS1_3_AVAILABLE" = "NO" ]; then |
| 389 | SKIP_NEXT="YES" |
| 390 | fi |
| 391 | } |
| 392 | |
| 393 | # skip next test if tls1_3 is not available |
| 394 | requires_gnutls_tls1_3() { |
| 395 | requires_gnutls_next |
| 396 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 397 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 398 | fi |
| 399 | if [ -z "${GNUTLS_TLS1_3_AVAILABLE:-}" ]; then |
| 400 | if $GNUTLS_NEXT_CLI -l 2>&1 | grep VERS-TLS1.3 >/dev/null |
| 401 | then |
| 402 | GNUTLS_TLS1_3_AVAILABLE="YES" |
| 403 | else |
| 404 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 405 | fi |
| 406 | fi |
| 407 | if [ "$GNUTLS_TLS1_3_AVAILABLE" = "NO" ]; then |
| 408 | SKIP_NEXT="YES" |
| 409 | fi |
| 410 | } |
| 411 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 412 | # Check %NO_TICKETS option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 413 | requires_gnutls_next_no_ticket() { |
| 414 | requires_gnutls_next |
| 415 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 416 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 417 | fi |
| 418 | if [ -z "${GNUTLS_NO_TICKETS_AVAILABLE:-}" ]; then |
| 419 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep NO_TICKETS >/dev/null |
| 420 | then |
| 421 | GNUTLS_NO_TICKETS_AVAILABLE="YES" |
| 422 | else |
| 423 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 424 | fi |
| 425 | fi |
| 426 | if [ "$GNUTLS_NO_TICKETS_AVAILABLE" = "NO" ]; then |
| 427 | SKIP_NEXT="YES" |
| 428 | fi |
| 429 | } |
| 430 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 431 | # Check %DISABLE_TLS13_COMPAT_MODE option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 432 | requires_gnutls_next_disable_tls13_compat() { |
| 433 | requires_gnutls_next |
| 434 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 435 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 436 | fi |
| 437 | if [ -z "${GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE:-}" ]; then |
| 438 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep DISABLE_TLS13_COMPAT_MODE >/dev/null |
| 439 | then |
| 440 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="YES" |
| 441 | else |
| 442 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 443 | fi |
| 444 | fi |
| 445 | if [ "$GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE" = "NO" ]; then |
| 446 | SKIP_NEXT="YES" |
| 447 | fi |
| 448 | } |
| 449 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 450 | # skip next test if IPv6 isn't available on this host |
| 451 | requires_ipv6() { |
| 452 | if [ -z "${HAS_IPV6:-}" ]; then |
| 453 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 454 | SRV_PID=$! |
| 455 | sleep 1 |
| 456 | kill $SRV_PID >/dev/null 2>&1 |
| 457 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 458 | HAS_IPV6="NO" |
| 459 | else |
| 460 | HAS_IPV6="YES" |
| 461 | fi |
| 462 | rm -r $SRV_OUT |
| 463 | fi |
| 464 | |
| 465 | if [ "$HAS_IPV6" = "NO" ]; then |
| 466 | SKIP_NEXT="YES" |
| 467 | fi |
| 468 | } |
| 469 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 470 | # skip next test if it's i686 or uname is not available |
| 471 | requires_not_i686() { |
| 472 | if [ -z "${IS_I686:-}" ]; then |
| 473 | IS_I686="YES" |
| 474 | if which "uname" >/dev/null 2>&1; then |
| 475 | if [ -z "$(uname -a | grep i686)" ]; then |
| 476 | IS_I686="NO" |
| 477 | fi |
| 478 | fi |
| 479 | fi |
| 480 | if [ "$IS_I686" = "YES" ]; then |
| 481 | SKIP_NEXT="YES" |
| 482 | fi |
| 483 | } |
| 484 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 485 | # Calculate the input & output maximum content lengths set in the config |
David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 486 | MAX_CONTENT_LEN=16384 |
Yuto Takano | 2be6f1a | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 487 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 488 | 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] | 489 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 490 | # Calculate the maximum content length that fits both |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 491 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 492 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 493 | fi |
| 494 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 495 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 496 | fi |
| 497 | |
| 498 | # skip the next test if the SSL output buffer is less than 16KB |
| 499 | requires_full_size_output_buffer() { |
| 500 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 501 | SKIP_NEXT="YES" |
| 502 | fi |
| 503 | } |
| 504 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 505 | # skip the next test if valgrind is in use |
| 506 | not_with_valgrind() { |
| 507 | if [ "$MEMCHECK" -gt 0 ]; then |
| 508 | SKIP_NEXT="YES" |
| 509 | fi |
| 510 | } |
| 511 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 512 | # skip the next test if valgrind is NOT in use |
| 513 | only_with_valgrind() { |
| 514 | if [ "$MEMCHECK" -eq 0 ]; then |
| 515 | SKIP_NEXT="YES" |
| 516 | fi |
| 517 | } |
| 518 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 519 | # 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] | 520 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 521 | CLI_DELAY_FACTOR=$1 |
| 522 | } |
| 523 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 524 | # wait for the given seconds after the client finished in the next test |
| 525 | server_needs_more_time() { |
| 526 | SRV_DELAY_SECONDS=$1 |
| 527 | } |
| 528 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 529 | # print_name <name> |
| 530 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 531 | TESTS=$(( $TESTS + 1 )) |
| 532 | LINE="" |
| 533 | |
| 534 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 535 | LINE="$TESTS " |
| 536 | fi |
| 537 | |
| 538 | LINE="$LINE$1" |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 539 | printf "%s " "$LINE" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 540 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 541 | for i in `seq 1 $LEN`; do printf '.'; done |
| 542 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 543 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 544 | } |
| 545 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 546 | # record_outcome <outcome> [<failure-reason>] |
| 547 | # The test name must be in $NAME. |
| 548 | record_outcome() { |
| 549 | echo "$1" |
| 550 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 551 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 552 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
| 553 | "ssl-opt" "$NAME" \ |
| 554 | "$1" "${2-}" \ |
| 555 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 556 | fi |
| 557 | } |
| 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 \ |
| 1200 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 1201 | -c "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1202 | -c "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1203 | -c "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1204 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 1205 | -s "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1206 | -s "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1207 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1208 | -C "Failed to setup PSA-based cipher context"\ |
| 1209 | -S "Failed to setup PSA-based cipher context"\ |
| 1210 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1211 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1212 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1213 | -S "error" \ |
| 1214 | -C "error" |
| 1215 | } |
| 1216 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1217 | run_test_psa_force_curve() { |
| 1218 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1219 | run_test "PSA - ECDH with $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 1220 | "$P_SRV debug_level=4 force_version=tls12 curves=$1" \ |
| 1221 | "$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] | 1222 | 0 \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1223 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 1224 | -c "Successfully setup PSA-based encryption cipher context" \ |
| 1225 | -c "PSA calc verify" \ |
| 1226 | -c "calc PSA finished" \ |
| 1227 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 1228 | -s "Successfully setup PSA-based encryption cipher context" \ |
| 1229 | -s "PSA calc verify" \ |
| 1230 | -s "calc PSA finished" \ |
| 1231 | -C "Failed to setup PSA-based cipher context"\ |
| 1232 | -S "Failed to setup PSA-based cipher context"\ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1233 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1234 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1235 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1236 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1237 | -C "error" |
| 1238 | } |
| 1239 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1240 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1241 | # a maximum fragment length. |
| 1242 | # first argument ($1) is MFL for SSL client |
| 1243 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1244 | run_test_memory_after_hanshake_with_mfl() |
| 1245 | { |
| 1246 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1247 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1248 | |
| 1249 | # Leave some margin for robustness |
| 1250 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1251 | |
| 1252 | run_test "Handshake memory usage (MFL $1)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 1253 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
| 1254 | "$P_CLI debug_level=3 force_version=tls12 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1255 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1256 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1257 | 0 \ |
| 1258 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1259 | } |
| 1260 | |
| 1261 | |
| 1262 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1263 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1264 | run_tests_memory_after_hanshake() |
| 1265 | { |
| 1266 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1267 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1268 | |
| 1269 | # first test with default MFU is to get reference memory usage |
| 1270 | MEMORY_USAGE_MFL_16K=0 |
| 1271 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 1272 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
| 1273 | "$P_CLI debug_level=3 force_version=tls12 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1274 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1275 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1276 | 0 \ |
| 1277 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1278 | |
| 1279 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1280 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1281 | |
| 1282 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1283 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1284 | |
| 1285 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1286 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1287 | |
| 1288 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1289 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1290 | } |
| 1291 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1292 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1293 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1294 | rm -f context_srv.txt |
| 1295 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1296 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1297 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1298 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1299 | 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] | 1300 | exit 1 |
| 1301 | } |
| 1302 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1303 | # |
| 1304 | # MAIN |
| 1305 | # |
| 1306 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1307 | get_options "$@" |
| 1308 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1309 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1310 | # patterns rather than regular expressions, use a case statement instead |
| 1311 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1312 | # detects simple cases: plain substring, everything, nothing. |
| 1313 | # |
| 1314 | # As an exception, the character '.' is treated as an ordinary character |
| 1315 | # if it is the only special character in the string. This is because it's |
| 1316 | # rare to need "any one character", but needing a literal '.' is common |
| 1317 | # (e.g. '-f "DTLS 1.2"'). |
| 1318 | need_grep= |
| 1319 | case "$FILTER" in |
| 1320 | '^$') simple_filter=;; |
| 1321 | '.*') simple_filter='*';; |
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_filter="*$FILTER*";; |
| 1326 | esac |
| 1327 | case "$EXCLUDE" in |
| 1328 | '^$') simple_exclude=;; |
| 1329 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1330 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1331 | need_grep=1;; |
| 1332 | *) # No regexp or shell-pattern special character |
| 1333 | simple_exclude="*$EXCLUDE*";; |
| 1334 | esac |
| 1335 | if [ -n "$need_grep" ]; then |
| 1336 | is_excluded () { |
| 1337 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1338 | } |
| 1339 | else |
| 1340 | is_excluded () { |
| 1341 | case "$1" in |
| 1342 | $simple_exclude) true;; |
| 1343 | $simple_filter) false;; |
| 1344 | *) true;; |
| 1345 | esac |
| 1346 | } |
| 1347 | fi |
| 1348 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1349 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1350 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1351 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1352 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1353 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1354 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1355 | exit 1 |
| 1356 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1357 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1358 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1359 | exit 1 |
| 1360 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1361 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1362 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1363 | exit 1 |
| 1364 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1365 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1366 | if which valgrind >/dev/null 2>&1; then :; else |
| 1367 | echo "Memcheck not possible. Valgrind not found" |
| 1368 | exit 1 |
| 1369 | fi |
| 1370 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1371 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 1372 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1373 | exit 1 |
| 1374 | fi |
| 1375 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1376 | # used by watchdog |
| 1377 | MAIN_PID="$$" |
| 1378 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1379 | # We use somewhat arbitrary delays for tests: |
| 1380 | # - how long do we wait for the server to start (when lsof not available)? |
| 1381 | # - how long do we allow for the client to finish? |
| 1382 | # (not to check performance, just to avoid waiting indefinitely) |
| 1383 | # Things are slower with valgrind, so give extra time here. |
| 1384 | # |
| 1385 | # Note: without lsof, there is a trade-off between the running time of this |
| 1386 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1387 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1388 | # 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] | 1389 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1390 | START_DELAY=6 |
| 1391 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1392 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1393 | START_DELAY=2 |
| 1394 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1395 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1396 | |
| 1397 | # some particular tests need more time: |
| 1398 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1399 | # - for the server, we sleep for a number of seconds after the client exits |
| 1400 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1401 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1402 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1403 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1404 | # 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] | 1405 | # +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] | 1406 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 1407 | # 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] | 1408 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1409 | 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] | 1410 | 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] | 1411 | O_SRV="$O_SRV -accept $SRV_PORT" |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1412 | 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] | 1413 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1414 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1415 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1416 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1417 | 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] | 1418 | 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] | 1419 | fi |
| 1420 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 1421 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 1422 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
XiaokangQian | bdf26de | 2021-11-22 09:52:56 +0000 | [diff] [blame] | 1423 | O_NEXT_SRV_RSA="$O_NEXT_SRV_RSA -accept $SRV_PORT" |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1424 | 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] | 1425 | fi |
| 1426 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1427 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1428 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
XiaokangQian | 4b82ca1 | 2021-11-18 08:27:17 +0000 | [diff] [blame] | 1429 | G_NEXT_SRV_RSA="$G_NEXT_SRV_RSA -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1430 | fi |
| 1431 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1432 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1433 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1434 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1435 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1436 | # Allow SHA-1, because many of our test certificates use it |
| 1437 | P_SRV="$P_SRV allow_sha1=1" |
| 1438 | P_CLI="$P_CLI allow_sha1=1" |
| 1439 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1440 | # Also pick a unique name for intermediate files |
| 1441 | SRV_OUT="srv_out.$$" |
| 1442 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1443 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1444 | SESSION="session.$$" |
| 1445 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1446 | SKIP_NEXT="NO" |
| 1447 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1448 | trap cleanup INT TERM HUP |
| 1449 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1450 | # Basic test |
| 1451 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1452 | # Checks that: |
| 1453 | # - 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] | 1454 | # - the expected parameters are selected |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1455 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1456 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1457 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1458 | "$P_CLI" \ |
| 1459 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1460 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1461 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1462 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 1463 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1464 | -S "error" \ |
| 1465 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1466 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1467 | run_test "Default, DTLS" \ |
| 1468 | "$P_SRV dtls=1" \ |
| 1469 | "$P_CLI dtls=1" \ |
| 1470 | 0 \ |
| 1471 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1472 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1473 | |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1474 | run_test "TLS client auth: required" \ |
| 1475 | "$P_SRV auth_mode=required" \ |
| 1476 | "$P_CLI" \ |
| 1477 | 0 \ |
| 1478 | -s "Verifying peer X.509 certificate... ok" |
| 1479 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1480 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1481 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1482 | requires_config_enabled MBEDTLS_SHA256_C |
| 1483 | run_test "TLS: password protected client key" \ |
| 1484 | "$P_SRV auth_mode=required" \ |
| 1485 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1486 | 0 |
| 1487 | |
| 1488 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1489 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1490 | requires_config_enabled MBEDTLS_SHA256_C |
| 1491 | run_test "TLS: password protected server key" \ |
| 1492 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1493 | "$P_CLI" \ |
| 1494 | 0 |
| 1495 | |
| 1496 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1497 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1498 | requires_config_enabled MBEDTLS_RSA_C |
| 1499 | requires_config_enabled MBEDTLS_SHA256_C |
| 1500 | run_test "TLS: password protected server key, two certificates" \ |
| 1501 | "$P_SRV \ |
| 1502 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1503 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1504 | "$P_CLI" \ |
| 1505 | 0 |
| 1506 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1507 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1508 | run_test "CA callback on client" \ |
| 1509 | "$P_SRV debug_level=3" \ |
| 1510 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1511 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1512 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1513 | -S "error" \ |
| 1514 | -C "error" |
| 1515 | |
| 1516 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1517 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1518 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1519 | requires_config_enabled MBEDTLS_SHA256_C |
| 1520 | run_test "CA callback on server" \ |
| 1521 | "$P_SRV auth_mode=required" \ |
| 1522 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1523 | key_file=data_files/server5.key" \ |
| 1524 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1525 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1526 | -s "Verifying peer X.509 certificate... ok" \ |
| 1527 | -S "error" \ |
| 1528 | -C "error" |
| 1529 | |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1530 | # Test using an opaque private key for client authentication |
| 1531 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1532 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1533 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1534 | requires_config_enabled MBEDTLS_SHA256_C |
| 1535 | run_test "Opaque key for client authentication" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1536 | "$P_SRV auth_mode=required crt_file=data_files/server5.crt \ |
| 1537 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1538 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1539 | key_file=data_files/server5.key" \ |
| 1540 | 0 \ |
| 1541 | -c "key type: Opaque" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1542 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1543 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1544 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1545 | -S "error" \ |
| 1546 | -C "error" |
| 1547 | |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1548 | # Test using an opaque private key for server authentication |
| 1549 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1550 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1551 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1552 | requires_config_enabled MBEDTLS_SHA256_C |
| 1553 | run_test "Opaque key for server authentication" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1554 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
| 1555 | key_file=data_files/server5.key" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1556 | "$P_CLI crt_file=data_files/server5.crt \ |
| 1557 | key_file=data_files/server5.key" \ |
| 1558 | 0 \ |
| 1559 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1560 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 1561 | -s "key types: Opaque - invalid PK" \ |
| 1562 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1563 | -S "error" \ |
| 1564 | -C "error" |
| 1565 | |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1566 | # Test using an opaque private key for client/server authentication |
| 1567 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1568 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1569 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1570 | requires_config_enabled MBEDTLS_SHA256_C |
| 1571 | run_test "Opaque key for client/server authentication" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1572 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
| 1573 | key_file=data_files/server5.key" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1574 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1575 | key_file=data_files/server5.key" \ |
| 1576 | 0 \ |
| 1577 | -c "key type: Opaque" \ |
| 1578 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1579 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 1580 | -s "key types: Opaque - invalid PK" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1581 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1582 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1583 | -S "error" \ |
| 1584 | -C "error" |
| 1585 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1586 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 1587 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 1588 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 1589 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 1590 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 1591 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 1592 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 1593 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 1594 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 1595 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 1596 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 1597 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1598 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1599 | run_test_psa_force_curve "secp521r1" |
| 1600 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 1601 | run_test_psa_force_curve "brainpoolP512r1" |
| 1602 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 1603 | run_test_psa_force_curve "secp384r1" |
| 1604 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1605 | run_test_psa_force_curve "brainpoolP384r1" |
| 1606 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1607 | run_test_psa_force_curve "secp256r1" |
| 1608 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1609 | run_test_psa_force_curve "secp256k1" |
| 1610 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1611 | run_test_psa_force_curve "brainpoolP256r1" |
| 1612 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1613 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1614 | ## SECP224K1 is buggy via the PSA API |
| 1615 | ## (https://github.com/ARMmbed/mbedtls/issues/3541), |
| 1616 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 1617 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 1618 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 1619 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1620 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1621 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1622 | run_test_psa_force_curve "secp192r1" |
| 1623 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1624 | run_test_psa_force_curve "secp192k1" |
| 1625 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1626 | # Test current time in ServerHello |
| 1627 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 1628 | run_test "ServerHello contains gmt_unix_time" \ |
| 1629 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1630 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1631 | 0 \ |
| 1632 | -f "check_server_hello_time" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1633 | -F "check_server_hello_time" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1634 | |
| 1635 | # Test for uniqueness of IVs in AEAD ciphersuites |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1636 | run_test "Unique IV in GCM" \ |
| 1637 | "$P_SRV exchanges=20 debug_level=4" \ |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1638 | "$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] | 1639 | 0 \ |
| 1640 | -u "IV used" \ |
| 1641 | -U "IV used" |
| 1642 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1643 | # Tests for certificate verification callback |
| 1644 | run_test "Configuration-specific CRT verification callback" \ |
| 1645 | "$P_SRV debug_level=3" \ |
| 1646 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1647 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1648 | -S "error" \ |
| 1649 | -c "Verify requested for " \ |
| 1650 | -c "Use configuration-specific verification callback" \ |
| 1651 | -C "Use context-specific verification callback" \ |
| 1652 | -C "error" |
| 1653 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1654 | run_test "Context-specific CRT verification callback" \ |
| 1655 | "$P_SRV debug_level=3" \ |
| 1656 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 1657 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1658 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1659 | -c "Verify requested for " \ |
| 1660 | -c "Use context-specific verification callback" \ |
| 1661 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1662 | -C "error" |
| 1663 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1664 | # Tests for SHA-1 support |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1665 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1666 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1667 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1668 | 1 \ |
| 1669 | -c "The certificate is signed with an unacceptable hash" |
| 1670 | |
| 1671 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1672 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1673 | "$P_CLI allow_sha1=1" \ |
| 1674 | 0 |
| 1675 | |
| 1676 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1677 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1678 | "$P_CLI allow_sha1=0" \ |
| 1679 | 0 |
| 1680 | |
| 1681 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1682 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1683 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1684 | 1 \ |
| 1685 | -s "The certificate is signed with an unacceptable hash" |
| 1686 | |
| 1687 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1688 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1689 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1690 | 0 |
| 1691 | |
| 1692 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1693 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1694 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1695 | 0 |
| 1696 | |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1697 | # Dummy TLS 1.3 test |
| 1698 | # Currently only checking that passing TLS 1.3 key exchange modes to |
| 1699 | # ssl_client2/ssl_server2 example programs works. |
| 1700 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1701 | run_test "TLS 1.3, key exchange mode parameter passing: PSK only" \ |
Jerry Yu | 31c01d3 | 2021-08-24 10:49:06 +0800 | [diff] [blame] | 1702 | "$P_SRV tls13_kex_modes=psk" \ |
| 1703 | "$P_CLI tls13_kex_modes=psk" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1704 | 0 |
| 1705 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1706 | run_test "TLS 1.3, key exchange mode parameter passing: PSK-ephemeral only" \ |
| 1707 | "$P_SRV tls13_kex_modes=psk_ephemeral" \ |
| 1708 | "$P_CLI tls13_kex_modes=psk_ephemeral" \ |
| 1709 | 0 |
| 1710 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1711 | 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] | 1712 | "$P_SRV tls13_kex_modes=ephemeral" \ |
| 1713 | "$P_CLI tls13_kex_modes=ephemeral" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1714 | 0 |
| 1715 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1716 | run_test "TLS 1.3, key exchange mode parameter passing: All ephemeral" \ |
| 1717 | "$P_SRV tls13_kex_modes=ephemeral_all" \ |
| 1718 | "$P_CLI tls13_kex_modes=ephemeral_all" \ |
| 1719 | 0 |
| 1720 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1721 | run_test "TLS 1.3, key exchange mode parameter passing: All PSK" \ |
| 1722 | "$P_SRV tls13_kex_modes=psk_all" \ |
| 1723 | "$P_CLI tls13_kex_modes=psk_all" \ |
| 1724 | 0 |
| 1725 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1726 | run_test "TLS 1.3, key exchange mode parameter passing: All" \ |
| 1727 | "$P_SRV tls13_kex_modes=all" \ |
| 1728 | "$P_CLI tls13_kex_modes=all" \ |
| 1729 | 0 |
| 1730 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1731 | # Tests for datagram packing |
| 1732 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1733 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1734 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1735 | 0 \ |
| 1736 | -c "next record in same datagram" \ |
| 1737 | -s "next record in same datagram" |
| 1738 | |
| 1739 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1740 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1741 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1742 | 0 \ |
| 1743 | -s "next record in same datagram" \ |
| 1744 | -C "next record in same datagram" |
| 1745 | |
| 1746 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1747 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1748 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1749 | 0 \ |
| 1750 | -S "next record in same datagram" \ |
| 1751 | -c "next record in same datagram" |
| 1752 | |
| 1753 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1754 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1755 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1756 | 0 \ |
| 1757 | -S "next record in same datagram" \ |
| 1758 | -C "next record in same datagram" |
| 1759 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1760 | # Tests for Context serialization |
| 1761 | |
| 1762 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1763 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1764 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1765 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1766 | 0 \ |
| 1767 | -c "Deserializing connection..." \ |
| 1768 | -S "Deserializing connection..." |
| 1769 | |
| 1770 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1771 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 1772 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1773 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1774 | 0 \ |
| 1775 | -c "Deserializing connection..." \ |
| 1776 | -S "Deserializing connection..." |
| 1777 | |
| 1778 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1779 | run_test "Context serialization, client serializes, GCM" \ |
| 1780 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1781 | "$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] | 1782 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1783 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1784 | -S "Deserializing connection..." |
| 1785 | |
| 1786 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1787 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1788 | run_test "Context serialization, client serializes, with CID" \ |
| 1789 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1790 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1791 | 0 \ |
| 1792 | -c "Deserializing connection..." \ |
| 1793 | -S "Deserializing connection..." |
| 1794 | |
| 1795 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1796 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1797 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1798 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1799 | 0 \ |
| 1800 | -C "Deserializing connection..." \ |
| 1801 | -s "Deserializing connection..." |
| 1802 | |
| 1803 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1804 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 1805 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1806 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1807 | 0 \ |
| 1808 | -C "Deserializing connection..." \ |
| 1809 | -s "Deserializing connection..." |
| 1810 | |
| 1811 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1812 | run_test "Context serialization, server serializes, GCM" \ |
| 1813 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1814 | "$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] | 1815 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1816 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1817 | -s "Deserializing connection..." |
| 1818 | |
| 1819 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1820 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1821 | run_test "Context serialization, server serializes, with CID" \ |
| 1822 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1823 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1824 | 0 \ |
| 1825 | -C "Deserializing connection..." \ |
| 1826 | -s "Deserializing connection..." |
| 1827 | |
| 1828 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1829 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1830 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1831 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1832 | 0 \ |
| 1833 | -c "Deserializing connection..." \ |
| 1834 | -s "Deserializing connection..." |
| 1835 | |
| 1836 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1837 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 1838 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1839 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1840 | 0 \ |
| 1841 | -c "Deserializing connection..." \ |
| 1842 | -s "Deserializing connection..." |
| 1843 | |
| 1844 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1845 | run_test "Context serialization, both serialize, GCM" \ |
| 1846 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1847 | "$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] | 1848 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1849 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1850 | -s "Deserializing connection..." |
| 1851 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1852 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1853 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1854 | run_test "Context serialization, both serialize, with CID" \ |
| 1855 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1856 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1857 | 0 \ |
| 1858 | -c "Deserializing connection..." \ |
| 1859 | -s "Deserializing connection..." |
| 1860 | |
| 1861 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1862 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1863 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1864 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1865 | 0 \ |
| 1866 | -c "Deserializing connection..." \ |
| 1867 | -S "Deserializing connection..." |
| 1868 | |
| 1869 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1870 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 1871 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1872 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1873 | 0 \ |
| 1874 | -c "Deserializing connection..." \ |
| 1875 | -S "Deserializing connection..." |
| 1876 | |
| 1877 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1878 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 1879 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1880 | "$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] | 1881 | 0 \ |
| 1882 | -c "Deserializing connection..." \ |
| 1883 | -S "Deserializing connection..." |
| 1884 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1885 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1886 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1887 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 1888 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1889 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1890 | 0 \ |
| 1891 | -c "Deserializing connection..." \ |
| 1892 | -S "Deserializing connection..." |
| 1893 | |
| 1894 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1895 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1896 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1897 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1898 | 0 \ |
| 1899 | -C "Deserializing connection..." \ |
| 1900 | -s "Deserializing connection..." |
| 1901 | |
| 1902 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1903 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 1904 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1905 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1906 | 0 \ |
| 1907 | -C "Deserializing connection..." \ |
| 1908 | -s "Deserializing connection..." |
| 1909 | |
| 1910 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1911 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 1912 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1913 | "$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] | 1914 | 0 \ |
| 1915 | -C "Deserializing connection..." \ |
| 1916 | -s "Deserializing connection..." |
| 1917 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1918 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1919 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1920 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 1921 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1922 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1923 | 0 \ |
| 1924 | -C "Deserializing connection..." \ |
| 1925 | -s "Deserializing connection..." |
| 1926 | |
| 1927 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1928 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1929 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1930 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1931 | 0 \ |
| 1932 | -c "Deserializing connection..." \ |
| 1933 | -s "Deserializing connection..." |
| 1934 | |
| 1935 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1936 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 1937 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1938 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1939 | 0 \ |
| 1940 | -c "Deserializing connection..." \ |
| 1941 | -s "Deserializing connection..." |
| 1942 | |
| 1943 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1944 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 1945 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1946 | "$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] | 1947 | 0 \ |
| 1948 | -c "Deserializing connection..." \ |
| 1949 | -s "Deserializing connection..." |
| 1950 | |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1951 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1952 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1953 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 1954 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1955 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1956 | 0 \ |
| 1957 | -c "Deserializing connection..." \ |
| 1958 | -s "Deserializing connection..." |
| 1959 | |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1960 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1961 | run_test "Saving the serialized context to a file" \ |
| 1962 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 1963 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 1964 | 0 \ |
| 1965 | -s "Save serialized context to a file... ok" \ |
| 1966 | -c "Save serialized context to a file... ok" |
| 1967 | rm -f context_srv.txt |
| 1968 | rm -f context_cli.txt |
| 1969 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1970 | # Tests for DTLS Connection ID extension |
| 1971 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1972 | # So far, the CID API isn't implemented, so we can't |
| 1973 | # grep for output witnessing its use. This needs to be |
| 1974 | # changed once the CID extension is implemented. |
| 1975 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1976 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1977 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1978 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 1979 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1980 | 0 \ |
| 1981 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1982 | -s "found CID extension" \ |
| 1983 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1984 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1985 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1986 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1987 | -C "found CID extension" \ |
| 1988 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1989 | -C "Copy CIDs into SSL transform" \ |
| 1990 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1991 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1992 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1993 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1994 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1995 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 1996 | 0 \ |
| 1997 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1998 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1999 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2000 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2001 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2002 | -C "found CID extension" \ |
| 2003 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2004 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 2005 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2006 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2007 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2008 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2009 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2010 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 2011 | 0 \ |
| 2012 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2013 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2014 | -c "client hello, adding CID extension" \ |
| 2015 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2016 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2017 | -s "server hello, adding CID extension" \ |
| 2018 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2019 | -c "Use of CID extension negotiated" \ |
| 2020 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2021 | -c "Copy CIDs into SSL transform" \ |
| 2022 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2023 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2024 | -s "Use of Connection ID has been negotiated" \ |
| 2025 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2026 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2027 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2028 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2029 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2030 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 2031 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 2032 | 0 \ |
| 2033 | -c "Enable use of CID extension." \ |
| 2034 | -s "Enable use of CID extension." \ |
| 2035 | -c "client hello, adding CID extension" \ |
| 2036 | -s "found CID extension" \ |
| 2037 | -s "Use of CID extension negotiated" \ |
| 2038 | -s "server hello, adding CID extension" \ |
| 2039 | -c "found CID extension" \ |
| 2040 | -c "Use of CID extension negotiated" \ |
| 2041 | -s "Copy CIDs into SSL transform" \ |
| 2042 | -c "Copy CIDs into SSL transform" \ |
| 2043 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2044 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2045 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2046 | -c "Use of Connection ID has been negotiated" \ |
| 2047 | -c "ignoring unexpected CID" \ |
| 2048 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2049 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2050 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2051 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 2052 | -p "$P_PXY mtu=800" \ |
| 2053 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2054 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2055 | 0 \ |
| 2056 | -c "Enable use of CID extension." \ |
| 2057 | -s "Enable use of CID extension." \ |
| 2058 | -c "client hello, adding CID extension" \ |
| 2059 | -s "found CID extension" \ |
| 2060 | -s "Use of CID extension negotiated" \ |
| 2061 | -s "server hello, adding CID extension" \ |
| 2062 | -c "found CID extension" \ |
| 2063 | -c "Use of CID extension negotiated" \ |
| 2064 | -s "Copy CIDs into SSL transform" \ |
| 2065 | -c "Copy CIDs into SSL transform" \ |
| 2066 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2067 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2068 | -s "Use of Connection ID has been negotiated" \ |
| 2069 | -c "Use of Connection ID has been negotiated" |
| 2070 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2071 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2072 | 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] | 2073 | -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] | 2074 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2075 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2076 | 0 \ |
| 2077 | -c "Enable use of CID extension." \ |
| 2078 | -s "Enable use of CID extension." \ |
| 2079 | -c "client hello, adding CID extension" \ |
| 2080 | -s "found CID extension" \ |
| 2081 | -s "Use of CID extension negotiated" \ |
| 2082 | -s "server hello, adding CID extension" \ |
| 2083 | -c "found CID extension" \ |
| 2084 | -c "Use of CID extension negotiated" \ |
| 2085 | -s "Copy CIDs into SSL transform" \ |
| 2086 | -c "Copy CIDs into SSL transform" \ |
| 2087 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2088 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2089 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2090 | -c "Use of Connection ID has been negotiated" \ |
| 2091 | -c "ignoring unexpected CID" \ |
| 2092 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2093 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2094 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2095 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2096 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2097 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2098 | 0 \ |
| 2099 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2100 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2101 | -c "client hello, adding CID extension" \ |
| 2102 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2103 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2104 | -s "server hello, adding CID extension" \ |
| 2105 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2106 | -c "Use of CID extension negotiated" \ |
| 2107 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2108 | -c "Copy CIDs into SSL transform" \ |
| 2109 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2110 | -s "Peer CID (length 0 Bytes):" \ |
| 2111 | -s "Use of Connection ID has been negotiated" \ |
| 2112 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2113 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2114 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2115 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2116 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2117 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2118 | 0 \ |
| 2119 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2120 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2121 | -c "client hello, adding CID extension" \ |
| 2122 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2123 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2124 | -s "server hello, adding CID extension" \ |
| 2125 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2126 | -c "Use of CID extension negotiated" \ |
| 2127 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2128 | -c "Copy CIDs into SSL transform" \ |
| 2129 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2130 | -c "Peer CID (length 0 Bytes):" \ |
| 2131 | -s "Use of Connection ID has been negotiated" \ |
| 2132 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2133 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2134 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2135 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2136 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2137 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2138 | 0 \ |
| 2139 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2140 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2141 | -c "client hello, adding CID extension" \ |
| 2142 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2143 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2144 | -s "server hello, adding CID extension" \ |
| 2145 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2146 | -c "Use of CID extension negotiated" \ |
| 2147 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2148 | -c "Copy CIDs into SSL transform" \ |
| 2149 | -S "Use of Connection ID has been negotiated" \ |
| 2150 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2151 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2152 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2153 | 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] | 2154 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2155 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2156 | 0 \ |
| 2157 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2158 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2159 | -c "client hello, adding CID extension" \ |
| 2160 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2161 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2162 | -s "server hello, adding CID extension" \ |
| 2163 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2164 | -c "Use of CID extension negotiated" \ |
| 2165 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2166 | -c "Copy CIDs into SSL transform" \ |
| 2167 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2168 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2169 | -s "Use of Connection ID has been negotiated" \ |
| 2170 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2171 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2172 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2173 | 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] | 2174 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2175 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2176 | 0 \ |
| 2177 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2178 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2179 | -c "client hello, adding CID extension" \ |
| 2180 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2181 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2182 | -s "server hello, adding CID extension" \ |
| 2183 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2184 | -c "Use of CID extension negotiated" \ |
| 2185 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2186 | -c "Copy CIDs into SSL transform" \ |
| 2187 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2188 | -s "Peer CID (length 0 Bytes):" \ |
| 2189 | -s "Use of Connection ID has been negotiated" \ |
| 2190 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2191 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2192 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2193 | 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] | 2194 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2195 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2196 | 0 \ |
| 2197 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2198 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2199 | -c "client hello, adding CID extension" \ |
| 2200 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2201 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2202 | -s "server hello, adding CID extension" \ |
| 2203 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2204 | -c "Use of CID extension negotiated" \ |
| 2205 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2206 | -c "Copy CIDs into SSL transform" \ |
| 2207 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2208 | -c "Peer CID (length 0 Bytes):" \ |
| 2209 | -s "Use of Connection ID has been negotiated" \ |
| 2210 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2211 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2212 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2213 | 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] | 2214 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2215 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2216 | 0 \ |
| 2217 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2218 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2219 | -c "client hello, adding CID extension" \ |
| 2220 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2221 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2222 | -s "server hello, adding CID extension" \ |
| 2223 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2224 | -c "Use of CID extension negotiated" \ |
| 2225 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2226 | -c "Copy CIDs into SSL transform" \ |
| 2227 | -S "Use of Connection ID has been negotiated" \ |
| 2228 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2229 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2230 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2231 | 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] | 2232 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2233 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2234 | 0 \ |
| 2235 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2236 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2237 | -c "client hello, adding CID extension" \ |
| 2238 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2239 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2240 | -s "server hello, adding CID extension" \ |
| 2241 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2242 | -c "Use of CID extension negotiated" \ |
| 2243 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2244 | -c "Copy CIDs into SSL transform" \ |
| 2245 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2246 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2247 | -s "Use of Connection ID has been negotiated" \ |
| 2248 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2249 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2250 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2251 | 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] | 2252 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2253 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2254 | 0 \ |
| 2255 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2256 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2257 | -c "client hello, adding CID extension" \ |
| 2258 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2259 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2260 | -s "server hello, adding CID extension" \ |
| 2261 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2262 | -c "Use of CID extension negotiated" \ |
| 2263 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2264 | -c "Copy CIDs into SSL transform" \ |
| 2265 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2266 | -s "Peer CID (length 0 Bytes):" \ |
| 2267 | -s "Use of Connection ID has been negotiated" \ |
| 2268 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2269 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2270 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2271 | 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] | 2272 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2273 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2274 | 0 \ |
| 2275 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2276 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2277 | -c "client hello, adding CID extension" \ |
| 2278 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2279 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2280 | -s "server hello, adding CID extension" \ |
| 2281 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2282 | -c "Use of CID extension negotiated" \ |
| 2283 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2284 | -c "Copy CIDs into SSL transform" \ |
| 2285 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2286 | -c "Peer CID (length 0 Bytes):" \ |
| 2287 | -s "Use of Connection ID has been negotiated" \ |
| 2288 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2289 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2290 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2291 | 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] | 2292 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2293 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2294 | 0 \ |
| 2295 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2296 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2297 | -c "client hello, adding CID extension" \ |
| 2298 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2299 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2300 | -s "server hello, adding CID extension" \ |
| 2301 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2302 | -c "Use of CID extension negotiated" \ |
| 2303 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2304 | -c "Copy CIDs into SSL transform" \ |
| 2305 | -S "Use of Connection ID has been negotiated" \ |
| 2306 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2307 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2308 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 2309 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2310 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2311 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2312 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2313 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2314 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2315 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2316 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2317 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2318 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2319 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2320 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2321 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2322 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2323 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2324 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2325 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2326 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2327 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2328 | 0 \ |
| 2329 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2330 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2331 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2332 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2333 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2334 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2335 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2336 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2337 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2338 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2339 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2340 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 2341 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2342 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2343 | 0 \ |
| 2344 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2345 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2346 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2347 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2348 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2349 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2350 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2351 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2352 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2353 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2354 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2355 | 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] | 2356 | -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] | 2357 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2358 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2359 | 0 \ |
| 2360 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2361 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2362 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2363 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2364 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2365 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2366 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2367 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2368 | -c "ignoring unexpected CID" \ |
| 2369 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2370 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2371 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2372 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2373 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2374 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2375 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2376 | 0 \ |
| 2377 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2378 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2379 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2380 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2381 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2382 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2383 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2384 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2385 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2386 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2387 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2388 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 2389 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2390 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2391 | 0 \ |
| 2392 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2393 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2394 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2395 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2396 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2397 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2398 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2399 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2400 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2401 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2402 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2403 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2404 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2405 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2406 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2407 | 0 \ |
| 2408 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2409 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2410 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2411 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2412 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2413 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2414 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2415 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2416 | -c "ignoring unexpected CID" \ |
| 2417 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2418 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2419 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2420 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2421 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2422 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2423 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2424 | 0 \ |
| 2425 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2426 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2427 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2428 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2429 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2430 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2431 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2432 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2433 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2434 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 2435 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2436 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2437 | 0 \ |
| 2438 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2439 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2440 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2441 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2442 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2443 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2444 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2445 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2446 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2447 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2448 | -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] | 2449 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2450 | "$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" \ |
| 2451 | 0 \ |
| 2452 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2453 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2454 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2455 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2456 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2457 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2458 | -c "ignoring unexpected CID" \ |
| 2459 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2460 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2461 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2462 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2463 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2464 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2465 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2466 | 0 \ |
| 2467 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2468 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2469 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2470 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2471 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2472 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2473 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2474 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2475 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 2476 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2477 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2478 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2479 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2480 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2481 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2482 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2483 | 0 \ |
| 2484 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2485 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2486 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2487 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2488 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2489 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2490 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2491 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2492 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2493 | -c "ignoring unexpected CID" \ |
| 2494 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2495 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2496 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2497 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2498 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 2499 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2500 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2501 | 0 \ |
| 2502 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2503 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2504 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2505 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2506 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2507 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2508 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2509 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2510 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2511 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2512 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2513 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2514 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2515 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2516 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2517 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2518 | 0 \ |
| 2519 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2520 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2521 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2522 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2523 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2524 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2525 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2526 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2527 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2528 | -c "ignoring unexpected CID" \ |
| 2529 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2530 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 2531 | # 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] | 2532 | # tests check that the buffer contents are reallocated when the message is |
| 2533 | # larger than the buffer. |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2534 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2535 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2536 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2537 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 2538 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2539 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 2540 | 0 \ |
| 2541 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2542 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2543 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2544 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2545 | -s "Reallocating in_buf" \ |
| 2546 | -s "Reallocating out_buf" |
| 2547 | |
| 2548 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2549 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2550 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2551 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 2552 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2553 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 2554 | 0 \ |
| 2555 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2556 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2557 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2558 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2559 | -s "Reallocating in_buf" \ |
| 2560 | -s "Reallocating out_buf" |
| 2561 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2562 | # Tests for Encrypt-then-MAC extension |
| 2563 | |
| 2564 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2565 | "$P_SRV debug_level=3 \ |
| 2566 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2567 | "$P_CLI debug_level=3" \ |
| 2568 | 0 \ |
| 2569 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2570 | -s "found encrypt then mac extension" \ |
| 2571 | -s "server hello, adding encrypt then mac extension" \ |
| 2572 | -c "found encrypt_then_mac extension" \ |
| 2573 | -c "using encrypt then mac" \ |
| 2574 | -s "using encrypt then mac" |
| 2575 | |
| 2576 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2577 | "$P_SRV debug_level=3 etm=0 \ |
| 2578 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2579 | "$P_CLI debug_level=3 etm=1" \ |
| 2580 | 0 \ |
| 2581 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2582 | -s "found encrypt then mac extension" \ |
| 2583 | -S "server hello, adding encrypt then mac extension" \ |
| 2584 | -C "found encrypt_then_mac extension" \ |
| 2585 | -C "using encrypt then mac" \ |
| 2586 | -S "using encrypt then mac" |
| 2587 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2588 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 2589 | "$P_SRV debug_level=3 etm=1 \ |
| 2590 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 2591 | "$P_CLI debug_level=3 etm=1" \ |
| 2592 | 0 \ |
| 2593 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2594 | -s "found encrypt then mac extension" \ |
| 2595 | -S "server hello, adding encrypt then mac extension" \ |
| 2596 | -C "found encrypt_then_mac extension" \ |
| 2597 | -C "using encrypt then mac" \ |
| 2598 | -S "using encrypt then mac" |
| 2599 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2600 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2601 | "$P_SRV debug_level=3 etm=1 \ |
| 2602 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2603 | "$P_CLI debug_level=3 etm=0" \ |
| 2604 | 0 \ |
| 2605 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2606 | -S "found encrypt then mac extension" \ |
| 2607 | -S "server hello, adding encrypt then mac extension" \ |
| 2608 | -C "found encrypt_then_mac extension" \ |
| 2609 | -C "using encrypt then mac" \ |
| 2610 | -S "using encrypt then mac" |
| 2611 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2612 | # Tests for Extended Master Secret extension |
| 2613 | |
| 2614 | run_test "Extended Master Secret: default" \ |
| 2615 | "$P_SRV debug_level=3" \ |
| 2616 | "$P_CLI debug_level=3" \ |
| 2617 | 0 \ |
| 2618 | -c "client hello, adding extended_master_secret extension" \ |
| 2619 | -s "found extended master secret extension" \ |
| 2620 | -s "server hello, adding extended master secret extension" \ |
| 2621 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2622 | -c "session hash for extended master secret" \ |
| 2623 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2624 | |
| 2625 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 2626 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 2627 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 2628 | 0 \ |
| 2629 | -c "client hello, adding extended_master_secret extension" \ |
| 2630 | -s "found extended master secret extension" \ |
| 2631 | -S "server hello, adding extended master secret extension" \ |
| 2632 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2633 | -C "session hash for extended master secret" \ |
| 2634 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2635 | |
| 2636 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 2637 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 2638 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 2639 | 0 \ |
| 2640 | -C "client hello, adding extended_master_secret extension" \ |
| 2641 | -S "found extended master secret extension" \ |
| 2642 | -S "server hello, adding extended master secret extension" \ |
| 2643 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2644 | -C "session hash for extended master secret" \ |
| 2645 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2646 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2647 | # Test sending and receiving empty application data records |
| 2648 | |
| 2649 | run_test "Encrypt then MAC: empty application data record" \ |
| 2650 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 2651 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 2652 | 0 \ |
| 2653 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2654 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2655 | -c "0 bytes written in 1 fragments" |
| 2656 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2657 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2658 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 2659 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 2660 | 0 \ |
| 2661 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2662 | -c "0 bytes written in 1 fragments" |
| 2663 | |
| 2664 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 2665 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 2666 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 2667 | 0 \ |
| 2668 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2669 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2670 | -c "0 bytes written in 1 fragments" |
| 2671 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2672 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2673 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 2674 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 2675 | 0 \ |
| 2676 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2677 | -c "0 bytes written in 1 fragments" |
| 2678 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2679 | # Tests for CBC 1/n-1 record splitting |
| 2680 | |
| 2681 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 2682 | "$P_SRV" \ |
| 2683 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 2684 | request_size=123 force_version=tls12" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2685 | 0 \ |
| 2686 | -s "Read from client: 123 bytes read" \ |
| 2687 | -S "Read from client: 1 bytes read" \ |
| 2688 | -S "122 bytes read" |
| 2689 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2690 | # Tests for Session Tickets |
| 2691 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2692 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2693 | "$P_SRV debug_level=3 tickets=1" \ |
| 2694 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2695 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2696 | -c "client hello, adding session ticket extension" \ |
| 2697 | -s "found session ticket extension" \ |
| 2698 | -s "server hello, adding session ticket extension" \ |
| 2699 | -c "found session_ticket extension" \ |
| 2700 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2701 | -S "session successfully restored from cache" \ |
| 2702 | -s "session successfully restored from ticket" \ |
| 2703 | -s "a session has been resumed" \ |
| 2704 | -c "a session has been resumed" |
| 2705 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2706 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2707 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2708 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2709 | 0 \ |
| 2710 | -c "client hello, adding session ticket extension" \ |
| 2711 | -s "found session ticket extension" \ |
| 2712 | -s "server hello, adding session ticket extension" \ |
| 2713 | -c "found session_ticket extension" \ |
| 2714 | -c "parse new session ticket" \ |
| 2715 | -S "session successfully restored from cache" \ |
| 2716 | -s "session successfully restored from ticket" \ |
| 2717 | -s "a session has been resumed" \ |
| 2718 | -c "a session has been resumed" |
| 2719 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2720 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2721 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2722 | "$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] | 2723 | 0 \ |
| 2724 | -c "client hello, adding session ticket extension" \ |
| 2725 | -s "found session ticket extension" \ |
| 2726 | -s "server hello, adding session ticket extension" \ |
| 2727 | -c "found session_ticket extension" \ |
| 2728 | -c "parse new session ticket" \ |
| 2729 | -S "session successfully restored from cache" \ |
| 2730 | -S "session successfully restored from ticket" \ |
| 2731 | -S "a session has been resumed" \ |
| 2732 | -C "a session has been resumed" |
| 2733 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2734 | run_test "Session resume using tickets: session copy" \ |
| 2735 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2736 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 2737 | 0 \ |
| 2738 | -c "client hello, adding session ticket extension" \ |
| 2739 | -s "found session ticket extension" \ |
| 2740 | -s "server hello, adding session ticket extension" \ |
| 2741 | -c "found session_ticket extension" \ |
| 2742 | -c "parse new session ticket" \ |
| 2743 | -S "session successfully restored from cache" \ |
| 2744 | -s "session successfully restored from ticket" \ |
| 2745 | -s "a session has been resumed" \ |
| 2746 | -c "a session has been resumed" |
| 2747 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2748 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2749 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2750 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2751 | 0 \ |
| 2752 | -c "client hello, adding session ticket extension" \ |
| 2753 | -c "found session_ticket extension" \ |
| 2754 | -c "parse new session ticket" \ |
| 2755 | -c "a session has been resumed" |
| 2756 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2757 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2758 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2759 | "( $O_CLI -sess_out $SESSION; \ |
| 2760 | $O_CLI -sess_in $SESSION; \ |
| 2761 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2762 | 0 \ |
| 2763 | -s "found session ticket extension" \ |
| 2764 | -s "server hello, adding session ticket extension" \ |
| 2765 | -S "session successfully restored from cache" \ |
| 2766 | -s "session successfully restored from ticket" \ |
| 2767 | -s "a session has been resumed" |
| 2768 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2769 | # Tests for Session Tickets with DTLS |
| 2770 | |
| 2771 | run_test "Session resume using tickets, DTLS: basic" \ |
| 2772 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2773 | "$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] | 2774 | 0 \ |
| 2775 | -c "client hello, adding session ticket extension" \ |
| 2776 | -s "found session ticket extension" \ |
| 2777 | -s "server hello, adding session ticket extension" \ |
| 2778 | -c "found session_ticket extension" \ |
| 2779 | -c "parse new session ticket" \ |
| 2780 | -S "session successfully restored from cache" \ |
| 2781 | -s "session successfully restored from ticket" \ |
| 2782 | -s "a session has been resumed" \ |
| 2783 | -c "a session has been resumed" |
| 2784 | |
| 2785 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 2786 | "$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] | 2787 | "$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] | 2788 | 0 \ |
| 2789 | -c "client hello, adding session ticket extension" \ |
| 2790 | -s "found session ticket extension" \ |
| 2791 | -s "server hello, adding session ticket extension" \ |
| 2792 | -c "found session_ticket extension" \ |
| 2793 | -c "parse new session ticket" \ |
| 2794 | -S "session successfully restored from cache" \ |
| 2795 | -s "session successfully restored from ticket" \ |
| 2796 | -s "a session has been resumed" \ |
| 2797 | -c "a session has been resumed" |
| 2798 | |
| 2799 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 2800 | "$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] | 2801 | "$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] | 2802 | 0 \ |
| 2803 | -c "client hello, adding session ticket extension" \ |
| 2804 | -s "found session ticket extension" \ |
| 2805 | -s "server hello, adding session ticket extension" \ |
| 2806 | -c "found session_ticket extension" \ |
| 2807 | -c "parse new session ticket" \ |
| 2808 | -S "session successfully restored from cache" \ |
| 2809 | -S "session successfully restored from ticket" \ |
| 2810 | -S "a session has been resumed" \ |
| 2811 | -C "a session has been resumed" |
| 2812 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2813 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 2814 | "$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] | 2815 | "$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] | 2816 | 0 \ |
| 2817 | -c "client hello, adding session ticket extension" \ |
| 2818 | -s "found session ticket extension" \ |
| 2819 | -s "server hello, adding session ticket extension" \ |
| 2820 | -c "found session_ticket extension" \ |
| 2821 | -c "parse new session ticket" \ |
| 2822 | -S "session successfully restored from cache" \ |
| 2823 | -s "session successfully restored from ticket" \ |
| 2824 | -s "a session has been resumed" \ |
| 2825 | -c "a session has been resumed" |
| 2826 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2827 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 2828 | "$O_SRV -dtls" \ |
| 2829 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 2830 | 0 \ |
| 2831 | -c "client hello, adding session ticket extension" \ |
| 2832 | -c "found session_ticket extension" \ |
| 2833 | -c "parse new session ticket" \ |
| 2834 | -c "a session has been resumed" |
| 2835 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 2836 | # 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] | 2837 | # 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] | 2838 | requires_openssl_next |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2839 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 2840 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 2841 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 2842 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2843 | rm -f $SESSION )" \ |
| 2844 | 0 \ |
| 2845 | -s "found session ticket extension" \ |
| 2846 | -s "server hello, adding session ticket extension" \ |
| 2847 | -S "session successfully restored from cache" \ |
| 2848 | -s "session successfully restored from ticket" \ |
| 2849 | -s "a session has been resumed" |
| 2850 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2851 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2852 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2853 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2854 | "$P_SRV debug_level=3 tickets=0" \ |
| 2855 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2856 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2857 | -c "client hello, adding session ticket extension" \ |
| 2858 | -s "found session ticket extension" \ |
| 2859 | -S "server hello, adding session ticket extension" \ |
| 2860 | -C "found session_ticket extension" \ |
| 2861 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2862 | -s "session successfully restored from cache" \ |
| 2863 | -S "session successfully restored from ticket" \ |
| 2864 | -s "a session has been resumed" \ |
| 2865 | -c "a session has been resumed" |
| 2866 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2867 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2868 | "$P_SRV debug_level=3 tickets=1" \ |
| 2869 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2870 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2871 | -C "client hello, adding session ticket extension" \ |
| 2872 | -S "found session ticket extension" \ |
| 2873 | -S "server hello, adding session ticket extension" \ |
| 2874 | -C "found session_ticket extension" \ |
| 2875 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2876 | -s "session successfully restored from cache" \ |
| 2877 | -S "session successfully restored from ticket" \ |
| 2878 | -s "a session has been resumed" \ |
| 2879 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2880 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2881 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2882 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 2883 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2884 | 0 \ |
| 2885 | -S "session successfully restored from cache" \ |
| 2886 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2887 | -S "a session has been resumed" \ |
| 2888 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2889 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2890 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2891 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 2892 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2893 | 0 \ |
| 2894 | -s "session successfully restored from cache" \ |
| 2895 | -S "session successfully restored from ticket" \ |
| 2896 | -s "a session has been resumed" \ |
| 2897 | -c "a session has been resumed" |
| 2898 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 2899 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2900 | "$P_SRV debug_level=3 tickets=0" \ |
| 2901 | "$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] | 2902 | 0 \ |
| 2903 | -s "session successfully restored from cache" \ |
| 2904 | -S "session successfully restored from ticket" \ |
| 2905 | -s "a session has been resumed" \ |
| 2906 | -c "a session has been resumed" |
| 2907 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2908 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2909 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 2910 | "$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] | 2911 | 0 \ |
| 2912 | -S "session successfully restored from cache" \ |
| 2913 | -S "session successfully restored from ticket" \ |
| 2914 | -S "a session has been resumed" \ |
| 2915 | -C "a session has been resumed" |
| 2916 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2917 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2918 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 2919 | "$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] | 2920 | 0 \ |
| 2921 | -s "session successfully restored from cache" \ |
| 2922 | -S "session successfully restored from ticket" \ |
| 2923 | -s "a session has been resumed" \ |
| 2924 | -c "a session has been resumed" |
| 2925 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2926 | run_test "Session resume using cache: session copy" \ |
| 2927 | "$P_SRV debug_level=3 tickets=0" \ |
| 2928 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 2929 | 0 \ |
| 2930 | -s "session successfully restored from cache" \ |
| 2931 | -S "session successfully restored from ticket" \ |
| 2932 | -s "a session has been resumed" \ |
| 2933 | -c "a session has been resumed" |
| 2934 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2935 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2936 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2937 | "( $O_CLI -sess_out $SESSION; \ |
| 2938 | $O_CLI -sess_in $SESSION; \ |
| 2939 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2940 | 0 \ |
| 2941 | -s "found session ticket extension" \ |
| 2942 | -S "server hello, adding session ticket extension" \ |
| 2943 | -s "session successfully restored from cache" \ |
| 2944 | -S "session successfully restored from ticket" \ |
| 2945 | -s "a session has been resumed" |
| 2946 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2947 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2948 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2949 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2950 | 0 \ |
| 2951 | -C "found session_ticket extension" \ |
| 2952 | -C "parse new session ticket" \ |
| 2953 | -c "a session has been resumed" |
| 2954 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2955 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 2956 | |
| 2957 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 2958 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2959 | "$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] | 2960 | 0 \ |
| 2961 | -c "client hello, adding session ticket extension" \ |
| 2962 | -s "found session ticket extension" \ |
| 2963 | -S "server hello, adding session ticket extension" \ |
| 2964 | -C "found session_ticket extension" \ |
| 2965 | -C "parse new session ticket" \ |
| 2966 | -s "session successfully restored from cache" \ |
| 2967 | -S "session successfully restored from ticket" \ |
| 2968 | -s "a session has been resumed" \ |
| 2969 | -c "a session has been resumed" |
| 2970 | |
| 2971 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 2972 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2973 | "$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] | 2974 | 0 \ |
| 2975 | -C "client hello, adding session ticket extension" \ |
| 2976 | -S "found session ticket extension" \ |
| 2977 | -S "server hello, adding session ticket extension" \ |
| 2978 | -C "found session_ticket extension" \ |
| 2979 | -C "parse new session ticket" \ |
| 2980 | -s "session successfully restored from cache" \ |
| 2981 | -S "session successfully restored from ticket" \ |
| 2982 | -s "a session has been resumed" \ |
| 2983 | -c "a session has been resumed" |
| 2984 | |
| 2985 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 2986 | "$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] | 2987 | "$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] | 2988 | 0 \ |
| 2989 | -S "session successfully restored from cache" \ |
| 2990 | -S "session successfully restored from ticket" \ |
| 2991 | -S "a session has been resumed" \ |
| 2992 | -C "a session has been resumed" |
| 2993 | |
| 2994 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 2995 | "$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] | 2996 | "$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] | 2997 | 0 \ |
| 2998 | -s "session successfully restored from cache" \ |
| 2999 | -S "session successfully restored from ticket" \ |
| 3000 | -s "a session has been resumed" \ |
| 3001 | -c "a session has been resumed" |
| 3002 | |
| 3003 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 3004 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3005 | "$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] | 3006 | 0 \ |
| 3007 | -s "session successfully restored from cache" \ |
| 3008 | -S "session successfully restored from ticket" \ |
| 3009 | -s "a session has been resumed" \ |
| 3010 | -c "a session has been resumed" |
| 3011 | |
| 3012 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 3013 | "$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] | 3014 | "$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] | 3015 | 0 \ |
| 3016 | -S "session successfully restored from cache" \ |
| 3017 | -S "session successfully restored from ticket" \ |
| 3018 | -S "a session has been resumed" \ |
| 3019 | -C "a session has been resumed" |
| 3020 | |
| 3021 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 3022 | "$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] | 3023 | "$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] | 3024 | 0 \ |
| 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 cache, DTLS: session copy" \ |
| 3031 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3032 | "$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] | 3033 | 0 \ |
| 3034 | -s "session successfully restored from cache" \ |
| 3035 | -S "session successfully restored from ticket" \ |
| 3036 | -s "a session has been resumed" \ |
| 3037 | -c "a session has been resumed" |
| 3038 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3039 | # 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] | 3040 | # 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] | 3041 | requires_openssl_next |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3042 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 3043 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3044 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 3045 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3046 | rm -f $SESSION )" \ |
| 3047 | 0 \ |
| 3048 | -s "found session ticket extension" \ |
| 3049 | -S "server hello, adding session ticket extension" \ |
| 3050 | -s "session successfully restored from cache" \ |
| 3051 | -S "session successfully restored from ticket" \ |
| 3052 | -s "a session has been resumed" |
| 3053 | |
| 3054 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 3055 | "$O_SRV -dtls" \ |
| 3056 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 3057 | 0 \ |
| 3058 | -C "found session_ticket extension" \ |
| 3059 | -C "parse new session ticket" \ |
| 3060 | -c "a session has been resumed" |
| 3061 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3062 | # Tests for Max Fragment Length extension |
| 3063 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3064 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3065 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3066 | "$P_SRV debug_level=3" \ |
| 3067 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3068 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3069 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3070 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3071 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3072 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3073 | -C "client hello, adding max_fragment_length extension" \ |
| 3074 | -S "found max fragment length extension" \ |
| 3075 | -S "server hello, max_fragment_length extension" \ |
| 3076 | -C "found max_fragment_length extension" |
| 3077 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3078 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3079 | run_test "Max fragment length: enabled, default, larger message" \ |
| 3080 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3081 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3082 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3083 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3084 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3085 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3086 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3087 | -C "client hello, adding max_fragment_length extension" \ |
| 3088 | -S "found max fragment length extension" \ |
| 3089 | -S "server hello, max_fragment_length extension" \ |
| 3090 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3091 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3092 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3093 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3094 | |
| 3095 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3096 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 3097 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3098 | "$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] | 3099 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3100 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3101 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3102 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3103 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3104 | -C "client hello, adding max_fragment_length extension" \ |
| 3105 | -S "found max fragment length extension" \ |
| 3106 | -S "server hello, max_fragment_length extension" \ |
| 3107 | -C "found max_fragment_length extension" \ |
| 3108 | -c "fragment larger than.*maximum " |
| 3109 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3110 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 3111 | # (session fragment length will be 16384 regardless of mbedtls |
| 3112 | # content length configuration.) |
| 3113 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3114 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3115 | run_test "Max fragment length: disabled, larger message" \ |
| 3116 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3117 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3118 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3119 | -C "Maximum incoming record payload length is 16384" \ |
| 3120 | -C "Maximum outgoing record payload length is 16384" \ |
| 3121 | -S "Maximum incoming record payload length is 16384" \ |
| 3122 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3123 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3124 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3125 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3126 | |
| 3127 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 3128 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3129 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3130 | "$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] | 3131 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3132 | -C "Maximum incoming record payload length is 16384" \ |
| 3133 | -C "Maximum outgoing record payload length is 16384" \ |
| 3134 | -S "Maximum incoming record payload length is 16384" \ |
| 3135 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3136 | -c "fragment larger than.*maximum " |
| 3137 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3138 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3139 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3140 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3141 | "$P_SRV debug_level=3" \ |
| 3142 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3143 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3144 | -c "Maximum incoming record payload length is 4096" \ |
| 3145 | -c "Maximum outgoing record payload length is 4096" \ |
| 3146 | -s "Maximum incoming record payload length is 4096" \ |
| 3147 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3148 | -c "client hello, adding max_fragment_length extension" \ |
| 3149 | -s "found max fragment length extension" \ |
| 3150 | -s "server hello, max_fragment_length extension" \ |
| 3151 | -c "found max_fragment_length extension" |
| 3152 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3153 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3154 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3155 | run_test "Max fragment length: client 512, server 1024" \ |
| 3156 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3157 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3158 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3159 | -c "Maximum incoming record payload length is 512" \ |
| 3160 | -c "Maximum outgoing record payload length is 512" \ |
| 3161 | -s "Maximum incoming record payload length is 512" \ |
| 3162 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3163 | -c "client hello, adding max_fragment_length extension" \ |
| 3164 | -s "found max fragment length extension" \ |
| 3165 | -s "server hello, max_fragment_length extension" \ |
| 3166 | -c "found max_fragment_length extension" |
| 3167 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3168 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3169 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3170 | run_test "Max fragment length: client 512, server 2048" \ |
| 3171 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3172 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3173 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3174 | -c "Maximum incoming record payload length is 512" \ |
| 3175 | -c "Maximum outgoing record payload length is 512" \ |
| 3176 | -s "Maximum incoming record payload length is 512" \ |
| 3177 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3178 | -c "client hello, adding max_fragment_length extension" \ |
| 3179 | -s "found max fragment length extension" \ |
| 3180 | -s "server hello, max_fragment_length extension" \ |
| 3181 | -c "found max_fragment_length extension" |
| 3182 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3183 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3184 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3185 | run_test "Max fragment length: client 512, server 4096" \ |
| 3186 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3187 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3188 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3189 | -c "Maximum incoming record payload length is 512" \ |
| 3190 | -c "Maximum outgoing record payload length is 512" \ |
| 3191 | -s "Maximum incoming record payload length is 512" \ |
| 3192 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3193 | -c "client hello, adding max_fragment_length extension" \ |
| 3194 | -s "found max fragment length extension" \ |
| 3195 | -s "server hello, max_fragment_length extension" \ |
| 3196 | -c "found max_fragment_length extension" |
| 3197 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3198 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3199 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3200 | run_test "Max fragment length: client 1024, server 512" \ |
| 3201 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3202 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3203 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3204 | -c "Maximum incoming record payload length is 1024" \ |
| 3205 | -c "Maximum outgoing record payload length is 1024" \ |
| 3206 | -s "Maximum incoming record payload length is 1024" \ |
| 3207 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3208 | -c "client hello, adding max_fragment_length extension" \ |
| 3209 | -s "found max fragment length extension" \ |
| 3210 | -s "server hello, max_fragment_length extension" \ |
| 3211 | -c "found max_fragment_length extension" |
| 3212 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3213 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3214 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3215 | run_test "Max fragment length: client 1024, server 2048" \ |
| 3216 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3217 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3218 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3219 | -c "Maximum incoming record payload length is 1024" \ |
| 3220 | -c "Maximum outgoing record payload length is 1024" \ |
| 3221 | -s "Maximum incoming record payload length is 1024" \ |
| 3222 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3223 | -c "client hello, adding max_fragment_length extension" \ |
| 3224 | -s "found max fragment length extension" \ |
| 3225 | -s "server hello, max_fragment_length extension" \ |
| 3226 | -c "found max_fragment_length extension" |
| 3227 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3228 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3229 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3230 | run_test "Max fragment length: client 1024, server 4096" \ |
| 3231 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3232 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3233 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3234 | -c "Maximum incoming record payload length is 1024" \ |
| 3235 | -c "Maximum outgoing record payload length is 1024" \ |
| 3236 | -s "Maximum incoming record payload length is 1024" \ |
| 3237 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3238 | -c "client hello, adding max_fragment_length extension" \ |
| 3239 | -s "found max fragment length extension" \ |
| 3240 | -s "server hello, max_fragment_length extension" \ |
| 3241 | -c "found max_fragment_length extension" |
| 3242 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3243 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3244 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3245 | run_test "Max fragment length: client 2048, server 512" \ |
| 3246 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3247 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3248 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3249 | -c "Maximum incoming record payload length is 2048" \ |
| 3250 | -c "Maximum outgoing record payload length is 2048" \ |
| 3251 | -s "Maximum incoming record payload length is 2048" \ |
| 3252 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3253 | -c "client hello, adding max_fragment_length extension" \ |
| 3254 | -s "found max fragment length extension" \ |
| 3255 | -s "server hello, max_fragment_length extension" \ |
| 3256 | -c "found max_fragment_length extension" |
| 3257 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3258 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3259 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3260 | run_test "Max fragment length: client 2048, server 1024" \ |
| 3261 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3262 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3263 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3264 | -c "Maximum incoming record payload length is 2048" \ |
| 3265 | -c "Maximum outgoing record payload length is 2048" \ |
| 3266 | -s "Maximum incoming record payload length is 2048" \ |
| 3267 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3268 | -c "client hello, adding max_fragment_length extension" \ |
| 3269 | -s "found max fragment length extension" \ |
| 3270 | -s "server hello, max_fragment_length extension" \ |
| 3271 | -c "found max_fragment_length extension" |
| 3272 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3273 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3274 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3275 | run_test "Max fragment length: client 2048, server 4096" \ |
| 3276 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3277 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3278 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3279 | -c "Maximum incoming record payload length is 2048" \ |
| 3280 | -c "Maximum outgoing record payload length is 2048" \ |
| 3281 | -s "Maximum incoming record payload length is 2048" \ |
| 3282 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3283 | -c "client hello, adding max_fragment_length extension" \ |
| 3284 | -s "found max fragment length extension" \ |
| 3285 | -s "server hello, max_fragment_length extension" \ |
| 3286 | -c "found max_fragment_length extension" |
| 3287 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3288 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3289 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3290 | run_test "Max fragment length: client 4096, server 512" \ |
| 3291 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3292 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3293 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3294 | -c "Maximum incoming record payload length is 4096" \ |
| 3295 | -c "Maximum outgoing record payload length is 4096" \ |
| 3296 | -s "Maximum incoming record payload length is 4096" \ |
| 3297 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3298 | -c "client hello, adding max_fragment_length extension" \ |
| 3299 | -s "found max fragment length extension" \ |
| 3300 | -s "server hello, max_fragment_length extension" \ |
| 3301 | -c "found max_fragment_length extension" |
| 3302 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3303 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3304 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3305 | run_test "Max fragment length: client 4096, server 1024" \ |
| 3306 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3307 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3308 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3309 | -c "Maximum incoming record payload length is 4096" \ |
| 3310 | -c "Maximum outgoing record payload length is 4096" \ |
| 3311 | -s "Maximum incoming record payload length is 4096" \ |
| 3312 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3313 | -c "client hello, adding max_fragment_length extension" \ |
| 3314 | -s "found max fragment length extension" \ |
| 3315 | -s "server hello, max_fragment_length extension" \ |
| 3316 | -c "found max_fragment_length extension" |
| 3317 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3318 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3319 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3320 | run_test "Max fragment length: client 4096, server 2048" \ |
| 3321 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3322 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3323 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3324 | -c "Maximum incoming record payload length is 4096" \ |
| 3325 | -c "Maximum outgoing record payload length is 4096" \ |
| 3326 | -s "Maximum incoming record payload length is 4096" \ |
| 3327 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3328 | -c "client hello, adding max_fragment_length extension" \ |
| 3329 | -s "found max fragment length extension" \ |
| 3330 | -s "server hello, max_fragment_length extension" \ |
| 3331 | -c "found max_fragment_length extension" |
| 3332 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3333 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3334 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3335 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3336 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3337 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3338 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3339 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3340 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3341 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3342 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3343 | -C "client hello, adding max_fragment_length extension" \ |
| 3344 | -S "found max fragment length extension" \ |
| 3345 | -S "server hello, max_fragment_length extension" \ |
| 3346 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3347 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3348 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3349 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3350 | requires_gnutls |
| 3351 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3352 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3353 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3354 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3355 | -c "Maximum incoming record payload length is 4096" \ |
| 3356 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3357 | -c "client hello, adding max_fragment_length extension" \ |
| 3358 | -c "found max_fragment_length extension" |
| 3359 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3360 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3361 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3362 | run_test "Max fragment length: client, message just fits" \ |
| 3363 | "$P_SRV debug_level=3" \ |
| 3364 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 3365 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3366 | -c "Maximum incoming record payload length is 2048" \ |
| 3367 | -c "Maximum outgoing record payload length is 2048" \ |
| 3368 | -s "Maximum incoming record payload length is 2048" \ |
| 3369 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3370 | -c "client hello, adding max_fragment_length extension" \ |
| 3371 | -s "found max fragment length extension" \ |
| 3372 | -s "server hello, max_fragment_length extension" \ |
| 3373 | -c "found max_fragment_length extension" \ |
| 3374 | -c "2048 bytes written in 1 fragments" \ |
| 3375 | -s "2048 bytes read" |
| 3376 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3377 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3378 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3379 | run_test "Max fragment length: client, larger message" \ |
| 3380 | "$P_SRV debug_level=3" \ |
| 3381 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 3382 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3383 | -c "Maximum incoming record payload length is 2048" \ |
| 3384 | -c "Maximum outgoing record payload length is 2048" \ |
| 3385 | -s "Maximum incoming record payload length is 2048" \ |
| 3386 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3387 | -c "client hello, adding max_fragment_length extension" \ |
| 3388 | -s "found max fragment length extension" \ |
| 3389 | -s "server hello, max_fragment_length extension" \ |
| 3390 | -c "found max_fragment_length extension" \ |
| 3391 | -c "2345 bytes written in 2 fragments" \ |
| 3392 | -s "2048 bytes read" \ |
| 3393 | -s "297 bytes read" |
| 3394 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3395 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3396 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 3397 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3398 | "$P_SRV debug_level=3 dtls=1" \ |
| 3399 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 3400 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3401 | -c "Maximum incoming record payload length is 2048" \ |
| 3402 | -c "Maximum outgoing record payload length is 2048" \ |
| 3403 | -s "Maximum incoming record payload length is 2048" \ |
| 3404 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3405 | -c "client hello, adding max_fragment_length extension" \ |
| 3406 | -s "found max fragment length extension" \ |
| 3407 | -s "server hello, max_fragment_length extension" \ |
| 3408 | -c "found max_fragment_length extension" \ |
| 3409 | -c "fragment larger than.*maximum" |
| 3410 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3411 | # Tests for renegotiation |
| 3412 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3413 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3414 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3415 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3416 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3417 | 0 \ |
| 3418 | -C "client hello, adding renegotiation extension" \ |
| 3419 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3420 | -S "found renegotiation extension" \ |
| 3421 | -s "server hello, secure renegotiation extension" \ |
| 3422 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3423 | -C "=> renegotiate" \ |
| 3424 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3425 | -S "write hello request" |
| 3426 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3427 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3428 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3429 | "$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] | 3430 | "$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] | 3431 | 0 \ |
| 3432 | -c "client hello, adding renegotiation extension" \ |
| 3433 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3434 | -s "found renegotiation extension" \ |
| 3435 | -s "server hello, secure renegotiation extension" \ |
| 3436 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3437 | -c "=> renegotiate" \ |
| 3438 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3439 | -S "write hello request" |
| 3440 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3441 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3442 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3443 | "$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] | 3444 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3445 | 0 \ |
| 3446 | -c "client hello, adding renegotiation extension" \ |
| 3447 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3448 | -s "found renegotiation extension" \ |
| 3449 | -s "server hello, secure renegotiation extension" \ |
| 3450 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3451 | -c "=> renegotiate" \ |
| 3452 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3453 | -s "write hello request" |
| 3454 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3455 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3456 | # 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] | 3457 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3458 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3459 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 3460 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 3461 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3462 | 0 \ |
| 3463 | -c "client hello, adding renegotiation extension" \ |
| 3464 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3465 | -s "found renegotiation extension" \ |
| 3466 | -s "server hello, secure renegotiation extension" \ |
| 3467 | -c "found renegotiation extension" \ |
| 3468 | -c "=> renegotiate" \ |
| 3469 | -s "=> renegotiate" \ |
| 3470 | -S "write hello request" \ |
| 3471 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3472 | |
| 3473 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3474 | # 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] | 3475 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3476 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3477 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 3478 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 3479 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3480 | 0 \ |
| 3481 | -c "client hello, adding renegotiation extension" \ |
| 3482 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3483 | -s "found renegotiation extension" \ |
| 3484 | -s "server hello, secure renegotiation extension" \ |
| 3485 | -c "found renegotiation extension" \ |
| 3486 | -c "=> renegotiate" \ |
| 3487 | -s "=> renegotiate" \ |
| 3488 | -s "write hello request" \ |
| 3489 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3490 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3491 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3492 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3493 | "$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] | 3494 | "$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] | 3495 | 0 \ |
| 3496 | -c "client hello, adding renegotiation extension" \ |
| 3497 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3498 | -s "found renegotiation extension" \ |
| 3499 | -s "server hello, secure renegotiation extension" \ |
| 3500 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3501 | -c "=> renegotiate" \ |
| 3502 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3503 | -s "write hello request" |
| 3504 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3505 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3506 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3507 | requires_max_content_len 2048 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3508 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 3509 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 3510 | "$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" \ |
| 3511 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3512 | -c "Maximum incoming record payload length is 2048" \ |
| 3513 | -c "Maximum outgoing record payload length is 2048" \ |
| 3514 | -s "Maximum incoming record payload length is 2048" \ |
| 3515 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3516 | -c "client hello, adding max_fragment_length extension" \ |
| 3517 | -s "found max fragment length extension" \ |
| 3518 | -s "server hello, max_fragment_length extension" \ |
| 3519 | -c "found max_fragment_length extension" \ |
| 3520 | -c "client hello, adding renegotiation extension" \ |
| 3521 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3522 | -s "found renegotiation extension" \ |
| 3523 | -s "server hello, secure renegotiation extension" \ |
| 3524 | -c "found renegotiation extension" \ |
| 3525 | -c "=> renegotiate" \ |
| 3526 | -s "=> renegotiate" \ |
| 3527 | -s "write hello request" |
| 3528 | |
| 3529 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3530 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3531 | "$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] | 3532 | "$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] | 3533 | 1 \ |
| 3534 | -c "client hello, adding renegotiation extension" \ |
| 3535 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3536 | -S "found renegotiation extension" \ |
| 3537 | -s "server hello, secure renegotiation extension" \ |
| 3538 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3539 | -c "=> renegotiate" \ |
| 3540 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3541 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 3542 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3543 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3544 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3545 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3546 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3547 | "$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] | 3548 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3549 | 0 \ |
| 3550 | -C "client hello, adding renegotiation extension" \ |
| 3551 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3552 | -S "found renegotiation extension" \ |
| 3553 | -s "server hello, secure renegotiation extension" \ |
| 3554 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3555 | -C "=> renegotiate" \ |
| 3556 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3557 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 3558 | -S "SSL - An unexpected message was received from our peer" \ |
| 3559 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3560 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3561 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3562 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3563 | "$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] | 3564 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3565 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3566 | 0 \ |
| 3567 | -C "client hello, adding renegotiation extension" \ |
| 3568 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3569 | -S "found renegotiation extension" \ |
| 3570 | -s "server hello, secure renegotiation extension" \ |
| 3571 | -c "found renegotiation extension" \ |
| 3572 | -C "=> renegotiate" \ |
| 3573 | -S "=> renegotiate" \ |
| 3574 | -s "write hello request" \ |
| 3575 | -S "SSL - An unexpected message was received from our peer" \ |
| 3576 | -S "failed" |
| 3577 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3578 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3579 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3580 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3581 | "$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] | 3582 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3583 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3584 | 0 \ |
| 3585 | -C "client hello, adding renegotiation extension" \ |
| 3586 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3587 | -S "found renegotiation extension" \ |
| 3588 | -s "server hello, secure renegotiation extension" \ |
| 3589 | -c "found renegotiation extension" \ |
| 3590 | -C "=> renegotiate" \ |
| 3591 | -S "=> renegotiate" \ |
| 3592 | -s "write hello request" \ |
| 3593 | -S "SSL - An unexpected message was received from our peer" \ |
| 3594 | -S "failed" |
| 3595 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3596 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3597 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3598 | "$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] | 3599 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3600 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3601 | 0 \ |
| 3602 | -C "client hello, adding renegotiation extension" \ |
| 3603 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3604 | -S "found renegotiation extension" \ |
| 3605 | -s "server hello, secure renegotiation extension" \ |
| 3606 | -c "found renegotiation extension" \ |
| 3607 | -C "=> renegotiate" \ |
| 3608 | -S "=> renegotiate" \ |
| 3609 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3610 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3611 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3612 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3613 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3614 | "$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] | 3615 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3616 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3617 | 0 \ |
| 3618 | -c "client hello, adding renegotiation extension" \ |
| 3619 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3620 | -s "found renegotiation extension" \ |
| 3621 | -s "server hello, secure renegotiation extension" \ |
| 3622 | -c "found renegotiation extension" \ |
| 3623 | -c "=> renegotiate" \ |
| 3624 | -s "=> renegotiate" \ |
| 3625 | -s "write hello request" \ |
| 3626 | -S "SSL - An unexpected message was received from our peer" \ |
| 3627 | -S "failed" |
| 3628 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3629 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3630 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3631 | "$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] | 3632 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3633 | 0 \ |
| 3634 | -C "client hello, adding renegotiation extension" \ |
| 3635 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3636 | -S "found renegotiation extension" \ |
| 3637 | -s "server hello, secure renegotiation extension" \ |
| 3638 | -c "found renegotiation extension" \ |
| 3639 | -S "record counter limit reached: renegotiate" \ |
| 3640 | -C "=> renegotiate" \ |
| 3641 | -S "=> renegotiate" \ |
| 3642 | -S "write hello request" \ |
| 3643 | -S "SSL - An unexpected message was received from our peer" \ |
| 3644 | -S "failed" |
| 3645 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 3646 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3647 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3648 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3649 | "$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] | 3650 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3651 | 0 \ |
| 3652 | -c "client hello, adding renegotiation extension" \ |
| 3653 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3654 | -s "found renegotiation extension" \ |
| 3655 | -s "server hello, secure renegotiation extension" \ |
| 3656 | -c "found renegotiation extension" \ |
| 3657 | -s "record counter limit reached: renegotiate" \ |
| 3658 | -c "=> renegotiate" \ |
| 3659 | -s "=> renegotiate" \ |
| 3660 | -s "write hello request" \ |
| 3661 | -S "SSL - An unexpected message was received from our peer" \ |
| 3662 | -S "failed" |
| 3663 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3664 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3665 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3666 | "$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] | 3667 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3668 | 0 \ |
| 3669 | -c "client hello, adding renegotiation extension" \ |
| 3670 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3671 | -s "found renegotiation extension" \ |
| 3672 | -s "server hello, secure renegotiation extension" \ |
| 3673 | -c "found renegotiation extension" \ |
| 3674 | -s "record counter limit reached: renegotiate" \ |
| 3675 | -c "=> renegotiate" \ |
| 3676 | -s "=> renegotiate" \ |
| 3677 | -s "write hello request" \ |
| 3678 | -S "SSL - An unexpected message was received from our peer" \ |
| 3679 | -S "failed" |
| 3680 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3681 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3682 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3683 | "$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] | 3684 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 3685 | 0 \ |
| 3686 | -C "client hello, adding renegotiation extension" \ |
| 3687 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3688 | -S "found renegotiation extension" \ |
| 3689 | -s "server hello, secure renegotiation extension" \ |
| 3690 | -c "found renegotiation extension" \ |
| 3691 | -S "record counter limit reached: renegotiate" \ |
| 3692 | -C "=> renegotiate" \ |
| 3693 | -S "=> renegotiate" \ |
| 3694 | -S "write hello request" \ |
| 3695 | -S "SSL - An unexpected message was received from our peer" \ |
| 3696 | -S "failed" |
| 3697 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3698 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3699 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3700 | "$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] | 3701 | "$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] | 3702 | 0 \ |
| 3703 | -c "client hello, adding renegotiation extension" \ |
| 3704 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3705 | -s "found renegotiation extension" \ |
| 3706 | -s "server hello, secure renegotiation extension" \ |
| 3707 | -c "found renegotiation extension" \ |
| 3708 | -c "=> renegotiate" \ |
| 3709 | -s "=> renegotiate" \ |
| 3710 | -S "write hello request" |
| 3711 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3712 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3713 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3714 | "$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] | 3715 | "$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] | 3716 | 0 \ |
| 3717 | -c "client hello, adding renegotiation extension" \ |
| 3718 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3719 | -s "found renegotiation extension" \ |
| 3720 | -s "server hello, secure renegotiation extension" \ |
| 3721 | -c "found renegotiation extension" \ |
| 3722 | -c "=> renegotiate" \ |
| 3723 | -s "=> renegotiate" \ |
| 3724 | -s "write hello request" |
| 3725 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3726 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3727 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 3728 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3729 | "$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] | 3730 | 0 \ |
| 3731 | -c "client hello, adding renegotiation extension" \ |
| 3732 | -c "found renegotiation extension" \ |
| 3733 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3734 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3735 | -C "error" \ |
| 3736 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3737 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3738 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3739 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3740 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 3741 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3742 | "$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] | 3743 | 0 \ |
| 3744 | -c "client hello, adding renegotiation extension" \ |
| 3745 | -c "found renegotiation extension" \ |
| 3746 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3747 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3748 | -C "error" \ |
| 3749 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3750 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3751 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3752 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3753 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 3754 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3755 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3756 | 1 \ |
| 3757 | -c "client hello, adding renegotiation extension" \ |
| 3758 | -C "found renegotiation extension" \ |
| 3759 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3760 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3761 | -c "error" \ |
| 3762 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3763 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3764 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3765 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3766 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 3767 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3768 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3769 | allow_legacy=0" \ |
| 3770 | 1 \ |
| 3771 | -c "client hello, adding renegotiation extension" \ |
| 3772 | -C "found renegotiation extension" \ |
| 3773 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3774 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3775 | -c "error" \ |
| 3776 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3777 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3778 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3779 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3780 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 3781 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3782 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3783 | allow_legacy=1" \ |
| 3784 | 0 \ |
| 3785 | -c "client hello, adding renegotiation extension" \ |
| 3786 | -C "found renegotiation extension" \ |
| 3787 | -c "=> renegotiate" \ |
| 3788 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3789 | -C "error" \ |
| 3790 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3791 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3792 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 3793 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 3794 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 3795 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3796 | 0 \ |
| 3797 | -c "client hello, adding renegotiation extension" \ |
| 3798 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3799 | -s "found renegotiation extension" \ |
| 3800 | -s "server hello, secure renegotiation extension" \ |
| 3801 | -c "found renegotiation extension" \ |
| 3802 | -c "=> renegotiate" \ |
| 3803 | -s "=> renegotiate" \ |
| 3804 | -S "write hello request" |
| 3805 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3806 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3807 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 3808 | "$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] | 3809 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 3810 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3811 | 0 \ |
| 3812 | -c "client hello, adding renegotiation extension" \ |
| 3813 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3814 | -s "found renegotiation extension" \ |
| 3815 | -s "server hello, secure renegotiation extension" \ |
| 3816 | -c "found renegotiation extension" \ |
| 3817 | -c "=> renegotiate" \ |
| 3818 | -s "=> renegotiate" \ |
| 3819 | -s "write hello request" |
| 3820 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3821 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3822 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 3823 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 3824 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 3825 | 0 \ |
| 3826 | -c "client hello, adding renegotiation extension" \ |
| 3827 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3828 | -s "found renegotiation extension" \ |
| 3829 | -s "server hello, secure renegotiation extension" \ |
| 3830 | -s "record counter limit reached: renegotiate" \ |
| 3831 | -c "=> renegotiate" \ |
| 3832 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3833 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3834 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 3835 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3836 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3837 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 3838 | "$G_SRV -u --mtu 4096" \ |
| 3839 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3840 | 0 \ |
| 3841 | -c "client hello, adding renegotiation extension" \ |
| 3842 | -c "found renegotiation extension" \ |
| 3843 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3844 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3845 | -C "error" \ |
| 3846 | -s "Extra-header:" |
| 3847 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3848 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 3849 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3850 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3851 | run_test "Renego ext: gnutls server strict, client default" \ |
| 3852 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 3853 | "$P_CLI debug_level=3" \ |
| 3854 | 0 \ |
| 3855 | -c "found renegotiation extension" \ |
| 3856 | -C "error" \ |
| 3857 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3858 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3859 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3860 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 3861 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3862 | "$P_CLI debug_level=3" \ |
| 3863 | 0 \ |
| 3864 | -C "found renegotiation extension" \ |
| 3865 | -C "error" \ |
| 3866 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3867 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3868 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3869 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 3870 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3871 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 3872 | 1 \ |
| 3873 | -C "found renegotiation extension" \ |
| 3874 | -c "error" \ |
| 3875 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3876 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3877 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3878 | run_test "Renego ext: gnutls client strict, server default" \ |
| 3879 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3880 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3881 | 0 \ |
| 3882 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3883 | -s "server hello, secure renegotiation extension" |
| 3884 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3885 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3886 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 3887 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3888 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3889 | 0 \ |
| 3890 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3891 | -S "server hello, secure renegotiation extension" |
| 3892 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3893 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3894 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 3895 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3896 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3897 | 1 \ |
| 3898 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3899 | -S "server hello, secure renegotiation extension" |
| 3900 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3901 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 3902 | |
| 3903 | requires_gnutls |
| 3904 | run_test "DER format: no trailing bytes" \ |
| 3905 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 3906 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3907 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3908 | 0 \ |
| 3909 | -c "Handshake was completed" \ |
| 3910 | |
| 3911 | requires_gnutls |
| 3912 | run_test "DER format: with a trailing zero byte" \ |
| 3913 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 3914 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3915 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3916 | 0 \ |
| 3917 | -c "Handshake was completed" \ |
| 3918 | |
| 3919 | requires_gnutls |
| 3920 | run_test "DER format: with a trailing random byte" \ |
| 3921 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 3922 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3923 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3924 | 0 \ |
| 3925 | -c "Handshake was completed" \ |
| 3926 | |
| 3927 | requires_gnutls |
| 3928 | run_test "DER format: with 2 trailing random bytes" \ |
| 3929 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 3930 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3931 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3932 | 0 \ |
| 3933 | -c "Handshake was completed" \ |
| 3934 | |
| 3935 | requires_gnutls |
| 3936 | run_test "DER format: with 4 trailing random bytes" \ |
| 3937 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 3938 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3939 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3940 | 0 \ |
| 3941 | -c "Handshake was completed" \ |
| 3942 | |
| 3943 | requires_gnutls |
| 3944 | run_test "DER format: with 8 trailing random bytes" \ |
| 3945 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 3946 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3947 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3948 | 0 \ |
| 3949 | -c "Handshake was completed" \ |
| 3950 | |
| 3951 | requires_gnutls |
| 3952 | run_test "DER format: with 9 trailing random bytes" \ |
| 3953 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 3954 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3955 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3956 | 0 \ |
| 3957 | -c "Handshake was completed" \ |
| 3958 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 3959 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 3960 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3961 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3962 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3963 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3964 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3965 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3966 | 1 \ |
| 3967 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3968 | -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] | 3969 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3970 | -c "X509 - Certificate verification failed" |
| 3971 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3972 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3973 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3974 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3975 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3976 | 0 \ |
| 3977 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3978 | -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] | 3979 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3980 | -C "X509 - Certificate verification failed" |
| 3981 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 3982 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 3983 | "$P_SRV" \ |
| 3984 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 3985 | 0 \ |
| 3986 | -c "x509_verify_cert() returned" \ |
| 3987 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3988 | -c "! Certificate verification flags"\ |
| 3989 | -C "! mbedtls_ssl_handshake returned" \ |
| 3990 | -C "X509 - Certificate verification failed" \ |
| 3991 | -C "SSL - No CA Chain is set, but required to operate" |
| 3992 | |
| 3993 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 3994 | "$P_SRV" \ |
| 3995 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 3996 | 1 \ |
| 3997 | -c "x509_verify_cert() returned" \ |
| 3998 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3999 | -c "! Certificate verification flags"\ |
| 4000 | -c "! mbedtls_ssl_handshake returned" \ |
| 4001 | -c "SSL - No CA Chain is set, but required to operate" |
| 4002 | |
| 4003 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4004 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4005 | # the client informs the server about the supported curves - it does, though, in the |
| 4006 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4007 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4008 | # different means to have the server ignoring the client's supported curve list. |
| 4009 | |
| 4010 | requires_config_enabled MBEDTLS_ECP_C |
| 4011 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4012 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4013 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4014 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4015 | 1 \ |
| 4016 | -c "bad certificate (EC key curve)"\ |
| 4017 | -c "! Certificate verification flags"\ |
| 4018 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4019 | |
| 4020 | requires_config_enabled MBEDTLS_ECP_C |
| 4021 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4022 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4023 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4024 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4025 | 1 \ |
| 4026 | -c "bad certificate (EC key curve)"\ |
| 4027 | -c "! Certificate verification flags"\ |
| 4028 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4029 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4030 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 4031 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4032 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4033 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4034 | 0 \ |
| 4035 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4036 | -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] | 4037 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4038 | -C "X509 - Certificate verification failed" |
| 4039 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 4040 | run_test "Authentication: client SHA256, server required" \ |
| 4041 | "$P_SRV auth_mode=required" \ |
| 4042 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4043 | key_file=data_files/server6.key \ |
| 4044 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4045 | 0 \ |
| 4046 | -c "Supported Signature Algorithm found: 4," \ |
| 4047 | -c "Supported Signature Algorithm found: 5," |
| 4048 | |
| 4049 | run_test "Authentication: client SHA384, server required" \ |
| 4050 | "$P_SRV auth_mode=required" \ |
| 4051 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4052 | key_file=data_files/server6.key \ |
| 4053 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4054 | 0 \ |
| 4055 | -c "Supported Signature Algorithm found: 4," \ |
| 4056 | -c "Supported Signature Algorithm found: 5," |
| 4057 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4058 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 4059 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4060 | "$P_CLI debug_level=3 crt_file=none \ |
| 4061 | key_file=data_files/server5.key" \ |
| 4062 | 1 \ |
| 4063 | -S "skip write certificate request" \ |
| 4064 | -C "skip parse certificate request" \ |
| 4065 | -c "got a certificate request" \ |
| 4066 | -c "= write certificate$" \ |
| 4067 | -C "skip write certificate$" \ |
| 4068 | -S "x509_verify_cert() returned" \ |
| 4069 | -s "client has no certificate" \ |
| 4070 | -s "! mbedtls_ssl_handshake returned" \ |
| 4071 | -c "! mbedtls_ssl_handshake returned" \ |
| 4072 | -s "No client certification received from the client, but required by the authentication mode" |
| 4073 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4074 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4075 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4076 | "$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] | 4077 | key_file=data_files/server5.key" \ |
| 4078 | 1 \ |
| 4079 | -S "skip write certificate request" \ |
| 4080 | -C "skip parse certificate request" \ |
| 4081 | -c "got a certificate request" \ |
| 4082 | -C "skip write certificate" \ |
| 4083 | -C "skip write certificate verify" \ |
| 4084 | -S "skip parse certificate verify" \ |
| 4085 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4086 | -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] | 4087 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4088 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4089 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4090 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4091 | # We don't check that the client receives the alert because it might |
| 4092 | # detect that its write end of the connection is closed and abort |
| 4093 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4094 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4095 | run_test "Authentication: client cert not trusted, server required" \ |
| 4096 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4097 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4098 | key_file=data_files/server5.key" \ |
| 4099 | 1 \ |
| 4100 | -S "skip write certificate request" \ |
| 4101 | -C "skip parse certificate request" \ |
| 4102 | -c "got a certificate request" \ |
| 4103 | -C "skip write certificate" \ |
| 4104 | -C "skip write certificate verify" \ |
| 4105 | -S "skip parse certificate verify" \ |
| 4106 | -s "x509_verify_cert() returned" \ |
| 4107 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4108 | -s "! mbedtls_ssl_handshake returned" \ |
| 4109 | -c "! mbedtls_ssl_handshake returned" \ |
| 4110 | -s "X509 - Certificate verification failed" |
| 4111 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4112 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4113 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4114 | "$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] | 4115 | key_file=data_files/server5.key" \ |
| 4116 | 0 \ |
| 4117 | -S "skip write certificate request" \ |
| 4118 | -C "skip parse certificate request" \ |
| 4119 | -c "got a certificate request" \ |
| 4120 | -C "skip write certificate" \ |
| 4121 | -C "skip write certificate verify" \ |
| 4122 | -S "skip parse certificate verify" \ |
| 4123 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4124 | -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] | 4125 | -S "! mbedtls_ssl_handshake returned" \ |
| 4126 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4127 | -S "X509 - Certificate verification failed" |
| 4128 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4129 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4130 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 4131 | "$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] | 4132 | key_file=data_files/server5.key" \ |
| 4133 | 0 \ |
| 4134 | -s "skip write certificate request" \ |
| 4135 | -C "skip parse certificate request" \ |
| 4136 | -c "got no certificate request" \ |
| 4137 | -c "skip write certificate" \ |
| 4138 | -c "skip write certificate verify" \ |
| 4139 | -s "skip parse certificate verify" \ |
| 4140 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4141 | -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] | 4142 | -S "! mbedtls_ssl_handshake returned" \ |
| 4143 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4144 | -S "X509 - Certificate verification failed" |
| 4145 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4146 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4147 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4148 | "$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] | 4149 | 0 \ |
| 4150 | -S "skip write certificate request" \ |
| 4151 | -C "skip parse certificate request" \ |
| 4152 | -c "got a certificate request" \ |
| 4153 | -C "skip write certificate$" \ |
| 4154 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4155 | -c "skip write certificate verify" \ |
| 4156 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4157 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4158 | -S "! mbedtls_ssl_handshake returned" \ |
| 4159 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4160 | -S "X509 - Certificate verification failed" |
| 4161 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4162 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4163 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4164 | "$O_CLI" \ |
| 4165 | 0 \ |
| 4166 | -S "skip write certificate request" \ |
| 4167 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4168 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4169 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4170 | -S "X509 - Certificate verification failed" |
| 4171 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4172 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4173 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4174 | "$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] | 4175 | 0 \ |
| 4176 | -C "skip parse certificate request" \ |
| 4177 | -c "got a certificate request" \ |
| 4178 | -C "skip write certificate$" \ |
| 4179 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4180 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4181 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4182 | run_test "Authentication: client no cert, openssl server required" \ |
| 4183 | "$O_SRV -Verify 10" \ |
| 4184 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 4185 | 1 \ |
| 4186 | -C "skip parse certificate request" \ |
| 4187 | -c "got a certificate request" \ |
| 4188 | -C "skip write certificate$" \ |
| 4189 | -c "skip write certificate verify" \ |
| 4190 | -c "! mbedtls_ssl_handshake returned" |
| 4191 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4192 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 4193 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 4194 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4195 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4196 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4197 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4198 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 4199 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 4200 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 4201 | # 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] | 4202 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4203 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4204 | run_test "Authentication: server max_int chain, client default" \ |
| 4205 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4206 | key_file=data_files/dir-maxpath/09.key" \ |
| 4207 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4208 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4209 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4210 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4211 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4212 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4213 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 4214 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4215 | key_file=data_files/dir-maxpath/10.key" \ |
| 4216 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4217 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4218 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4219 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4220 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4221 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4222 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 4223 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4224 | key_file=data_files/dir-maxpath/10.key" \ |
| 4225 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4226 | auth_mode=optional" \ |
| 4227 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4228 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4229 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4230 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4231 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4232 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 4233 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4234 | key_file=data_files/dir-maxpath/10.key" \ |
| 4235 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4236 | auth_mode=none" \ |
| 4237 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4238 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4239 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4240 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4241 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4242 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 4243 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 4244 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4245 | key_file=data_files/dir-maxpath/10.key" \ |
| 4246 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4247 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4248 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4249 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4250 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4251 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 4252 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4253 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4254 | key_file=data_files/dir-maxpath/10.key" \ |
| 4255 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4256 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4257 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4258 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4259 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4260 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 4261 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4262 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4263 | key_file=data_files/dir-maxpath/10.key" \ |
| 4264 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4265 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4266 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4267 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4268 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4269 | run_test "Authentication: client max_int chain, server required" \ |
| 4270 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4271 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4272 | key_file=data_files/dir-maxpath/09.key" \ |
| 4273 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4274 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4275 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4276 | # Tests for CA list in CertificateRequest messages |
| 4277 | |
| 4278 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 4279 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4280 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4281 | key_file=data_files/server6.key" \ |
| 4282 | 0 \ |
| 4283 | -s "requested DN" |
| 4284 | |
| 4285 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 4286 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4287 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4288 | key_file=data_files/server6.key" \ |
| 4289 | 0 \ |
| 4290 | -S "requested DN" |
| 4291 | |
| 4292 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 4293 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4294 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4295 | key_file=data_files/server5.key" \ |
| 4296 | 1 \ |
| 4297 | -S "requested DN" \ |
| 4298 | -s "x509_verify_cert() returned" \ |
| 4299 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4300 | -s "! mbedtls_ssl_handshake returned" \ |
| 4301 | -c "! mbedtls_ssl_handshake returned" \ |
| 4302 | -s "X509 - Certificate verification failed" |
| 4303 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4304 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 4305 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4306 | |
| 4307 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4308 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 4309 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4310 | key_file=data_files/server5.key" \ |
| 4311 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4312 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4313 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4314 | -c "x509_verify_cert() returned" \ |
| 4315 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4316 | -c "! mbedtls_ssl_handshake returned" \ |
| 4317 | -c "X509 - Certificate verification failed" |
| 4318 | |
| 4319 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4320 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 4321 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4322 | key_file=data_files/server5.key" \ |
| 4323 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4324 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4325 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4326 | -c "x509_verify_cert() returned" \ |
| 4327 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4328 | -C "! mbedtls_ssl_handshake returned" \ |
| 4329 | -C "X509 - Certificate verification failed" |
| 4330 | |
| 4331 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4332 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4333 | # the client informs the server about the supported curves - it does, though, in the |
| 4334 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4335 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4336 | # different means to have the server ignoring the client's supported curve list. |
| 4337 | |
| 4338 | requires_config_enabled MBEDTLS_ECP_C |
| 4339 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4340 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4341 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4342 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4343 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4344 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4345 | -c "use CA callback for X.509 CRT verification" \ |
| 4346 | -c "bad certificate (EC key curve)" \ |
| 4347 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4348 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4349 | |
| 4350 | requires_config_enabled MBEDTLS_ECP_C |
| 4351 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4352 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4353 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4354 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4355 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4356 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4357 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4358 | -c "bad certificate (EC key curve)"\ |
| 4359 | -c "! Certificate verification flags"\ |
| 4360 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4361 | |
| 4362 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4363 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 4364 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4365 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4366 | key_file=data_files/server6.key \ |
| 4367 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4368 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4369 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4370 | -c "Supported Signature Algorithm found: 4," \ |
| 4371 | -c "Supported Signature Algorithm found: 5," |
| 4372 | |
| 4373 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4374 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 4375 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4376 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4377 | key_file=data_files/server6.key \ |
| 4378 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4379 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4380 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4381 | -c "Supported Signature Algorithm found: 4," \ |
| 4382 | -c "Supported Signature Algorithm found: 5," |
| 4383 | |
| 4384 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4385 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 4386 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4387 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4388 | key_file=data_files/server5.key" \ |
| 4389 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4390 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4391 | -S "skip write certificate request" \ |
| 4392 | -C "skip parse certificate request" \ |
| 4393 | -c "got a certificate request" \ |
| 4394 | -C "skip write certificate" \ |
| 4395 | -C "skip write certificate verify" \ |
| 4396 | -S "skip parse certificate verify" \ |
| 4397 | -s "x509_verify_cert() returned" \ |
| 4398 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4399 | -s "! mbedtls_ssl_handshake returned" \ |
| 4400 | -s "send alert level=2 message=48" \ |
| 4401 | -c "! mbedtls_ssl_handshake returned" \ |
| 4402 | -s "X509 - Certificate verification failed" |
| 4403 | # We don't check that the client receives the alert because it might |
| 4404 | # detect that its write end of the connection is closed and abort |
| 4405 | # before reading the alert message. |
| 4406 | |
| 4407 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4408 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 4409 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4410 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4411 | key_file=data_files/server5.key" \ |
| 4412 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4413 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4414 | -S "skip write certificate request" \ |
| 4415 | -C "skip parse certificate request" \ |
| 4416 | -c "got a certificate request" \ |
| 4417 | -C "skip write certificate" \ |
| 4418 | -C "skip write certificate verify" \ |
| 4419 | -S "skip parse certificate verify" \ |
| 4420 | -s "x509_verify_cert() returned" \ |
| 4421 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4422 | -s "! mbedtls_ssl_handshake returned" \ |
| 4423 | -c "! mbedtls_ssl_handshake returned" \ |
| 4424 | -s "X509 - Certificate verification failed" |
| 4425 | |
| 4426 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4427 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 4428 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4429 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4430 | key_file=data_files/server5.key" \ |
| 4431 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4432 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4433 | -S "skip write certificate request" \ |
| 4434 | -C "skip parse certificate request" \ |
| 4435 | -c "got a certificate request" \ |
| 4436 | -C "skip write certificate" \ |
| 4437 | -C "skip write certificate verify" \ |
| 4438 | -S "skip parse certificate verify" \ |
| 4439 | -s "x509_verify_cert() returned" \ |
| 4440 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4441 | -S "! mbedtls_ssl_handshake returned" \ |
| 4442 | -C "! mbedtls_ssl_handshake returned" \ |
| 4443 | -S "X509 - Certificate verification failed" |
| 4444 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4445 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4446 | requires_full_size_output_buffer |
| 4447 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4448 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 4449 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4450 | key_file=data_files/dir-maxpath/09.key" \ |
| 4451 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4452 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4453 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4454 | -C "X509 - A fatal error occurred" |
| 4455 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4456 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4457 | requires_full_size_output_buffer |
| 4458 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4459 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 4460 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4461 | key_file=data_files/dir-maxpath/10.key" \ |
| 4462 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4463 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4464 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4465 | -c "X509 - A fatal error occurred" |
| 4466 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4467 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4468 | requires_full_size_output_buffer |
| 4469 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4470 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 4471 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4472 | key_file=data_files/dir-maxpath/10.key" \ |
| 4473 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4474 | debug_level=3 auth_mode=optional" \ |
| 4475 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4476 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4477 | -c "X509 - A fatal error occurred" |
| 4478 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4479 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4480 | requires_full_size_output_buffer |
| 4481 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4482 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 4483 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4484 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4485 | key_file=data_files/dir-maxpath/10.key" \ |
| 4486 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4487 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4488 | -s "X509 - A fatal error occurred" |
| 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 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4491 | requires_full_size_output_buffer |
| 4492 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4493 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 4494 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4495 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4496 | key_file=data_files/dir-maxpath/10.key" \ |
| 4497 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4498 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4499 | -s "X509 - A fatal error occurred" |
| 4500 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4501 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4502 | requires_full_size_output_buffer |
| 4503 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4504 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 4505 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4506 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4507 | key_file=data_files/dir-maxpath/09.key" \ |
| 4508 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4509 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4510 | -S "X509 - A fatal error occurred" |
| 4511 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4512 | # Tests for certificate selection based on SHA verson |
| 4513 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4514 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4515 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 4516 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4517 | key_file=data_files/server5.key \ |
| 4518 | crt_file2=data_files/server5-sha1.crt \ |
| 4519 | key_file2=data_files/server5.key" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 4520 | "$P_CLI force_version=tls12" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4521 | 0 \ |
| 4522 | -c "signed using.*ECDSA with SHA256" \ |
| 4523 | -C "signed using.*ECDSA with SHA1" |
| 4524 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4525 | # tests for SNI |
| 4526 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4527 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4528 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4529 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4530 | 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] | 4531 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4532 | 0 \ |
| 4533 | -S "parse ServerName extension" \ |
| 4534 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4535 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4536 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4537 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4538 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4539 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4540 | 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] | 4541 | 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] | 4542 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4543 | 0 \ |
| 4544 | -s "parse ServerName extension" \ |
| 4545 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4546 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4547 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4548 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4549 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4550 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4551 | 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] | 4552 | 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] | 4553 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4554 | 0 \ |
| 4555 | -s "parse ServerName extension" \ |
| 4556 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4557 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4558 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4559 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4560 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4561 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4562 | 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] | 4563 | 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] | 4564 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4565 | 1 \ |
| 4566 | -s "parse ServerName extension" \ |
| 4567 | -s "ssl_sni_wrapper() returned" \ |
| 4568 | -s "mbedtls_ssl_handshake returned" \ |
| 4569 | -c "mbedtls_ssl_handshake returned" \ |
| 4570 | -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] | 4571 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4572 | run_test "SNI: client auth no override: optional" \ |
| 4573 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4574 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4575 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4576 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4577 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4578 | -S "skip write certificate request" \ |
| 4579 | -C "skip parse certificate request" \ |
| 4580 | -c "got a certificate request" \ |
| 4581 | -C "skip write certificate" \ |
| 4582 | -C "skip write certificate verify" \ |
| 4583 | -S "skip parse certificate verify" |
| 4584 | |
| 4585 | run_test "SNI: client auth override: none -> optional" \ |
| 4586 | "$P_SRV debug_level=3 auth_mode=none \ |
| 4587 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4588 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4589 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4590 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4591 | -S "skip write certificate request" \ |
| 4592 | -C "skip parse certificate request" \ |
| 4593 | -c "got a certificate request" \ |
| 4594 | -C "skip write certificate" \ |
| 4595 | -C "skip write certificate verify" \ |
| 4596 | -S "skip parse certificate verify" |
| 4597 | |
| 4598 | run_test "SNI: client auth override: optional -> none" \ |
| 4599 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4600 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4601 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4602 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4603 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4604 | -s "skip write certificate request" \ |
| 4605 | -C "skip parse certificate request" \ |
| 4606 | -c "got no certificate request" \ |
| 4607 | -c "skip write certificate" \ |
| 4608 | -c "skip write certificate verify" \ |
| 4609 | -s "skip parse certificate verify" |
| 4610 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4611 | run_test "SNI: CA no override" \ |
| 4612 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4613 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4614 | ca_file=data_files/test-ca.crt \ |
| 4615 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4616 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4617 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4618 | 1 \ |
| 4619 | -S "skip write certificate request" \ |
| 4620 | -C "skip parse certificate request" \ |
| 4621 | -c "got a certificate request" \ |
| 4622 | -C "skip write certificate" \ |
| 4623 | -C "skip write certificate verify" \ |
| 4624 | -S "skip parse certificate verify" \ |
| 4625 | -s "x509_verify_cert() returned" \ |
| 4626 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4627 | -S "The certificate has been revoked (is on a CRL)" |
| 4628 | |
| 4629 | run_test "SNI: CA override" \ |
| 4630 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4631 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4632 | ca_file=data_files/test-ca.crt \ |
| 4633 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4634 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4635 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4636 | 0 \ |
| 4637 | -S "skip write certificate request" \ |
| 4638 | -C "skip parse certificate request" \ |
| 4639 | -c "got a certificate request" \ |
| 4640 | -C "skip write certificate" \ |
| 4641 | -C "skip write certificate verify" \ |
| 4642 | -S "skip parse certificate verify" \ |
| 4643 | -S "x509_verify_cert() returned" \ |
| 4644 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4645 | -S "The certificate has been revoked (is on a CRL)" |
| 4646 | |
| 4647 | run_test "SNI: CA override with CRL" \ |
| 4648 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4649 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4650 | ca_file=data_files/test-ca.crt \ |
| 4651 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4652 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4653 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4654 | 1 \ |
| 4655 | -S "skip write certificate request" \ |
| 4656 | -C "skip parse certificate request" \ |
| 4657 | -c "got a certificate request" \ |
| 4658 | -C "skip write certificate" \ |
| 4659 | -C "skip write certificate verify" \ |
| 4660 | -S "skip parse certificate verify" \ |
| 4661 | -s "x509_verify_cert() returned" \ |
| 4662 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4663 | -s "The certificate has been revoked (is on a CRL)" |
| 4664 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4665 | # Tests for SNI and DTLS |
| 4666 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4667 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4668 | run_test "SNI: DTLS, no SNI callback" \ |
| 4669 | "$P_SRV debug_level=3 dtls=1 \ |
| 4670 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 4671 | "$P_CLI server_name=localhost dtls=1" \ |
| 4672 | 0 \ |
| 4673 | -S "parse ServerName extension" \ |
| 4674 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4675 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4676 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4677 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4678 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4679 | "$P_SRV debug_level=3 dtls=1 \ |
| 4680 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4681 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4682 | "$P_CLI server_name=localhost dtls=1" \ |
| 4683 | 0 \ |
| 4684 | -s "parse ServerName extension" \ |
| 4685 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4686 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4687 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4688 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4689 | run_test "SNI: DTLS, matching cert 2" \ |
| 4690 | "$P_SRV debug_level=3 dtls=1 \ |
| 4691 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4692 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4693 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 4694 | 0 \ |
| 4695 | -s "parse ServerName extension" \ |
| 4696 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4697 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 4698 | |
| 4699 | run_test "SNI: DTLS, no matching cert" \ |
| 4700 | "$P_SRV debug_level=3 dtls=1 \ |
| 4701 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4702 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4703 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 4704 | 1 \ |
| 4705 | -s "parse ServerName extension" \ |
| 4706 | -s "ssl_sni_wrapper() returned" \ |
| 4707 | -s "mbedtls_ssl_handshake returned" \ |
| 4708 | -c "mbedtls_ssl_handshake returned" \ |
| 4709 | -c "SSL - A fatal alert message was received from our peer" |
| 4710 | |
| 4711 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 4712 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4713 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4714 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4715 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4716 | 0 \ |
| 4717 | -S "skip write certificate request" \ |
| 4718 | -C "skip parse certificate request" \ |
| 4719 | -c "got a certificate request" \ |
| 4720 | -C "skip write certificate" \ |
| 4721 | -C "skip write certificate verify" \ |
| 4722 | -S "skip parse certificate verify" |
| 4723 | |
| 4724 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 4725 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 4726 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4727 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4728 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4729 | 0 \ |
| 4730 | -S "skip write certificate request" \ |
| 4731 | -C "skip parse certificate request" \ |
| 4732 | -c "got a certificate request" \ |
| 4733 | -C "skip write certificate" \ |
| 4734 | -C "skip write certificate verify" \ |
| 4735 | -S "skip parse certificate verify" |
| 4736 | |
| 4737 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 4738 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4739 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4740 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4741 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4742 | 0 \ |
| 4743 | -s "skip write certificate request" \ |
| 4744 | -C "skip parse certificate request" \ |
| 4745 | -c "got no certificate request" \ |
| 4746 | -c "skip write certificate" \ |
| 4747 | -c "skip write certificate verify" \ |
| 4748 | -s "skip parse certificate verify" |
| 4749 | |
| 4750 | run_test "SNI: DTLS, CA no override" \ |
| 4751 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4752 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4753 | ca_file=data_files/test-ca.crt \ |
| 4754 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4755 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4756 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4757 | 1 \ |
| 4758 | -S "skip write certificate request" \ |
| 4759 | -C "skip parse certificate request" \ |
| 4760 | -c "got a certificate request" \ |
| 4761 | -C "skip write certificate" \ |
| 4762 | -C "skip write certificate verify" \ |
| 4763 | -S "skip parse certificate verify" \ |
| 4764 | -s "x509_verify_cert() returned" \ |
| 4765 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4766 | -S "The certificate has been revoked (is on a CRL)" |
| 4767 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4768 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4769 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4770 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4771 | ca_file=data_files/test-ca.crt \ |
| 4772 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4773 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4774 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4775 | 0 \ |
| 4776 | -S "skip write certificate request" \ |
| 4777 | -C "skip parse certificate request" \ |
| 4778 | -c "got a certificate request" \ |
| 4779 | -C "skip write certificate" \ |
| 4780 | -C "skip write certificate verify" \ |
| 4781 | -S "skip parse certificate verify" \ |
| 4782 | -S "x509_verify_cert() returned" \ |
| 4783 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4784 | -S "The certificate has been revoked (is on a CRL)" |
| 4785 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4786 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4787 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4788 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 4789 | ca_file=data_files/test-ca.crt \ |
| 4790 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4791 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4792 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4793 | 1 \ |
| 4794 | -S "skip write certificate request" \ |
| 4795 | -C "skip parse certificate request" \ |
| 4796 | -c "got a certificate request" \ |
| 4797 | -C "skip write certificate" \ |
| 4798 | -C "skip write certificate verify" \ |
| 4799 | -S "skip parse certificate verify" \ |
| 4800 | -s "x509_verify_cert() returned" \ |
| 4801 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4802 | -s "The certificate has been revoked (is on a CRL)" |
| 4803 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4804 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 4805 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4806 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4807 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4808 | "$P_CLI nbio=2 tickets=0" \ |
| 4809 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4810 | -S "mbedtls_ssl_handshake returned" \ |
| 4811 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4812 | -c "Read from server: .* bytes read" |
| 4813 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4814 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4815 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 4816 | "$P_CLI nbio=2 tickets=0" \ |
| 4817 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4818 | -S "mbedtls_ssl_handshake returned" \ |
| 4819 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4820 | -c "Read from server: .* bytes read" |
| 4821 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4822 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4823 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4824 | "$P_CLI nbio=2 tickets=1" \ |
| 4825 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4826 | -S "mbedtls_ssl_handshake returned" \ |
| 4827 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4828 | -c "Read from server: .* bytes read" |
| 4829 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4830 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4831 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4832 | "$P_CLI nbio=2 tickets=1" \ |
| 4833 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4834 | -S "mbedtls_ssl_handshake returned" \ |
| 4835 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4836 | -c "Read from server: .* bytes read" |
| 4837 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4838 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4839 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4840 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4841 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4842 | -S "mbedtls_ssl_handshake returned" \ |
| 4843 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4844 | -c "Read from server: .* bytes read" |
| 4845 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4846 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4847 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4848 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4849 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4850 | -S "mbedtls_ssl_handshake returned" \ |
| 4851 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4852 | -c "Read from server: .* bytes read" |
| 4853 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4854 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4855 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4856 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 4857 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4858 | -S "mbedtls_ssl_handshake returned" \ |
| 4859 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4860 | -c "Read from server: .* bytes read" |
| 4861 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 4862 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 4863 | |
| 4864 | run_test "Event-driven I/O: basic handshake" \ |
| 4865 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4866 | "$P_CLI event=1 tickets=0" \ |
| 4867 | 0 \ |
| 4868 | -S "mbedtls_ssl_handshake returned" \ |
| 4869 | -C "mbedtls_ssl_handshake returned" \ |
| 4870 | -c "Read from server: .* bytes read" |
| 4871 | |
| 4872 | run_test "Event-driven I/O: client auth" \ |
| 4873 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 4874 | "$P_CLI event=1 tickets=0" \ |
| 4875 | 0 \ |
| 4876 | -S "mbedtls_ssl_handshake returned" \ |
| 4877 | -C "mbedtls_ssl_handshake returned" \ |
| 4878 | -c "Read from server: .* bytes read" |
| 4879 | |
| 4880 | run_test "Event-driven I/O: ticket" \ |
| 4881 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4882 | "$P_CLI event=1 tickets=1" \ |
| 4883 | 0 \ |
| 4884 | -S "mbedtls_ssl_handshake returned" \ |
| 4885 | -C "mbedtls_ssl_handshake returned" \ |
| 4886 | -c "Read from server: .* bytes read" |
| 4887 | |
| 4888 | run_test "Event-driven I/O: ticket + client auth" \ |
| 4889 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4890 | "$P_CLI event=1 tickets=1" \ |
| 4891 | 0 \ |
| 4892 | -S "mbedtls_ssl_handshake returned" \ |
| 4893 | -C "mbedtls_ssl_handshake returned" \ |
| 4894 | -c "Read from server: .* bytes read" |
| 4895 | |
| 4896 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 4897 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4898 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4899 | 0 \ |
| 4900 | -S "mbedtls_ssl_handshake returned" \ |
| 4901 | -C "mbedtls_ssl_handshake returned" \ |
| 4902 | -c "Read from server: .* bytes read" |
| 4903 | |
| 4904 | run_test "Event-driven I/O: ticket + resume" \ |
| 4905 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4906 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4907 | 0 \ |
| 4908 | -S "mbedtls_ssl_handshake returned" \ |
| 4909 | -C "mbedtls_ssl_handshake returned" \ |
| 4910 | -c "Read from server: .* bytes read" |
| 4911 | |
| 4912 | run_test "Event-driven I/O: session-id resume" \ |
| 4913 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4914 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 4915 | 0 \ |
| 4916 | -S "mbedtls_ssl_handshake returned" \ |
| 4917 | -C "mbedtls_ssl_handshake returned" \ |
| 4918 | -c "Read from server: .* bytes read" |
| 4919 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 4920 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 4921 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 4922 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4923 | 0 \ |
| 4924 | -c "Read from server: .* bytes read" |
| 4925 | |
| 4926 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 4927 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 4928 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4929 | 0 \ |
| 4930 | -c "Read from server: .* bytes read" |
| 4931 | |
| 4932 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 4933 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 4934 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4935 | 0 \ |
| 4936 | -c "Read from server: .* bytes read" |
| 4937 | |
| 4938 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 4939 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 4940 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4941 | 0 \ |
| 4942 | -c "Read from server: .* bytes read" |
| 4943 | |
| 4944 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 4945 | "$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] | 4946 | "$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] | 4947 | 0 \ |
| 4948 | -c "Read from server: .* bytes read" |
| 4949 | |
| 4950 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 4951 | "$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] | 4952 | "$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] | 4953 | 0 \ |
| 4954 | -c "Read from server: .* bytes read" |
| 4955 | |
| 4956 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 4957 | "$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] | 4958 | "$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] | 4959 | 0 \ |
| 4960 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4961 | |
| 4962 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 4963 | # During session resumption, the client will send its ApplicationData record |
| 4964 | # within the same datagram as the Finished messages. In this situation, the |
| 4965 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 4966 | # because the ApplicationData request has already been queued internally. |
| 4967 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 4968 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4969 | "$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] | 4970 | "$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] | 4971 | 0 \ |
| 4972 | -c "Read from server: .* bytes read" |
| 4973 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4974 | # Tests for version negotiation |
| 4975 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4976 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4977 | "$P_SRV" \ |
| 4978 | "$P_CLI" \ |
| 4979 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4980 | -S "mbedtls_ssl_handshake returned" \ |
| 4981 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4982 | -s "Protocol is TLSv1.2" \ |
| 4983 | -c "Protocol is TLSv1.2" |
| 4984 | |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 4985 | run_test "Not supported version check: cli TLS 1.0" \ |
| 4986 | "$P_SRV" \ |
| 4987 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 4988 | 1 \ |
| 4989 | -s "Handshake protocol not within min/max boundaries" \ |
| 4990 | -c "Error in protocol version" \ |
| 4991 | -S "Protocol is TLSv1.0" \ |
| 4992 | -C "Handshake was completed" |
| 4993 | |
| 4994 | run_test "Not supported version check: cli TLS 1.1" \ |
| 4995 | "$P_SRV" \ |
| 4996 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 4997 | 1 \ |
| 4998 | -s "Handshake protocol not within min/max boundaries" \ |
| 4999 | -c "Error in protocol version" \ |
| 5000 | -S "Protocol is TLSv1.1" \ |
| 5001 | -C "Handshake was completed" |
| 5002 | |
| 5003 | run_test "Not supported version check: srv max TLS 1.0" \ |
| 5004 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 5005 | "$P_CLI" \ |
| 5006 | 1 \ |
| 5007 | -s "Error in protocol version" \ |
| 5008 | -c "Handshake protocol not within min/max boundaries" \ |
| 5009 | -S "Version: TLS1.0" \ |
| 5010 | -C "Protocol is TLSv1.0" |
| 5011 | |
| 5012 | run_test "Not supported version check: srv max TLS 1.1" \ |
| 5013 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 5014 | "$P_CLI" \ |
| 5015 | 1 \ |
| 5016 | -s "Error in protocol version" \ |
| 5017 | -c "Handshake protocol not within min/max boundaries" \ |
| 5018 | -S "Version: TLS1.1" \ |
| 5019 | -C "Protocol is TLSv1.1" |
| 5020 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5021 | # Tests for ALPN extension |
| 5022 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5023 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5024 | "$P_SRV debug_level=3" \ |
| 5025 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5026 | 0 \ |
| 5027 | -C "client hello, adding alpn extension" \ |
| 5028 | -S "found alpn extension" \ |
| 5029 | -C "got an alert message, type: \\[2:120]" \ |
| 5030 | -S "server hello, adding alpn extension" \ |
| 5031 | -C "found alpn extension " \ |
| 5032 | -C "Application Layer Protocol is" \ |
| 5033 | -S "Application Layer Protocol is" |
| 5034 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5035 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5036 | "$P_SRV debug_level=3" \ |
| 5037 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5038 | 0 \ |
| 5039 | -c "client hello, adding alpn extension" \ |
| 5040 | -s "found alpn extension" \ |
| 5041 | -C "got an alert message, type: \\[2:120]" \ |
| 5042 | -S "server hello, adding alpn extension" \ |
| 5043 | -C "found alpn extension " \ |
| 5044 | -c "Application Layer Protocol is (none)" \ |
| 5045 | -S "Application Layer Protocol is" |
| 5046 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5047 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5048 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5049 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5050 | 0 \ |
| 5051 | -C "client hello, adding alpn extension" \ |
| 5052 | -S "found alpn extension" \ |
| 5053 | -C "got an alert message, type: \\[2:120]" \ |
| 5054 | -S "server hello, adding alpn extension" \ |
| 5055 | -C "found alpn extension " \ |
| 5056 | -C "Application Layer Protocol is" \ |
| 5057 | -s "Application Layer Protocol is (none)" |
| 5058 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5059 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5060 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5061 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5062 | 0 \ |
| 5063 | -c "client hello, adding alpn extension" \ |
| 5064 | -s "found alpn extension" \ |
| 5065 | -C "got an alert message, type: \\[2:120]" \ |
| 5066 | -s "server hello, adding alpn extension" \ |
| 5067 | -c "found alpn extension" \ |
| 5068 | -c "Application Layer Protocol is abc" \ |
| 5069 | -s "Application Layer Protocol is abc" |
| 5070 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5071 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5072 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5073 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5074 | 0 \ |
| 5075 | -c "client hello, adding alpn extension" \ |
| 5076 | -s "found alpn extension" \ |
| 5077 | -C "got an alert message, type: \\[2:120]" \ |
| 5078 | -s "server hello, adding alpn extension" \ |
| 5079 | -c "found alpn extension" \ |
| 5080 | -c "Application Layer Protocol is abc" \ |
| 5081 | -s "Application Layer Protocol is abc" |
| 5082 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5083 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5084 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5085 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5086 | 0 \ |
| 5087 | -c "client hello, adding alpn extension" \ |
| 5088 | -s "found alpn extension" \ |
| 5089 | -C "got an alert message, type: \\[2:120]" \ |
| 5090 | -s "server hello, adding alpn extension" \ |
| 5091 | -c "found alpn extension" \ |
| 5092 | -c "Application Layer Protocol is 1234" \ |
| 5093 | -s "Application Layer Protocol is 1234" |
| 5094 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5095 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5096 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 5097 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5098 | 1 \ |
| 5099 | -c "client hello, adding alpn extension" \ |
| 5100 | -s "found alpn extension" \ |
| 5101 | -c "got an alert message, type: \\[2:120]" \ |
| 5102 | -S "server hello, adding alpn extension" \ |
| 5103 | -C "found alpn extension" \ |
| 5104 | -C "Application Layer Protocol is 1234" \ |
| 5105 | -S "Application Layer Protocol is 1234" |
| 5106 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 5107 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5108 | # Tests for keyUsage in leaf certificates, part 1: |
| 5109 | # server-side certificate/suite selection |
| 5110 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5111 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5112 | "$P_SRV key_file=data_files/server2.key \ |
| 5113 | crt_file=data_files/server2.ku-ds.crt" \ |
| 5114 | "$P_CLI" \ |
| 5115 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 5116 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5117 | |
| 5118 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5119 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5120 | "$P_SRV key_file=data_files/server2.key \ |
| 5121 | crt_file=data_files/server2.ku-ke.crt" \ |
| 5122 | "$P_CLI" \ |
| 5123 | 0 \ |
| 5124 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 5125 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5126 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5127 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5128 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5129 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5130 | 1 \ |
| 5131 | -C "Ciphersuite is " |
| 5132 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5133 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5134 | "$P_SRV key_file=data_files/server5.key \ |
| 5135 | crt_file=data_files/server5.ku-ds.crt" \ |
| 5136 | "$P_CLI" \ |
| 5137 | 0 \ |
| 5138 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 5139 | |
| 5140 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5141 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5142 | "$P_SRV key_file=data_files/server5.key \ |
| 5143 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5144 | "$P_CLI" \ |
| 5145 | 0 \ |
| 5146 | -c "Ciphersuite is TLS-ECDH-" |
| 5147 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5148 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5149 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5150 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5151 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5152 | 1 \ |
| 5153 | -C "Ciphersuite is " |
| 5154 | |
| 5155 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5156 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5157 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5158 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5159 | "$O_SRV -key data_files/server2.key \ |
| 5160 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5161 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5162 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5163 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5164 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5165 | -C "Processing of the Certificate handshake message failed" \ |
| 5166 | -c "Ciphersuite is TLS-" |
| 5167 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5168 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5169 | "$O_SRV -key data_files/server2.key \ |
| 5170 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5171 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5172 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5173 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5174 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5175 | -C "Processing of the Certificate handshake message failed" \ |
| 5176 | -c "Ciphersuite is TLS-" |
| 5177 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5178 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5179 | "$O_SRV -key data_files/server2.key \ |
| 5180 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5181 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5182 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5183 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5184 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5185 | -C "Processing of the Certificate handshake message failed" \ |
| 5186 | -c "Ciphersuite is TLS-" |
| 5187 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5188 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5189 | "$O_SRV -key data_files/server2.key \ |
| 5190 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5191 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5192 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5193 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5194 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5195 | -c "Processing of the Certificate handshake message failed" \ |
| 5196 | -C "Ciphersuite is TLS-" |
| 5197 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5198 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 5199 | "$O_SRV -key data_files/server2.key \ |
| 5200 | -cert data_files/server2.ku-ke.crt" \ |
| 5201 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5202 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5203 | 0 \ |
| 5204 | -c "bad certificate (usage extensions)" \ |
| 5205 | -C "Processing of the Certificate handshake message failed" \ |
| 5206 | -c "Ciphersuite is TLS-" \ |
| 5207 | -c "! Usage does not match the keyUsage extension" |
| 5208 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5209 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5210 | "$O_SRV -key data_files/server2.key \ |
| 5211 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5212 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5213 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5214 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5215 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5216 | -C "Processing of the Certificate handshake message failed" \ |
| 5217 | -c "Ciphersuite is TLS-" |
| 5218 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5219 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5220 | "$O_SRV -key data_files/server2.key \ |
| 5221 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5222 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5223 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5224 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5225 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5226 | -c "Processing of the Certificate handshake message failed" \ |
| 5227 | -C "Ciphersuite is TLS-" |
| 5228 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5229 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 5230 | "$O_SRV -key data_files/server2.key \ |
| 5231 | -cert data_files/server2.ku-ds.crt" \ |
| 5232 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5233 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5234 | 0 \ |
| 5235 | -c "bad certificate (usage extensions)" \ |
| 5236 | -C "Processing of the Certificate handshake message failed" \ |
| 5237 | -c "Ciphersuite is TLS-" \ |
| 5238 | -c "! Usage does not match the keyUsage extension" |
| 5239 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5240 | # Tests for keyUsage in leaf certificates, part 3: |
| 5241 | # server-side checking of client cert |
| 5242 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5243 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5244 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5245 | "$O_CLI -key data_files/server2.key \ |
| 5246 | -cert data_files/server2.ku-ds.crt" \ |
| 5247 | 0 \ |
| 5248 | -S "bad certificate (usage extensions)" \ |
| 5249 | -S "Processing of the Certificate handshake message failed" |
| 5250 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5251 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5252 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5253 | "$O_CLI -key data_files/server2.key \ |
| 5254 | -cert data_files/server2.ku-ke.crt" \ |
| 5255 | 0 \ |
| 5256 | -s "bad certificate (usage extensions)" \ |
| 5257 | -S "Processing of the Certificate handshake message failed" |
| 5258 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5259 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5260 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5261 | "$O_CLI -key data_files/server2.key \ |
| 5262 | -cert data_files/server2.ku-ke.crt" \ |
| 5263 | 1 \ |
| 5264 | -s "bad certificate (usage extensions)" \ |
| 5265 | -s "Processing of the Certificate handshake message failed" |
| 5266 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5267 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5268 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5269 | "$O_CLI -key data_files/server5.key \ |
| 5270 | -cert data_files/server5.ku-ds.crt" \ |
| 5271 | 0 \ |
| 5272 | -S "bad certificate (usage extensions)" \ |
| 5273 | -S "Processing of the Certificate handshake message failed" |
| 5274 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5275 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5276 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5277 | "$O_CLI -key data_files/server5.key \ |
| 5278 | -cert data_files/server5.ku-ka.crt" \ |
| 5279 | 0 \ |
| 5280 | -s "bad certificate (usage extensions)" \ |
| 5281 | -S "Processing of the Certificate handshake message failed" |
| 5282 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5283 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 5284 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5285 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5286 | "$P_SRV key_file=data_files/server5.key \ |
| 5287 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5288 | "$P_CLI" \ |
| 5289 | 0 |
| 5290 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5291 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5292 | "$P_SRV key_file=data_files/server5.key \ |
| 5293 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5294 | "$P_CLI" \ |
| 5295 | 0 |
| 5296 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5297 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5298 | "$P_SRV key_file=data_files/server5.key \ |
| 5299 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 5300 | "$P_CLI" \ |
| 5301 | 0 |
| 5302 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5303 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5304 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5305 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5306 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5307 | 1 |
| 5308 | |
| 5309 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 5310 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5311 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5312 | "$O_SRV -key data_files/server5.key \ |
| 5313 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5314 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5315 | 0 \ |
| 5316 | -C "bad certificate (usage extensions)" \ |
| 5317 | -C "Processing of the Certificate handshake message failed" \ |
| 5318 | -c "Ciphersuite is TLS-" |
| 5319 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5320 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5321 | "$O_SRV -key data_files/server5.key \ |
| 5322 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5323 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5324 | 0 \ |
| 5325 | -C "bad certificate (usage extensions)" \ |
| 5326 | -C "Processing of the Certificate handshake message failed" \ |
| 5327 | -c "Ciphersuite is TLS-" |
| 5328 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5329 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5330 | "$O_SRV -key data_files/server5.key \ |
| 5331 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5332 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5333 | 0 \ |
| 5334 | -C "bad certificate (usage extensions)" \ |
| 5335 | -C "Processing of the Certificate handshake message failed" \ |
| 5336 | -c "Ciphersuite is TLS-" |
| 5337 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5338 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5339 | "$O_SRV -key data_files/server5.key \ |
| 5340 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5341 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5342 | 1 \ |
| 5343 | -c "bad certificate (usage extensions)" \ |
| 5344 | -c "Processing of the Certificate handshake message failed" \ |
| 5345 | -C "Ciphersuite is TLS-" |
| 5346 | |
| 5347 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 5348 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5349 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5350 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5351 | "$O_CLI -key data_files/server5.key \ |
| 5352 | -cert data_files/server5.eku-cli.crt" \ |
| 5353 | 0 \ |
| 5354 | -S "bad certificate (usage extensions)" \ |
| 5355 | -S "Processing of the Certificate handshake message failed" |
| 5356 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5357 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5358 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5359 | "$O_CLI -key data_files/server5.key \ |
| 5360 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 5361 | 0 \ |
| 5362 | -S "bad certificate (usage extensions)" \ |
| 5363 | -S "Processing of the Certificate handshake message failed" |
| 5364 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5365 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5366 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5367 | "$O_CLI -key data_files/server5.key \ |
| 5368 | -cert data_files/server5.eku-cs_any.crt" \ |
| 5369 | 0 \ |
| 5370 | -S "bad certificate (usage extensions)" \ |
| 5371 | -S "Processing of the Certificate handshake message failed" |
| 5372 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5373 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5374 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5375 | "$O_CLI -key data_files/server5.key \ |
| 5376 | -cert data_files/server5.eku-cs.crt" \ |
| 5377 | 0 \ |
| 5378 | -s "bad certificate (usage extensions)" \ |
| 5379 | -S "Processing of the Certificate handshake message failed" |
| 5380 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5381 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5382 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5383 | "$O_CLI -key data_files/server5.key \ |
| 5384 | -cert data_files/server5.eku-cs.crt" \ |
| 5385 | 1 \ |
| 5386 | -s "bad certificate (usage extensions)" \ |
| 5387 | -s "Processing of the Certificate handshake message failed" |
| 5388 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5389 | # Tests for DHM parameters loading |
| 5390 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5391 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5392 | "$P_SRV" \ |
| 5393 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5394 | debug_level=3" \ |
| 5395 | 0 \ |
| 5396 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 5397 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5398 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5399 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5400 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5401 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5402 | debug_level=3" \ |
| 5403 | 0 \ |
| 5404 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 5405 | -c "value of 'DHM: G ' (2 bits)" |
| 5406 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5407 | # Tests for DHM client-side size checking |
| 5408 | |
| 5409 | run_test "DHM size: server default, client default, OK" \ |
| 5410 | "$P_SRV" \ |
| 5411 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5412 | debug_level=1" \ |
| 5413 | 0 \ |
| 5414 | -C "DHM prime too short:" |
| 5415 | |
| 5416 | run_test "DHM size: server default, client 2048, OK" \ |
| 5417 | "$P_SRV" \ |
| 5418 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5419 | debug_level=1 dhmlen=2048" \ |
| 5420 | 0 \ |
| 5421 | -C "DHM prime too short:" |
| 5422 | |
| 5423 | run_test "DHM size: server 1024, client default, OK" \ |
| 5424 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5425 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5426 | debug_level=1" \ |
| 5427 | 0 \ |
| 5428 | -C "DHM prime too short:" |
| 5429 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5430 | run_test "DHM size: server 999, client 999, OK" \ |
| 5431 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5432 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5433 | debug_level=1 dhmlen=999" \ |
| 5434 | 0 \ |
| 5435 | -C "DHM prime too short:" |
| 5436 | |
| 5437 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 5438 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5439 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5440 | debug_level=1 dhmlen=1000" \ |
| 5441 | 0 \ |
| 5442 | -C "DHM prime too short:" |
| 5443 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5444 | run_test "DHM size: server 1000, client default, rejected" \ |
| 5445 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5446 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5447 | debug_level=1" \ |
| 5448 | 1 \ |
| 5449 | -c "DHM prime too short:" |
| 5450 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5451 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 5452 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5453 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5454 | debug_level=1 dhmlen=1001" \ |
| 5455 | 1 \ |
| 5456 | -c "DHM prime too short:" |
| 5457 | |
| 5458 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 5459 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5460 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5461 | debug_level=1 dhmlen=1000" \ |
| 5462 | 1 \ |
| 5463 | -c "DHM prime too short:" |
| 5464 | |
| 5465 | run_test "DHM size: server 998, client 999, rejected" \ |
| 5466 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 5467 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5468 | debug_level=1 dhmlen=999" \ |
| 5469 | 1 \ |
| 5470 | -c "DHM prime too short:" |
| 5471 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5472 | run_test "DHM size: server default, client 2049, rejected" \ |
| 5473 | "$P_SRV" \ |
| 5474 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5475 | debug_level=1 dhmlen=2049" \ |
| 5476 | 1 \ |
| 5477 | -c "DHM prime too short:" |
| 5478 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5479 | # Tests for PSK callback |
| 5480 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5481 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5482 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 5483 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5484 | psk_identity=foo psk=abc123" \ |
| 5485 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5486 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5487 | -S "SSL - Unknown identity received" \ |
| 5488 | -S "SSL - Verification of the message MAC failed" |
| 5489 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5490 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5491 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 5492 | "$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^] | 5493 | "$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] | 5494 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5495 | 0 \ |
| 5496 | -c "skip PMS generation for opaque PSK"\ |
| 5497 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5498 | -C "session hash for extended master secret"\ |
| 5499 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5500 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5501 | -S "SSL - Unknown identity received" \ |
| 5502 | -S "SSL - Verification of the message MAC failed" |
| 5503 | |
| 5504 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5505 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 5506 | "$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^] | 5507 | "$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] | 5508 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5509 | 0 \ |
| 5510 | -c "skip PMS generation for opaque PSK"\ |
| 5511 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5512 | -C "session hash for extended master secret"\ |
| 5513 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5514 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5515 | -S "SSL - Unknown identity received" \ |
| 5516 | -S "SSL - Verification of the message MAC failed" |
| 5517 | |
| 5518 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5519 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 5520 | "$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^] | 5521 | "$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] | 5522 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5523 | 0 \ |
| 5524 | -c "skip PMS generation for opaque PSK"\ |
| 5525 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5526 | -c "session hash for extended master secret"\ |
| 5527 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5528 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5529 | -S "SSL - Unknown identity received" \ |
| 5530 | -S "SSL - Verification of the message MAC failed" |
| 5531 | |
| 5532 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5533 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 5534 | "$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^] | 5535 | "$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] | 5536 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5537 | 0 \ |
| 5538 | -c "skip PMS generation for opaque PSK"\ |
| 5539 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5540 | -c "session hash for extended master secret"\ |
| 5541 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5542 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5543 | -S "SSL - Unknown identity received" \ |
| 5544 | -S "SSL - Verification of the message MAC failed" |
| 5545 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5546 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5547 | 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^] | 5548 | "$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" \ |
| 5549 | "$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] | 5550 | psk_identity=foo psk=abc123" \ |
| 5551 | 0 \ |
| 5552 | -C "skip PMS generation for opaque PSK"\ |
| 5553 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5554 | -C "session hash for extended master secret"\ |
| 5555 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5556 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5557 | -S "SSL - Unknown identity received" \ |
| 5558 | -S "SSL - Verification of the message MAC failed" |
| 5559 | |
| 5560 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5561 | 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^] | 5562 | "$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" \ |
| 5563 | "$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] | 5564 | psk_identity=foo psk=abc123" \ |
| 5565 | 0 \ |
| 5566 | -C "skip PMS generation for opaque PSK"\ |
| 5567 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5568 | -C "session hash for extended master secret"\ |
| 5569 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5570 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5571 | -S "SSL - Unknown identity received" \ |
| 5572 | -S "SSL - Verification of the message MAC failed" |
| 5573 | |
| 5574 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5575 | 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^] | 5576 | "$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] | 5577 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 5578 | "$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] | 5579 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5580 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5581 | -c "session hash for extended master secret"\ |
| 5582 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5583 | -C "skip PMS generation for opaque PSK"\ |
| 5584 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5585 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5586 | -S "SSL - Unknown identity received" \ |
| 5587 | -S "SSL - Verification of the message MAC failed" |
| 5588 | |
| 5589 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5590 | 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^] | 5591 | "$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] | 5592 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 5593 | "$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] | 5594 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5595 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5596 | -c "session hash for extended master secret"\ |
| 5597 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5598 | -C "skip PMS generation for opaque PSK"\ |
| 5599 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5600 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5601 | -S "SSL - Unknown identity received" \ |
| 5602 | -S "SSL - Verification of the message MAC failed" |
| 5603 | |
| 5604 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5605 | 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^] | 5606 | "$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" \ |
| 5607 | "$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] | 5608 | psk_identity=def psk=beef" \ |
| 5609 | 0 \ |
| 5610 | -C "skip PMS generation for opaque PSK"\ |
| 5611 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5612 | -C "session hash for extended master secret"\ |
| 5613 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5614 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5615 | -S "SSL - Unknown identity received" \ |
| 5616 | -S "SSL - Verification of the message MAC failed" |
| 5617 | |
| 5618 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5619 | 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^] | 5620 | "$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" \ |
| 5621 | "$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] | 5622 | psk_identity=def psk=beef" \ |
| 5623 | 0 \ |
| 5624 | -C "skip PMS generation for opaque PSK"\ |
| 5625 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5626 | -C "session hash for extended master secret"\ |
| 5627 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5628 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5629 | -S "SSL - Unknown identity received" \ |
| 5630 | -S "SSL - Verification of the message MAC failed" |
| 5631 | |
| 5632 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5633 | 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^] | 5634 | "$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] | 5635 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 5636 | "$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] | 5637 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5638 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5639 | -c "session hash for extended master secret"\ |
| 5640 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5641 | -C "skip PMS generation for opaque PSK"\ |
| 5642 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5643 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5644 | -S "SSL - Unknown identity received" \ |
| 5645 | -S "SSL - Verification of the message MAC failed" |
| 5646 | |
| 5647 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5648 | 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^] | 5649 | "$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] | 5650 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 5651 | "$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] | 5652 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5653 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5654 | -c "session hash for extended master secret"\ |
| 5655 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5656 | -C "skip PMS generation for opaque PSK"\ |
| 5657 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5658 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5659 | -S "SSL - Unknown identity received" \ |
| 5660 | -S "SSL - Verification of the message MAC failed" |
| 5661 | |
| 5662 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5663 | 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^] | 5664 | "$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" \ |
| 5665 | "$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] | 5666 | psk_identity=def psk=beef" \ |
| 5667 | 0 \ |
| 5668 | -C "skip PMS generation for opaque PSK"\ |
| 5669 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5670 | -C "session hash for extended master secret"\ |
| 5671 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5672 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5673 | -S "SSL - Unknown identity received" \ |
| 5674 | -S "SSL - Verification of the message MAC failed" |
| 5675 | |
| 5676 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5677 | 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^] | 5678 | "$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" \ |
| 5679 | "$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] | 5680 | psk_identity=def psk=beef" \ |
| 5681 | 0 \ |
| 5682 | -C "skip PMS generation for opaque PSK"\ |
| 5683 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5684 | -C "session hash for extended master secret"\ |
| 5685 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5686 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5687 | -S "SSL - Unknown identity received" \ |
| 5688 | -S "SSL - Verification of the message MAC failed" |
| 5689 | |
| 5690 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5691 | 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^] | 5692 | "$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" \ |
| 5693 | "$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] | 5694 | psk_identity=def psk=beef" \ |
| 5695 | 0 \ |
| 5696 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5697 | -C "session hash for extended master secret"\ |
| 5698 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5699 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5700 | -S "SSL - Unknown identity received" \ |
| 5701 | -S "SSL - Verification of the message MAC failed" |
| 5702 | |
| 5703 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5704 | 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^] | 5705 | "$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" \ |
| 5706 | "$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] | 5707 | psk_identity=def psk=beef" \ |
| 5708 | 0 \ |
| 5709 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5710 | -C "session hash for extended master secret"\ |
| 5711 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5712 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5713 | -S "SSL - Unknown identity received" \ |
| 5714 | -S "SSL - Verification of the message MAC failed" |
| 5715 | |
| 5716 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5717 | 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^] | 5718 | "$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" \ |
| 5719 | "$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] | 5720 | psk_identity=def psk=beef" \ |
| 5721 | 1 \ |
| 5722 | -s "SSL - Verification of the message MAC failed" |
| 5723 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5724 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5725 | "$P_SRV" \ |
| 5726 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5727 | psk_identity=foo psk=abc123" \ |
| 5728 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 5729 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5730 | -S "SSL - Unknown identity received" \ |
| 5731 | -S "SSL - Verification of the message MAC failed" |
| 5732 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5733 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5734 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 5735 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5736 | psk_identity=foo psk=abc123" \ |
| 5737 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5738 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5739 | -s "SSL - Unknown identity received" \ |
| 5740 | -S "SSL - Verification of the message MAC failed" |
| 5741 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5742 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5743 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5744 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5745 | psk_identity=abc psk=dead" \ |
| 5746 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5747 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5748 | -S "SSL - Unknown identity received" \ |
| 5749 | -S "SSL - Verification of the message MAC failed" |
| 5750 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5751 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5752 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5753 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5754 | psk_identity=def psk=beef" \ |
| 5755 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5756 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5757 | -S "SSL - Unknown identity received" \ |
| 5758 | -S "SSL - Verification of the message MAC failed" |
| 5759 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5760 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5761 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5762 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5763 | psk_identity=ghi psk=beef" \ |
| 5764 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5765 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5766 | -s "SSL - Unknown identity received" \ |
| 5767 | -S "SSL - Verification of the message MAC failed" |
| 5768 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5769 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5770 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5771 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5772 | psk_identity=abc psk=beef" \ |
| 5773 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5774 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5775 | -S "SSL - Unknown identity received" \ |
| 5776 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5777 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5778 | # Tests for EC J-PAKE |
| 5779 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5780 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5781 | run_test "ECJPAKE: client not configured" \ |
| 5782 | "$P_SRV debug_level=3" \ |
| 5783 | "$P_CLI debug_level=3" \ |
| 5784 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5785 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5786 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5787 | -S "found ecjpake kkpp extension" \ |
| 5788 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5789 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5790 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5791 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 5792 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5793 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5794 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5795 | run_test "ECJPAKE: server not configured" \ |
| 5796 | "$P_SRV debug_level=3" \ |
| 5797 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5798 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5799 | 1 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5800 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5801 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5802 | -s "found ecjpake kkpp extension" \ |
| 5803 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5804 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5805 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5806 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 5807 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5808 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5809 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5810 | run_test "ECJPAKE: working, TLS" \ |
| 5811 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5812 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5813 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 5814 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5815 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5816 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5817 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5818 | -s "found ecjpake kkpp extension" \ |
| 5819 | -S "skip ecjpake kkpp extension" \ |
| 5820 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5821 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5822 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 5823 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5824 | -S "SSL - Verification of the message MAC failed" |
| 5825 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5826 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5827 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5828 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 5829 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5830 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 5831 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5832 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5833 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5834 | -s "SSL - Verification of the message MAC failed" |
| 5835 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5836 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5837 | run_test "ECJPAKE: working, DTLS" \ |
| 5838 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5839 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5840 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5841 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5842 | -c "re-using cached ecjpake parameters" \ |
| 5843 | -S "SSL - Verification of the message MAC failed" |
| 5844 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5845 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5846 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 5847 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 5848 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5849 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5850 | 0 \ |
| 5851 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5852 | -S "SSL - Verification of the message MAC failed" |
| 5853 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5854 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5855 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5856 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 5857 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5858 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 5859 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5860 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5861 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5862 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5863 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5864 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5865 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5866 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 5867 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 5868 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 5869 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5870 | 0 |
| 5871 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 5872 | # Test for ClientHello without extensions |
| 5873 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 5874 | requires_gnutls |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 5875 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 5876 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5877 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 5878 | 0 \ |
| 5879 | -s "dumping 'client hello extensions' (0 bytes)" |
| 5880 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5881 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5882 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5883 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5884 | "$P_SRV" \ |
| 5885 | "$P_CLI request_size=100" \ |
| 5886 | 0 \ |
| 5887 | -s "Read from client: 100 bytes read$" |
| 5888 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5889 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5890 | "$P_SRV" \ |
| 5891 | "$P_CLI request_size=500" \ |
| 5892 | 0 \ |
| 5893 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5894 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5895 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5896 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5897 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5898 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 5899 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5900 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5901 | 0 \ |
| 5902 | -s "Read from client: 1 bytes read" |
| 5903 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5904 | 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] | 5905 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 5906 | "$P_CLI request_size=1 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5907 | 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] | 5908 | 0 \ |
| 5909 | -s "Read from client: 1 bytes read" |
| 5910 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5911 | 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] | 5912 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 5913 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5914 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5915 | 0 \ |
| 5916 | -s "Read from client: 1 bytes read" |
| 5917 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5918 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5919 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 5920 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5921 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5922 | 0 \ |
| 5923 | -s "Read from client: 1 bytes read" |
| 5924 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5925 | 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] | 5926 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 5927 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5928 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5929 | 0 \ |
| 5930 | -s "Read from client: 1 bytes read" |
| 5931 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5932 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5933 | |
| 5934 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5935 | run_test "Small client packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 5936 | "$P_SRV dtls=1 force_version=dtls12" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5937 | "$P_CLI dtls=1 request_size=1 \ |
| 5938 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5939 | 0 \ |
| 5940 | -s "Read from client: 1 bytes read" |
| 5941 | |
| 5942 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5943 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 5944 | "$P_SRV dtls=1 force_version=dtls12 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5945 | "$P_CLI dtls=1 request_size=1 \ |
| 5946 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5947 | 0 \ |
| 5948 | -s "Read from client: 1 bytes read" |
| 5949 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5950 | # Tests for small server packets |
| 5951 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5952 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 5953 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 5954 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5955 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5956 | 0 \ |
| 5957 | -c "Read from server: 1 bytes read" |
| 5958 | |
| 5959 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 5960 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 5961 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5962 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 5963 | 0 \ |
| 5964 | -c "Read from server: 1 bytes read" |
| 5965 | |
| 5966 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 5967 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 5968 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5969 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 5970 | 0 \ |
| 5971 | -c "Read from server: 1 bytes read" |
| 5972 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5973 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 5974 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 5975 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5976 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5977 | 0 \ |
| 5978 | -c "Read from server: 1 bytes read" |
| 5979 | |
| 5980 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 5981 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 5982 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5983 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5984 | 0 \ |
| 5985 | -c "Read from server: 1 bytes read" |
| 5986 | |
| 5987 | # Tests for small server packets in DTLS |
| 5988 | |
| 5989 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5990 | run_test "Small server packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 5991 | "$P_SRV dtls=1 response_size=1 force_version=dtls12" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5992 | "$P_CLI dtls=1 \ |
| 5993 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5994 | 0 \ |
| 5995 | -c "Read from server: 1 bytes read" |
| 5996 | |
| 5997 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5998 | run_test "Small server packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 5999 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6000 | "$P_CLI dtls=1 \ |
| 6001 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6002 | 0 \ |
| 6003 | -c "Read from server: 1 bytes read" |
| 6004 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6005 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6006 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6007 | # How many fragments do we expect to write $1 bytes? |
| 6008 | fragments_for_write() { |
| 6009 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 6010 | } |
| 6011 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6012 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6013 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 6014 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6015 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6016 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6017 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6018 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6019 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6020 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6021 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 6022 | "$P_CLI request_size=16384 force_version=tls12 etm=0 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6023 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6024 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6025 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6026 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6027 | 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] | 6028 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 6029 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6030 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6031 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6032 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6033 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6034 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6035 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6036 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 6037 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6038 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6039 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6040 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6041 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6042 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6043 | 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] | 6044 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 6045 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6046 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6047 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6048 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6049 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6050 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6051 | # 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] | 6052 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 6053 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 6054 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6055 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6056 | 0 \ |
| 6057 | -c "Read from server: 16384 bytes read" |
| 6058 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6059 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6060 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 6061 | "$P_CLI force_version=tls12 etm=0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6062 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6063 | 0 \ |
| 6064 | -s "16384 bytes written in 1 fragments" \ |
| 6065 | -c "Read from server: 16384 bytes read" |
| 6066 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6067 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6068 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 6069 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6070 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6071 | 0 \ |
| 6072 | -c "Read from server: 16384 bytes read" |
| 6073 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6074 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 6075 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 6076 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6077 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6078 | 0 \ |
| 6079 | -s "16384 bytes written in 1 fragments" \ |
| 6080 | -c "Read from server: 16384 bytes read" |
| 6081 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6082 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 6083 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 6084 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6085 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6086 | 0 \ |
| 6087 | -c "Read from server: 16384 bytes read" |
| 6088 | |
| 6089 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 6090 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 6091 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6092 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6093 | 0 \ |
| 6094 | -c "Read from server: 16384 bytes read" |
| 6095 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6096 | # Tests for restartable ECC |
| 6097 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6098 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 6099 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6100 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6101 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6102 | run_test "EC restart: TLS, default" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6103 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6104 | "$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] | 6105 | 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] | 6106 | debug_level=1" \ |
| 6107 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6108 | -C "x509_verify_cert.*4b00" \ |
| 6109 | -C "mbedtls_pk_verify.*4b00" \ |
| 6110 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6111 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6112 | |
| 6113 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6114 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6115 | run_test "EC restart: TLS, max_ops=0" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6116 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6117 | "$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] | 6118 | 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] | 6119 | debug_level=1 ec_max_ops=0" \ |
| 6120 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6121 | -C "x509_verify_cert.*4b00" \ |
| 6122 | -C "mbedtls_pk_verify.*4b00" \ |
| 6123 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6124 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6125 | |
| 6126 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6127 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6128 | run_test "EC restart: TLS, max_ops=65535" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6129 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6130 | "$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] | 6131 | 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] | 6132 | debug_level=1 ec_max_ops=65535" \ |
| 6133 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6134 | -C "x509_verify_cert.*4b00" \ |
| 6135 | -C "mbedtls_pk_verify.*4b00" \ |
| 6136 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6137 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6138 | |
| 6139 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6140 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6141 | run_test "EC restart: TLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6142 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6143 | "$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] | 6144 | 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] | 6145 | debug_level=1 ec_max_ops=1000" \ |
| 6146 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6147 | -c "x509_verify_cert.*4b00" \ |
| 6148 | -c "mbedtls_pk_verify.*4b00" \ |
| 6149 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6150 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6151 | |
| 6152 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6153 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6154 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6155 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6156 | crt_file=data_files/server5-badsign.crt \ |
| 6157 | key_file=data_files/server5.key" \ |
| 6158 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6159 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6160 | debug_level=1 ec_max_ops=1000" \ |
| 6161 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6162 | -c "x509_verify_cert.*4b00" \ |
| 6163 | -C "mbedtls_pk_verify.*4b00" \ |
| 6164 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6165 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6166 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6167 | -c "! mbedtls_ssl_handshake returned" \ |
| 6168 | -c "X509 - Certificate verification failed" |
| 6169 | |
| 6170 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6171 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6172 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6173 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6174 | crt_file=data_files/server5-badsign.crt \ |
| 6175 | key_file=data_files/server5.key" \ |
| 6176 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6177 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6178 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 6179 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6180 | -c "x509_verify_cert.*4b00" \ |
| 6181 | -c "mbedtls_pk_verify.*4b00" \ |
| 6182 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6183 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6184 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6185 | -C "! mbedtls_ssl_handshake returned" \ |
| 6186 | -C "X509 - Certificate verification failed" |
| 6187 | |
| 6188 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6189 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6190 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6191 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6192 | crt_file=data_files/server5-badsign.crt \ |
| 6193 | key_file=data_files/server5.key" \ |
| 6194 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6195 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6196 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 6197 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6198 | -C "x509_verify_cert.*4b00" \ |
| 6199 | -c "mbedtls_pk_verify.*4b00" \ |
| 6200 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6201 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6202 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6203 | -C "! mbedtls_ssl_handshake returned" \ |
| 6204 | -C "X509 - Certificate verification failed" |
| 6205 | |
| 6206 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6207 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6208 | run_test "EC restart: DTLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6209 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6210 | "$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] | 6211 | 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] | 6212 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 6213 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6214 | -c "x509_verify_cert.*4b00" \ |
| 6215 | -c "mbedtls_pk_verify.*4b00" \ |
| 6216 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6217 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6218 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6219 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6220 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6221 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6222 | "$P_SRV curves=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6223 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6224 | debug_level=1 ec_max_ops=1000" \ |
| 6225 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6226 | -c "x509_verify_cert.*4b00" \ |
| 6227 | -c "mbedtls_pk_verify.*4b00" \ |
| 6228 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6229 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6230 | |
| 6231 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6232 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6233 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6234 | "$P_SRV curves=secp256r1 psk=abc123" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6235 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 6236 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 6237 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6238 | -C "x509_verify_cert.*4b00" \ |
| 6239 | -C "mbedtls_pk_verify.*4b00" \ |
| 6240 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6241 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6242 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6243 | # Tests of asynchronous private key support in SSL |
| 6244 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6245 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6246 | run_test "SSL async private: sign, delay=0" \ |
| 6247 | "$P_SRV \ |
| 6248 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6249 | "$P_CLI" \ |
| 6250 | 0 \ |
| 6251 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6252 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6253 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6254 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6255 | run_test "SSL async private: sign, delay=1" \ |
| 6256 | "$P_SRV \ |
| 6257 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6258 | "$P_CLI" \ |
| 6259 | 0 \ |
| 6260 | -s "Async sign callback: using key slot " \ |
| 6261 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6262 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6263 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 6264 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6265 | run_test "SSL async private: sign, delay=2" \ |
| 6266 | "$P_SRV \ |
| 6267 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 6268 | "$P_CLI" \ |
| 6269 | 0 \ |
| 6270 | -s "Async sign callback: using key slot " \ |
| 6271 | -U "Async sign callback: using key slot " \ |
| 6272 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 6273 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6274 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6275 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6276 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6277 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 6278 | run_test "SSL async private: sign, SNI" \ |
| 6279 | "$P_SRV debug_level=3 \ |
| 6280 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 6281 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6282 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6283 | "$P_CLI server_name=polarssl.example" \ |
| 6284 | 0 \ |
| 6285 | -s "Async sign callback: using key slot " \ |
| 6286 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6287 | -s "parse ServerName extension" \ |
| 6288 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6289 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6290 | |
| 6291 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6292 | run_test "SSL async private: decrypt, delay=0" \ |
| 6293 | "$P_SRV \ |
| 6294 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6295 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6296 | 0 \ |
| 6297 | -s "Async decrypt callback: using key slot " \ |
| 6298 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6299 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6300 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6301 | run_test "SSL async private: decrypt, delay=1" \ |
| 6302 | "$P_SRV \ |
| 6303 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6304 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6305 | 0 \ |
| 6306 | -s "Async decrypt callback: using key slot " \ |
| 6307 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6308 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6309 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6310 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6311 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 6312 | "$P_SRV psk=abc123 \ |
| 6313 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6314 | "$P_CLI psk=abc123 \ |
| 6315 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6316 | 0 \ |
| 6317 | -s "Async decrypt callback: using key slot " \ |
| 6318 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6319 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6320 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6321 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 6322 | "$P_SRV psk=abc123 \ |
| 6323 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6324 | "$P_CLI psk=abc123 \ |
| 6325 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6326 | 0 \ |
| 6327 | -s "Async decrypt callback: using key slot " \ |
| 6328 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6329 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6330 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6331 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6332 | run_test "SSL async private: sign callback not present" \ |
| 6333 | "$P_SRV \ |
| 6334 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6335 | "$P_CLI; [ \$? -eq 1 ] && |
| 6336 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6337 | 0 \ |
| 6338 | -S "Async sign callback" \ |
| 6339 | -s "! mbedtls_ssl_handshake returned" \ |
| 6340 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 6341 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 6342 | -s "Successful connection" |
| 6343 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6344 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6345 | run_test "SSL async private: decrypt callback not present" \ |
| 6346 | "$P_SRV debug_level=1 \ |
| 6347 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 6348 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 6349 | [ \$? -eq 1 ] && $P_CLI" \ |
| 6350 | 0 \ |
| 6351 | -S "Async decrypt callback" \ |
| 6352 | -s "! mbedtls_ssl_handshake returned" \ |
| 6353 | -s "got no RSA private key" \ |
| 6354 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6355 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6356 | |
| 6357 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6358 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6359 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6360 | "$P_SRV \ |
| 6361 | async_operations=s async_private_delay1=1 \ |
| 6362 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6363 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6364 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6365 | 0 \ |
| 6366 | -s "Async sign callback: using key slot 0," \ |
| 6367 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6368 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6369 | |
| 6370 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6371 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6372 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6373 | "$P_SRV \ |
| 6374 | async_operations=s async_private_delay2=1 \ |
| 6375 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6376 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6377 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6378 | 0 \ |
| 6379 | -s "Async sign callback: using key slot 0," \ |
| 6380 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6381 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6382 | |
| 6383 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6384 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 6385 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6386 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 6387 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6388 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6389 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6390 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6391 | 0 \ |
| 6392 | -s "Async sign callback: using key slot 1," \ |
| 6393 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6394 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6395 | |
| 6396 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6397 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6398 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6399 | "$P_SRV \ |
| 6400 | async_operations=s async_private_delay1=1 \ |
| 6401 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6402 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6403 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6404 | 0 \ |
| 6405 | -s "Async sign callback: no key matches this certificate." |
| 6406 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6407 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6408 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6409 | "$P_SRV \ |
| 6410 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6411 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6412 | "$P_CLI" \ |
| 6413 | 1 \ |
| 6414 | -s "Async sign callback: injected error" \ |
| 6415 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6416 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6417 | -s "! mbedtls_ssl_handshake returned" |
| 6418 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6419 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6420 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6421 | "$P_SRV \ |
| 6422 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6423 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6424 | "$P_CLI" \ |
| 6425 | 1 \ |
| 6426 | -s "Async sign callback: using key slot " \ |
| 6427 | -S "Async resume" \ |
| 6428 | -s "Async cancel" |
| 6429 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6430 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6431 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6432 | "$P_SRV \ |
| 6433 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6434 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6435 | "$P_CLI" \ |
| 6436 | 1 \ |
| 6437 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6438 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6439 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6440 | -s "! mbedtls_ssl_handshake returned" |
| 6441 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6442 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6443 | run_test "SSL async private: decrypt, error in start" \ |
| 6444 | "$P_SRV \ |
| 6445 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6446 | async_private_error=1" \ |
| 6447 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6448 | 1 \ |
| 6449 | -s "Async decrypt callback: injected error" \ |
| 6450 | -S "Async resume" \ |
| 6451 | -S "Async cancel" \ |
| 6452 | -s "! mbedtls_ssl_handshake returned" |
| 6453 | |
| 6454 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6455 | run_test "SSL async private: decrypt, cancel after start" \ |
| 6456 | "$P_SRV \ |
| 6457 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6458 | async_private_error=2" \ |
| 6459 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6460 | 1 \ |
| 6461 | -s "Async decrypt callback: using key slot " \ |
| 6462 | -S "Async resume" \ |
| 6463 | -s "Async cancel" |
| 6464 | |
| 6465 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6466 | run_test "SSL async private: decrypt, error in resume" \ |
| 6467 | "$P_SRV \ |
| 6468 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6469 | async_private_error=3" \ |
| 6470 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6471 | 1 \ |
| 6472 | -s "Async decrypt callback: using key slot " \ |
| 6473 | -s "Async resume callback: decrypt done but injected error" \ |
| 6474 | -S "Async cancel" \ |
| 6475 | -s "! mbedtls_ssl_handshake returned" |
| 6476 | |
| 6477 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6478 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6479 | "$P_SRV \ |
| 6480 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6481 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6482 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6483 | 0 \ |
| 6484 | -s "Async cancel" \ |
| 6485 | -s "! mbedtls_ssl_handshake returned" \ |
| 6486 | -s "Async resume" \ |
| 6487 | -s "Successful connection" |
| 6488 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6489 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6490 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6491 | "$P_SRV \ |
| 6492 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6493 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6494 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6495 | 0 \ |
| 6496 | -s "! mbedtls_ssl_handshake returned" \ |
| 6497 | -s "Async resume" \ |
| 6498 | -s "Successful connection" |
| 6499 | |
| 6500 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6501 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6502 | 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] | 6503 | "$P_SRV \ |
| 6504 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 6505 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6506 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6507 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6508 | [ \$? -eq 1 ] && |
| 6509 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6510 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 6511 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6512 | -S "Async resume" \ |
| 6513 | -s "Async cancel" \ |
| 6514 | -s "! mbedtls_ssl_handshake returned" \ |
| 6515 | -s "Async sign callback: no key matches this certificate." \ |
| 6516 | -s "Successful connection" |
| 6517 | |
| 6518 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6519 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6520 | 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] | 6521 | "$P_SRV \ |
| 6522 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 6523 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6524 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6525 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6526 | [ \$? -eq 1 ] && |
| 6527 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6528 | 0 \ |
| 6529 | -s "Async resume" \ |
| 6530 | -s "! mbedtls_ssl_handshake returned" \ |
| 6531 | -s "Async sign callback: no key matches this certificate." \ |
| 6532 | -s "Successful connection" |
| 6533 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6534 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6535 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6536 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6537 | "$P_SRV \ |
| 6538 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6539 | exchanges=2 renegotiation=1" \ |
| 6540 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6541 | 0 \ |
| 6542 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6543 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6544 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6545 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6546 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6547 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6548 | "$P_SRV \ |
| 6549 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6550 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6551 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 6552 | 0 \ |
| 6553 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6554 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6555 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6556 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6557 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6558 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6559 | "$P_SRV \ |
| 6560 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6561 | exchanges=2 renegotiation=1" \ |
| 6562 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 6563 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6564 | 0 \ |
| 6565 | -s "Async decrypt callback: using key slot " \ |
| 6566 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6567 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6568 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6569 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6570 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6571 | "$P_SRV \ |
| 6572 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6573 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6574 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 6575 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6576 | 0 \ |
| 6577 | -s "Async decrypt callback: using key slot " \ |
| 6578 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6579 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6580 | # Tests for ECC extensions (rfc 4492) |
| 6581 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6582 | requires_config_enabled MBEDTLS_AES_C |
| 6583 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6584 | requires_config_enabled MBEDTLS_SHA256_C |
| 6585 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6586 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 6587 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6588 | "$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] | 6589 | 0 \ |
| 6590 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 6591 | -C "client hello, adding supported_point_formats extension" \ |
| 6592 | -S "found supported elliptic curves extension" \ |
| 6593 | -S "found supported point formats extension" |
| 6594 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6595 | requires_config_enabled MBEDTLS_AES_C |
| 6596 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6597 | requires_config_enabled MBEDTLS_SHA256_C |
| 6598 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6599 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6600 | "$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] | 6601 | "$P_CLI debug_level=3" \ |
| 6602 | 0 \ |
| 6603 | -C "found supported_point_formats extension" \ |
| 6604 | -S "server hello, supported_point_formats extension" |
| 6605 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6606 | requires_config_enabled MBEDTLS_AES_C |
| 6607 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6608 | requires_config_enabled MBEDTLS_SHA256_C |
| 6609 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6610 | run_test "Force an ECC ciphersuite in the client side" \ |
| 6611 | "$P_SRV debug_level=3" \ |
| 6612 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6613 | 0 \ |
| 6614 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 6615 | -c "client hello, adding supported_point_formats extension" \ |
| 6616 | -s "found supported elliptic curves extension" \ |
| 6617 | -s "found supported point formats extension" |
| 6618 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6619 | requires_config_enabled MBEDTLS_AES_C |
| 6620 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6621 | requires_config_enabled MBEDTLS_SHA256_C |
| 6622 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6623 | run_test "Force an ECC ciphersuite in the server side" \ |
| 6624 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6625 | "$P_CLI debug_level=3" \ |
| 6626 | 0 \ |
| 6627 | -c "found supported_point_formats extension" \ |
| 6628 | -s "server hello, supported_point_formats extension" |
| 6629 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6630 | # Tests for DTLS HelloVerifyRequest |
| 6631 | |
| 6632 | run_test "DTLS cookie: enabled" \ |
| 6633 | "$P_SRV dtls=1 debug_level=2" \ |
| 6634 | "$P_CLI dtls=1 debug_level=2" \ |
| 6635 | 0 \ |
| 6636 | -s "cookie verification failed" \ |
| 6637 | -s "cookie verification passed" \ |
| 6638 | -S "cookie verification skipped" \ |
| 6639 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6640 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6641 | -S "SSL - The requested feature is not available" |
| 6642 | |
| 6643 | run_test "DTLS cookie: disabled" \ |
| 6644 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 6645 | "$P_CLI dtls=1 debug_level=2" \ |
| 6646 | 0 \ |
| 6647 | -S "cookie verification failed" \ |
| 6648 | -S "cookie verification passed" \ |
| 6649 | -s "cookie verification skipped" \ |
| 6650 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6651 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6652 | -S "SSL - The requested feature is not available" |
| 6653 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6654 | run_test "DTLS cookie: default (failing)" \ |
| 6655 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 6656 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 6657 | 1 \ |
| 6658 | -s "cookie verification failed" \ |
| 6659 | -S "cookie verification passed" \ |
| 6660 | -S "cookie verification skipped" \ |
| 6661 | -C "received hello verify request" \ |
| 6662 | -S "hello verification requested" \ |
| 6663 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6664 | |
| 6665 | requires_ipv6 |
| 6666 | run_test "DTLS cookie: enabled, IPv6" \ |
| 6667 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 6668 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 6669 | 0 \ |
| 6670 | -s "cookie verification failed" \ |
| 6671 | -s "cookie verification passed" \ |
| 6672 | -S "cookie verification skipped" \ |
| 6673 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6674 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6675 | -S "SSL - The requested feature is not available" |
| 6676 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6677 | run_test "DTLS cookie: enabled, nbio" \ |
| 6678 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 6679 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6680 | 0 \ |
| 6681 | -s "cookie verification failed" \ |
| 6682 | -s "cookie verification passed" \ |
| 6683 | -S "cookie verification skipped" \ |
| 6684 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6685 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6686 | -S "SSL - The requested feature is not available" |
| 6687 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6688 | # Tests for client reconnecting from the same port with DTLS |
| 6689 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6690 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6691 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 6692 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 6693 | "$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] | 6694 | 0 \ |
| 6695 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6696 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6697 | -S "Client initiated reconnection from same port" |
| 6698 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6699 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6700 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 6701 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 6702 | "$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] | 6703 | 0 \ |
| 6704 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6705 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6706 | -s "Client initiated reconnection from same port" |
| 6707 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6708 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 6709 | 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] | 6710 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 6711 | "$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] | 6712 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6713 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6714 | -s "Client initiated reconnection from same port" |
| 6715 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6716 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 6717 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 6718 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 6719 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 6720 | 0 \ |
| 6721 | -S "The operation timed out" \ |
| 6722 | -s "Client initiated reconnection from same port" |
| 6723 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6724 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 6725 | "$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] | 6726 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 6727 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6728 | -s "The operation timed out" \ |
| 6729 | -S "Client initiated reconnection from same port" |
| 6730 | |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 6731 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 6732 | -p "$P_PXY inject_clihlo=1" \ |
| 6733 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 6734 | "$P_CLI dtls=1 exchanges=2" \ |
| 6735 | 0 \ |
| 6736 | -s "possible client reconnect from the same port" \ |
| 6737 | -S "Client initiated reconnection from same port" |
| 6738 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6739 | # Tests for various cases of client authentication with DTLS |
| 6740 | # (focused on handshake flows and message parsing) |
| 6741 | |
| 6742 | run_test "DTLS client auth: required" \ |
| 6743 | "$P_SRV dtls=1 auth_mode=required" \ |
| 6744 | "$P_CLI dtls=1" \ |
| 6745 | 0 \ |
| 6746 | -s "Verifying peer X.509 certificate... ok" |
| 6747 | |
| 6748 | run_test "DTLS client auth: optional, client has no cert" \ |
| 6749 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 6750 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 6751 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6752 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6753 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6754 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6755 | "$P_SRV dtls=1 auth_mode=none" \ |
| 6756 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 6757 | 0 \ |
| 6758 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6759 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6760 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 6761 | run_test "DTLS wrong PSK: badmac alert" \ |
| 6762 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 6763 | "$P_CLI dtls=1 psk=abc124" \ |
| 6764 | 1 \ |
| 6765 | -s "SSL - Verification of the message MAC failed" \ |
| 6766 | -c "SSL - A fatal alert message was received from our peer" |
| 6767 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 6768 | # Tests for receiving fragmented handshake messages with DTLS |
| 6769 | |
| 6770 | requires_gnutls |
| 6771 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 6772 | "$G_SRV -u --mtu 2048 -a" \ |
| 6773 | "$P_CLI dtls=1 debug_level=2" \ |
| 6774 | 0 \ |
| 6775 | -C "found fragmented DTLS handshake message" \ |
| 6776 | -C "error" |
| 6777 | |
| 6778 | requires_gnutls |
| 6779 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 6780 | "$G_SRV -u --mtu 512" \ |
| 6781 | "$P_CLI dtls=1 debug_level=2" \ |
| 6782 | 0 \ |
| 6783 | -c "found fragmented DTLS handshake message" \ |
| 6784 | -C "error" |
| 6785 | |
| 6786 | requires_gnutls |
| 6787 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 6788 | "$G_SRV -u --mtu 128" \ |
| 6789 | "$P_CLI dtls=1 debug_level=2" \ |
| 6790 | 0 \ |
| 6791 | -c "found fragmented DTLS handshake message" \ |
| 6792 | -C "error" |
| 6793 | |
| 6794 | requires_gnutls |
| 6795 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 6796 | "$G_SRV -u --mtu 128" \ |
| 6797 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6798 | 0 \ |
| 6799 | -c "found fragmented DTLS handshake message" \ |
| 6800 | -C "error" |
| 6801 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6802 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6803 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6804 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 6805 | "$G_SRV -u --mtu 256" \ |
| 6806 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6807 | 0 \ |
| 6808 | -c "found fragmented DTLS handshake message" \ |
| 6809 | -c "client hello, adding renegotiation extension" \ |
| 6810 | -c "found renegotiation extension" \ |
| 6811 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6812 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6813 | -C "error" \ |
| 6814 | -s "Extra-header:" |
| 6815 | |
| 6816 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6817 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6818 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 6819 | "$G_SRV -u --mtu 256" \ |
| 6820 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6821 | 0 \ |
| 6822 | -c "found fragmented DTLS handshake message" \ |
| 6823 | -c "client hello, adding renegotiation extension" \ |
| 6824 | -c "found renegotiation extension" \ |
| 6825 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6826 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6827 | -C "error" \ |
| 6828 | -s "Extra-header:" |
| 6829 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 6830 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 6831 | "$O_SRV -dtls -mtu 2048" \ |
| 6832 | "$P_CLI dtls=1 debug_level=2" \ |
| 6833 | 0 \ |
| 6834 | -C "found fragmented DTLS handshake message" \ |
| 6835 | -C "error" |
| 6836 | |
| 6837 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 6838 | "$O_SRV -dtls -mtu 768" \ |
| 6839 | "$P_CLI dtls=1 debug_level=2" \ |
| 6840 | 0 \ |
| 6841 | -c "found fragmented DTLS handshake message" \ |
| 6842 | -C "error" |
| 6843 | |
| 6844 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 6845 | "$O_SRV -dtls -mtu 256" \ |
| 6846 | "$P_CLI dtls=1 debug_level=2" \ |
| 6847 | 0 \ |
| 6848 | -c "found fragmented DTLS handshake message" \ |
| 6849 | -C "error" |
| 6850 | |
| 6851 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 6852 | "$O_SRV -dtls -mtu 256" \ |
| 6853 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6854 | 0 \ |
| 6855 | -c "found fragmented DTLS handshake message" \ |
| 6856 | -C "error" |
| 6857 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6858 | # Tests for sending fragmented handshake messages with DTLS |
| 6859 | # |
| 6860 | # Use client auth when we need the client to send large messages, |
| 6861 | # and use large cert chains on both sides too (the long chains we have all use |
| 6862 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 6863 | # Sizes reached (UDP payload): |
| 6864 | # - 2037B for server certificate |
| 6865 | # - 1542B for client certificate |
| 6866 | # - 1013B for newsessionticket |
| 6867 | # - all others below 512B |
| 6868 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 6869 | |
| 6870 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6871 | requires_config_enabled MBEDTLS_RSA_C |
| 6872 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6873 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6874 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6875 | run_test "DTLS fragmenting: none (for reference)" \ |
| 6876 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6877 | crt_file=data_files/server7_int-ca.crt \ |
| 6878 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6879 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6880 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6881 | "$P_CLI dtls=1 debug_level=2 \ |
| 6882 | crt_file=data_files/server8_int-ca2.crt \ |
| 6883 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6884 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6885 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6886 | 0 \ |
| 6887 | -S "found fragmented DTLS handshake message" \ |
| 6888 | -C "found fragmented DTLS handshake message" \ |
| 6889 | -C "error" |
| 6890 | |
| 6891 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6892 | requires_config_enabled MBEDTLS_RSA_C |
| 6893 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6894 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6895 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6896 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6897 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6898 | crt_file=data_files/server7_int-ca.crt \ |
| 6899 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6900 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6901 | max_frag_len=1024" \ |
| 6902 | "$P_CLI dtls=1 debug_level=2 \ |
| 6903 | crt_file=data_files/server8_int-ca2.crt \ |
| 6904 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6905 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6906 | max_frag_len=2048" \ |
| 6907 | 0 \ |
| 6908 | -S "found fragmented DTLS handshake message" \ |
| 6909 | -c "found fragmented DTLS handshake message" \ |
| 6910 | -C "error" |
| 6911 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6912 | # With the MFL extension, the server has no way of forcing |
| 6913 | # the client to not exceed a certain MTU; hence, the following |
| 6914 | # test can't be replicated with an MTU proxy such as the one |
| 6915 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6916 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6917 | requires_config_enabled MBEDTLS_RSA_C |
| 6918 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6919 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6920 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6921 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6922 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6923 | crt_file=data_files/server7_int-ca.crt \ |
| 6924 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6925 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6926 | max_frag_len=512" \ |
| 6927 | "$P_CLI dtls=1 debug_level=2 \ |
| 6928 | crt_file=data_files/server8_int-ca2.crt \ |
| 6929 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6930 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6931 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6932 | 0 \ |
| 6933 | -S "found fragmented DTLS handshake message" \ |
| 6934 | -c "found fragmented DTLS handshake message" \ |
| 6935 | -C "error" |
| 6936 | |
| 6937 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6938 | requires_config_enabled MBEDTLS_RSA_C |
| 6939 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6940 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6941 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6942 | 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] | 6943 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6944 | crt_file=data_files/server7_int-ca.crt \ |
| 6945 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6946 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6947 | max_frag_len=2048" \ |
| 6948 | "$P_CLI dtls=1 debug_level=2 \ |
| 6949 | crt_file=data_files/server8_int-ca2.crt \ |
| 6950 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6951 | hs_timeout=2500-60000 \ |
| 6952 | max_frag_len=1024" \ |
| 6953 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6954 | -S "found fragmented DTLS handshake message" \ |
| 6955 | -c "found fragmented DTLS handshake message" \ |
| 6956 | -C "error" |
| 6957 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6958 | # While not required by the standard defining the MFL extension |
| 6959 | # (according to which it only applies to records, not to datagrams), |
| 6960 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6961 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6962 | # to the peer. |
| 6963 | # The next test checks that no datagrams significantly larger than the |
| 6964 | # negotiated MFL are sent. |
| 6965 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6966 | requires_config_enabled MBEDTLS_RSA_C |
| 6967 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6968 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6969 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6970 | 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] | 6971 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6972 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6973 | crt_file=data_files/server7_int-ca.crt \ |
| 6974 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6975 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6976 | max_frag_len=2048" \ |
| 6977 | "$P_CLI dtls=1 debug_level=2 \ |
| 6978 | crt_file=data_files/server8_int-ca2.crt \ |
| 6979 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6980 | hs_timeout=2500-60000 \ |
| 6981 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6982 | 0 \ |
| 6983 | -S "found fragmented DTLS handshake message" \ |
| 6984 | -c "found fragmented DTLS handshake message" \ |
| 6985 | -C "error" |
| 6986 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6987 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6988 | requires_config_enabled MBEDTLS_RSA_C |
| 6989 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6990 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6991 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6992 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6993 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6994 | crt_file=data_files/server7_int-ca.crt \ |
| 6995 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6996 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6997 | max_frag_len=2048" \ |
| 6998 | "$P_CLI dtls=1 debug_level=2 \ |
| 6999 | crt_file=data_files/server8_int-ca2.crt \ |
| 7000 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7001 | hs_timeout=2500-60000 \ |
| 7002 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7003 | 0 \ |
| 7004 | -s "found fragmented DTLS handshake message" \ |
| 7005 | -c "found fragmented DTLS handshake message" \ |
| 7006 | -C "error" |
| 7007 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7008 | # While not required by the standard defining the MFL extension |
| 7009 | # (according to which it only applies to records, not to datagrams), |
| 7010 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7011 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7012 | # to the peer. |
| 7013 | # The next test checks that no datagrams significantly larger than the |
| 7014 | # negotiated MFL are sent. |
| 7015 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7016 | requires_config_enabled MBEDTLS_RSA_C |
| 7017 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7018 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7019 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7020 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 7021 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7022 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7023 | crt_file=data_files/server7_int-ca.crt \ |
| 7024 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7025 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7026 | max_frag_len=2048" \ |
| 7027 | "$P_CLI dtls=1 debug_level=2 \ |
| 7028 | crt_file=data_files/server8_int-ca2.crt \ |
| 7029 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7030 | hs_timeout=2500-60000 \ |
| 7031 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7032 | 0 \ |
| 7033 | -s "found fragmented DTLS handshake message" \ |
| 7034 | -c "found fragmented DTLS handshake message" \ |
| 7035 | -C "error" |
| 7036 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7037 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7038 | requires_config_enabled MBEDTLS_RSA_C |
| 7039 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7040 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7041 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 7042 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7043 | crt_file=data_files/server7_int-ca.crt \ |
| 7044 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7045 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7046 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7047 | "$P_CLI dtls=1 debug_level=2 \ |
| 7048 | crt_file=data_files/server8_int-ca2.crt \ |
| 7049 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7050 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7051 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7052 | 0 \ |
| 7053 | -S "found fragmented DTLS handshake message" \ |
| 7054 | -C "found fragmented DTLS handshake message" \ |
| 7055 | -C "error" |
| 7056 | |
| 7057 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7058 | requires_config_enabled MBEDTLS_RSA_C |
| 7059 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7060 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7061 | run_test "DTLS fragmenting: client (MTU)" \ |
| 7062 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7063 | crt_file=data_files/server7_int-ca.crt \ |
| 7064 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7065 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7066 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7067 | "$P_CLI dtls=1 debug_level=2 \ |
| 7068 | crt_file=data_files/server8_int-ca2.crt \ |
| 7069 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7070 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7071 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7072 | 0 \ |
| 7073 | -s "found fragmented DTLS handshake message" \ |
| 7074 | -C "found fragmented DTLS handshake message" \ |
| 7075 | -C "error" |
| 7076 | |
| 7077 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7078 | requires_config_enabled MBEDTLS_RSA_C |
| 7079 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7080 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7081 | run_test "DTLS fragmenting: server (MTU)" \ |
| 7082 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7083 | crt_file=data_files/server7_int-ca.crt \ |
| 7084 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7085 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7086 | mtu=512" \ |
| 7087 | "$P_CLI dtls=1 debug_level=2 \ |
| 7088 | crt_file=data_files/server8_int-ca2.crt \ |
| 7089 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7090 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7091 | mtu=2048" \ |
| 7092 | 0 \ |
| 7093 | -S "found fragmented DTLS handshake message" \ |
| 7094 | -c "found fragmented DTLS handshake message" \ |
| 7095 | -C "error" |
| 7096 | |
| 7097 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7098 | requires_config_enabled MBEDTLS_RSA_C |
| 7099 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7100 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7101 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7102 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7103 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7104 | crt_file=data_files/server7_int-ca.crt \ |
| 7105 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7106 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 7107 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7108 | "$P_CLI dtls=1 debug_level=2 \ |
| 7109 | crt_file=data_files/server8_int-ca2.crt \ |
| 7110 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7111 | hs_timeout=2500-60000 \ |
| 7112 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7113 | 0 \ |
| 7114 | -s "found fragmented DTLS handshake message" \ |
| 7115 | -c "found fragmented DTLS handshake message" \ |
| 7116 | -C "error" |
| 7117 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7118 | # 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] | 7119 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7120 | requires_config_enabled MBEDTLS_RSA_C |
| 7121 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7122 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7123 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7124 | requires_config_enabled MBEDTLS_AES_C |
| 7125 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7126 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7127 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 7128 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [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 | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7132 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7133 | mtu=512" \ |
| 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 | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7137 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7138 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7139 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7140 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7141 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7142 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7143 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7144 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7145 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7146 | # 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] | 7147 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 7148 | # retransmissions, but in some cases (like both the server and client using |
| 7149 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 7150 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 7151 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7152 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7153 | requires_config_enabled MBEDTLS_RSA_C |
| 7154 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7155 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7156 | requires_config_enabled MBEDTLS_AES_C |
| 7157 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7158 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7159 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7160 | -p "$P_PXY mtu=508" \ |
| 7161 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7162 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7163 | key_file=data_files/server7.key \ |
| 7164 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7165 | "$P_CLI dtls=1 debug_level=2 \ |
| 7166 | crt_file=data_files/server8_int-ca2.crt \ |
| 7167 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7168 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7169 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7170 | 0 \ |
| 7171 | -s "found fragmented DTLS handshake message" \ |
| 7172 | -c "found fragmented DTLS handshake message" \ |
| 7173 | -C "error" |
| 7174 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7175 | # 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] | 7176 | only_with_valgrind |
| 7177 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7178 | requires_config_enabled MBEDTLS_RSA_C |
| 7179 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7180 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7181 | requires_config_enabled MBEDTLS_AES_C |
| 7182 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7183 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7184 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7185 | -p "$P_PXY mtu=508" \ |
| 7186 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7187 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7188 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7189 | hs_timeout=250-10000" \ |
| 7190 | "$P_CLI dtls=1 debug_level=2 \ |
| 7191 | crt_file=data_files/server8_int-ca2.crt \ |
| 7192 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7193 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7194 | hs_timeout=250-10000" \ |
| 7195 | 0 \ |
| 7196 | -s "found fragmented DTLS handshake message" \ |
| 7197 | -c "found fragmented DTLS handshake message" \ |
| 7198 | -C "error" |
| 7199 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7200 | # 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] | 7201 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7202 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7203 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7204 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7205 | requires_config_enabled MBEDTLS_RSA_C |
| 7206 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7207 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7208 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7209 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7210 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7211 | crt_file=data_files/server7_int-ca.crt \ |
| 7212 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7213 | hs_timeout=10000-60000 \ |
| 7214 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7215 | "$P_CLI dtls=1 debug_level=2 \ |
| 7216 | crt_file=data_files/server8_int-ca2.crt \ |
| 7217 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7218 | hs_timeout=10000-60000 \ |
| 7219 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7220 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7221 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7222 | -s "found fragmented DTLS handshake message" \ |
| 7223 | -c "found fragmented DTLS handshake message" \ |
| 7224 | -C "error" |
| 7225 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7226 | # 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] | 7227 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 7228 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7229 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7230 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7231 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7232 | requires_config_enabled MBEDTLS_RSA_C |
| 7233 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7234 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7235 | requires_config_enabled MBEDTLS_AES_C |
| 7236 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7237 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7238 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7239 | -p "$P_PXY mtu=512" \ |
| 7240 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7241 | crt_file=data_files/server7_int-ca.crt \ |
| 7242 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7243 | hs_timeout=10000-60000 \ |
| 7244 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7245 | "$P_CLI dtls=1 debug_level=2 \ |
| 7246 | crt_file=data_files/server8_int-ca2.crt \ |
| 7247 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7248 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7249 | hs_timeout=10000-60000 \ |
| 7250 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7251 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7252 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7253 | -s "found fragmented DTLS handshake message" \ |
| 7254 | -c "found fragmented DTLS handshake message" \ |
| 7255 | -C "error" |
| 7256 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7257 | not_with_valgrind # spurious autoreduction due to timeout |
| 7258 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7259 | requires_config_enabled MBEDTLS_RSA_C |
| 7260 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7261 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7262 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7263 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7264 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7265 | crt_file=data_files/server7_int-ca.crt \ |
| 7266 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7267 | hs_timeout=10000-60000 \ |
| 7268 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7269 | "$P_CLI dtls=1 debug_level=2 \ |
| 7270 | crt_file=data_files/server8_int-ca2.crt \ |
| 7271 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7272 | hs_timeout=10000-60000 \ |
| 7273 | mtu=1024 nbio=2" \ |
| 7274 | 0 \ |
| 7275 | -S "autoreduction" \ |
| 7276 | -s "found fragmented DTLS handshake message" \ |
| 7277 | -c "found fragmented DTLS handshake message" \ |
| 7278 | -C "error" |
| 7279 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7280 | # 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] | 7281 | not_with_valgrind # spurious autoreduction due to timeout |
| 7282 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7283 | requires_config_enabled MBEDTLS_RSA_C |
| 7284 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7285 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7286 | requires_config_enabled MBEDTLS_AES_C |
| 7287 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7288 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7289 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 7290 | -p "$P_PXY mtu=512" \ |
| 7291 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7292 | crt_file=data_files/server7_int-ca.crt \ |
| 7293 | key_file=data_files/server7.key \ |
| 7294 | hs_timeout=10000-60000 \ |
| 7295 | mtu=512 nbio=2" \ |
| 7296 | "$P_CLI dtls=1 debug_level=2 \ |
| 7297 | crt_file=data_files/server8_int-ca2.crt \ |
| 7298 | key_file=data_files/server8.key \ |
| 7299 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7300 | hs_timeout=10000-60000 \ |
| 7301 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7302 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7303 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7304 | -s "found fragmented DTLS handshake message" \ |
| 7305 | -c "found fragmented DTLS handshake message" \ |
| 7306 | -C "error" |
| 7307 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7308 | # 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] | 7309 | # This ensures things still work after session_reset(). |
| 7310 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7311 | # Since we don't support reading fragmented ClientHello yet, |
| 7312 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 7313 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7314 | # An autoreduction on the client-side might happen if the server is |
| 7315 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 7316 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7317 | # resumed listening, which would result in a spurious autoreduction. |
| 7318 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7319 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7320 | requires_config_enabled MBEDTLS_RSA_C |
| 7321 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7322 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7323 | requires_config_enabled MBEDTLS_AES_C |
| 7324 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7325 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7326 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 7327 | -p "$P_PXY mtu=1450" \ |
| 7328 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7329 | crt_file=data_files/server7_int-ca.crt \ |
| 7330 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7331 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7332 | mtu=1450" \ |
| 7333 | "$P_CLI dtls=1 debug_level=2 \ |
| 7334 | crt_file=data_files/server8_int-ca2.crt \ |
| 7335 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7336 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7337 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 7338 | 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] | 7339 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7340 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7341 | -s "found fragmented DTLS handshake message" \ |
| 7342 | -c "found fragmented DTLS handshake message" \ |
| 7343 | -C "error" |
| 7344 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7345 | # An autoreduction on the client-side might happen if the server is |
| 7346 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7347 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7348 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7349 | requires_config_enabled MBEDTLS_RSA_C |
| 7350 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7351 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7352 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7353 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7354 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7355 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7356 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 7357 | -p "$P_PXY mtu=512" \ |
| 7358 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7359 | crt_file=data_files/server7_int-ca.crt \ |
| 7360 | key_file=data_files/server7.key \ |
| 7361 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7362 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7363 | mtu=512" \ |
| 7364 | "$P_CLI dtls=1 debug_level=2 \ |
| 7365 | crt_file=data_files/server8_int-ca2.crt \ |
| 7366 | key_file=data_files/server8.key \ |
| 7367 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7368 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7369 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7370 | mtu=512" \ |
| 7371 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7372 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7373 | -s "found fragmented DTLS handshake message" \ |
| 7374 | -c "found fragmented DTLS handshake message" \ |
| 7375 | -C "error" |
| 7376 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7377 | # An autoreduction on the client-side might happen if the server is |
| 7378 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7379 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7380 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7381 | requires_config_enabled MBEDTLS_RSA_C |
| 7382 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7383 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7384 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7385 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7386 | requires_config_enabled MBEDTLS_AES_C |
| 7387 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7388 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7389 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 7390 | -p "$P_PXY mtu=512" \ |
| 7391 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7392 | crt_file=data_files/server7_int-ca.crt \ |
| 7393 | key_file=data_files/server7.key \ |
| 7394 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7395 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7396 | mtu=512" \ |
| 7397 | "$P_CLI dtls=1 debug_level=2 \ |
| 7398 | crt_file=data_files/server8_int-ca2.crt \ |
| 7399 | key_file=data_files/server8.key \ |
| 7400 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7401 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7402 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7403 | mtu=512" \ |
| 7404 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7405 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7406 | -s "found fragmented DTLS handshake message" \ |
| 7407 | -c "found fragmented DTLS handshake message" \ |
| 7408 | -C "error" |
| 7409 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7410 | # An autoreduction on the client-side might happen if the server is |
| 7411 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7412 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7413 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7414 | requires_config_enabled MBEDTLS_RSA_C |
| 7415 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7416 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7417 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7418 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7419 | requires_config_enabled MBEDTLS_AES_C |
| 7420 | requires_config_enabled MBEDTLS_CCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7421 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7422 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7423 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7424 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7425 | crt_file=data_files/server7_int-ca.crt \ |
| 7426 | key_file=data_files/server7.key \ |
| 7427 | exchanges=2 renegotiation=1 \ |
| 7428 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7429 | hs_timeout=10000-60000 \ |
| 7430 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7431 | "$P_CLI dtls=1 debug_level=2 \ |
| 7432 | crt_file=data_files/server8_int-ca2.crt \ |
| 7433 | key_file=data_files/server8.key \ |
| 7434 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7435 | hs_timeout=10000-60000 \ |
| 7436 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7437 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7438 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7439 | -s "found fragmented DTLS handshake message" \ |
| 7440 | -c "found fragmented DTLS handshake message" \ |
| 7441 | -C "error" |
| 7442 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7443 | # An autoreduction on the client-side might happen if the server is |
| 7444 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7445 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7446 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7447 | requires_config_enabled MBEDTLS_RSA_C |
| 7448 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7449 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7450 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7451 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7452 | requires_config_enabled MBEDTLS_AES_C |
| 7453 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7454 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7455 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7456 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7457 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7458 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7459 | crt_file=data_files/server7_int-ca.crt \ |
| 7460 | key_file=data_files/server7.key \ |
| 7461 | exchanges=2 renegotiation=1 \ |
| 7462 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7463 | hs_timeout=10000-60000 \ |
| 7464 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7465 | "$P_CLI dtls=1 debug_level=2 \ |
| 7466 | crt_file=data_files/server8_int-ca2.crt \ |
| 7467 | key_file=data_files/server8.key \ |
| 7468 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7469 | hs_timeout=10000-60000 \ |
| 7470 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7471 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7472 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7473 | -s "found fragmented DTLS handshake message" \ |
| 7474 | -c "found fragmented DTLS handshake message" \ |
| 7475 | -C "error" |
| 7476 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7477 | # An autoreduction on the client-side might happen if the server is |
| 7478 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7479 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7480 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7481 | requires_config_enabled MBEDTLS_RSA_C |
| 7482 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7483 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7484 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7485 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7486 | requires_config_enabled MBEDTLS_AES_C |
| 7487 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7488 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7489 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7490 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7491 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7492 | crt_file=data_files/server7_int-ca.crt \ |
| 7493 | key_file=data_files/server7.key \ |
| 7494 | exchanges=2 renegotiation=1 \ |
| 7495 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7496 | hs_timeout=10000-60000 \ |
| 7497 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7498 | "$P_CLI dtls=1 debug_level=2 \ |
| 7499 | crt_file=data_files/server8_int-ca2.crt \ |
| 7500 | key_file=data_files/server8.key \ |
| 7501 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7502 | hs_timeout=10000-60000 \ |
| 7503 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7504 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7505 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7506 | -s "found fragmented DTLS handshake message" \ |
| 7507 | -c "found fragmented DTLS handshake message" \ |
| 7508 | -C "error" |
| 7509 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7510 | # Forcing ciphersuite for this test to fit the MTU of 512 with full config. |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7511 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7512 | requires_config_enabled MBEDTLS_RSA_C |
| 7513 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7514 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7515 | requires_config_enabled MBEDTLS_AES_C |
| 7516 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7517 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7518 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7519 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 7520 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7521 | "$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] | 7522 | crt_file=data_files/server7_int-ca.crt \ |
| 7523 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7524 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7525 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7526 | crt_file=data_files/server8_int-ca2.crt \ |
| 7527 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7528 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7529 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7530 | 0 \ |
| 7531 | -s "found fragmented DTLS handshake message" \ |
| 7532 | -c "found fragmented DTLS handshake message" \ |
| 7533 | -C "error" |
| 7534 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7535 | # 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] | 7536 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7537 | requires_config_enabled MBEDTLS_RSA_C |
| 7538 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7539 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7540 | requires_config_enabled MBEDTLS_AES_C |
| 7541 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7542 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7543 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7544 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 7545 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 7546 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7547 | crt_file=data_files/server7_int-ca.crt \ |
| 7548 | key_file=data_files/server7.key \ |
| 7549 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7550 | "$P_CLI dtls=1 debug_level=2 \ |
| 7551 | crt_file=data_files/server8_int-ca2.crt \ |
| 7552 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7553 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7554 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7555 | 0 \ |
| 7556 | -s "found fragmented DTLS handshake message" \ |
| 7557 | -c "found fragmented DTLS handshake message" \ |
| 7558 | -C "error" |
| 7559 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7560 | # interop tests for DTLS fragmentating with reliable connection |
| 7561 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7562 | # here and below we just want to test that the we fragment in a way that |
| 7563 | # pleases other implementations, so we don't need the peer to fragment |
| 7564 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7565 | requires_config_enabled MBEDTLS_RSA_C |
| 7566 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7567 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7568 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7569 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7570 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 7571 | "$G_SRV -u" \ |
| 7572 | "$P_CLI dtls=1 debug_level=2 \ |
| 7573 | crt_file=data_files/server8_int-ca2.crt \ |
| 7574 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 7575 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7576 | 0 \ |
| 7577 | -c "fragmenting handshake message" \ |
| 7578 | -C "error" |
| 7579 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 7580 | # We use --insecure for the GnuTLS client because it expects |
| 7581 | # the hostname / IP it connects to to be the name used in the |
| 7582 | # certificate obtained from the server. Here, however, it |
| 7583 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 7584 | # as the server name in the certificate. This will make the |
| 7585 | # certifiate validation fail, but passing --insecure makes |
| 7586 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7587 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7588 | requires_config_enabled MBEDTLS_RSA_C |
| 7589 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7590 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7591 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 7592 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7593 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7594 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7595 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7596 | crt_file=data_files/server7_int-ca.crt \ |
| 7597 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 7598 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7599 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7600 | 0 \ |
| 7601 | -s "fragmenting handshake message" |
| 7602 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7603 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7604 | requires_config_enabled MBEDTLS_RSA_C |
| 7605 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7606 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7607 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7608 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 7609 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7610 | "$P_CLI dtls=1 debug_level=2 \ |
| 7611 | crt_file=data_files/server8_int-ca2.crt \ |
| 7612 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 7613 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7614 | 0 \ |
| 7615 | -c "fragmenting handshake message" \ |
| 7616 | -C "error" |
| 7617 | |
| 7618 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7619 | requires_config_enabled MBEDTLS_RSA_C |
| 7620 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7621 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7622 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7623 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 7624 | "$P_SRV dtls=1 debug_level=2 \ |
| 7625 | crt_file=data_files/server7_int-ca.crt \ |
| 7626 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 7627 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7628 | "$O_CLI -dtls1_2" \ |
| 7629 | 0 \ |
| 7630 | -s "fragmenting handshake message" |
| 7631 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7632 | # interop tests for DTLS fragmentating with unreliable connection |
| 7633 | # |
| 7634 | # again we just want to test that the we fragment in a way that |
| 7635 | # pleases other implementations, so we don't need the peer to fragment |
| 7636 | requires_gnutls_next |
| 7637 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7638 | requires_config_enabled MBEDTLS_RSA_C |
| 7639 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7640 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7641 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7642 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7643 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 7644 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7645 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7646 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7647 | crt_file=data_files/server8_int-ca2.crt \ |
| 7648 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 7649 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7650 | 0 \ |
| 7651 | -c "fragmenting handshake message" \ |
| 7652 | -C "error" |
| 7653 | |
| 7654 | requires_gnutls_next |
| 7655 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7656 | requires_config_enabled MBEDTLS_RSA_C |
| 7657 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7658 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7659 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7660 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7661 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 7662 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7663 | "$P_SRV dtls=1 debug_level=2 \ |
| 7664 | crt_file=data_files/server7_int-ca.crt \ |
| 7665 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 7666 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 7667 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7668 | 0 \ |
| 7669 | -s "fragmenting handshake message" |
| 7670 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7671 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 7672 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7673 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7674 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 7675 | ## (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] | 7676 | skip_next_test |
| 7677 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7678 | requires_config_enabled MBEDTLS_RSA_C |
| 7679 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7680 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7681 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7682 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7683 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 7684 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7685 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7686 | "$P_CLI dtls=1 debug_level=2 \ |
| 7687 | crt_file=data_files/server8_int-ca2.crt \ |
| 7688 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 7689 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7690 | 0 \ |
| 7691 | -c "fragmenting handshake message" \ |
| 7692 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7693 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7694 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7695 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7696 | requires_config_enabled MBEDTLS_RSA_C |
| 7697 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7698 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7699 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7700 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7701 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 7702 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7703 | "$P_SRV dtls=1 debug_level=2 \ |
| 7704 | crt_file=data_files/server7_int-ca.crt \ |
| 7705 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame^] | 7706 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7707 | "$O_CLI -dtls1_2" \ |
| 7708 | 0 \ |
| 7709 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7710 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7711 | # Tests for DTLS-SRTP (RFC 5764) |
| 7712 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7713 | run_test "DTLS-SRTP all profiles supported" \ |
| 7714 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7715 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7716 | 0 \ |
| 7717 | -s "found use_srtp extension" \ |
| 7718 | -s "found srtp profile" \ |
| 7719 | -s "selected srtp profile" \ |
| 7720 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7721 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7722 | -c "client hello, adding use_srtp extension" \ |
| 7723 | -c "found use_srtp extension" \ |
| 7724 | -c "found srtp profile" \ |
| 7725 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7726 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7727 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7728 | -C "error" |
| 7729 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7730 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7731 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7732 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 7733 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7734 | "$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] | 7735 | 0 \ |
| 7736 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7737 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 7738 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7739 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7740 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7741 | -c "client hello, adding use_srtp extension" \ |
| 7742 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7743 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7744 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7745 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7746 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7747 | -C "error" |
| 7748 | |
| 7749 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7750 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7751 | "$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] | 7752 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7753 | 0 \ |
| 7754 | -s "found use_srtp extension" \ |
| 7755 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7756 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7757 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7758 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7759 | -c "client hello, adding use_srtp extension" \ |
| 7760 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7761 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7762 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7763 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7764 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7765 | -C "error" |
| 7766 | |
| 7767 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7768 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 7769 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7770 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7771 | 0 \ |
| 7772 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7773 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7774 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7775 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7776 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7777 | -c "client hello, adding use_srtp extension" \ |
| 7778 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7779 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7780 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7781 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7782 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7783 | -C "error" |
| 7784 | |
| 7785 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7786 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 7787 | "$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] | 7788 | "$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] | 7789 | 0 \ |
| 7790 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7791 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7792 | -S "selected srtp profile" \ |
| 7793 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7794 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7795 | -c "client hello, adding use_srtp extension" \ |
| 7796 | -C "found use_srtp extension" \ |
| 7797 | -C "found srtp profile" \ |
| 7798 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7799 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7800 | -C "error" |
| 7801 | |
| 7802 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7803 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 7804 | "$P_SRV dtls=1 debug_level=3" \ |
| 7805 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7806 | 0 \ |
| 7807 | -s "found use_srtp extension" \ |
| 7808 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7809 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7810 | -c "client hello, adding use_srtp extension" \ |
| 7811 | -C "found use_srtp extension" \ |
| 7812 | -C "found srtp profile" \ |
| 7813 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7814 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7815 | -C "error" |
| 7816 | |
| 7817 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7818 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 7819 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 7820 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7821 | 0 \ |
| 7822 | -s "found use_srtp extension" \ |
| 7823 | -s "found srtp profile" \ |
| 7824 | -s "selected srtp profile" \ |
| 7825 | -s "server hello, adding use_srtp extension" \ |
| 7826 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7827 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7828 | -c "client hello, adding use_srtp extension" \ |
| 7829 | -c "found use_srtp extension" \ |
| 7830 | -c "found srtp profile" \ |
| 7831 | -c "selected srtp profile" \ |
| 7832 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7833 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7834 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7835 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 7836 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7837 | -C "error" |
| 7838 | |
| 7839 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7840 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 7841 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7842 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7843 | 0 \ |
| 7844 | -s "found use_srtp extension" \ |
| 7845 | -s "found srtp profile" \ |
| 7846 | -s "selected srtp profile" \ |
| 7847 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7848 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 7849 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7850 | -S "dumping 'using mki' (8 bytes)" \ |
| 7851 | -c "client hello, adding use_srtp extension" \ |
| 7852 | -c "found use_srtp extension" \ |
| 7853 | -c "found srtp profile" \ |
| 7854 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7855 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 7856 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7857 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7858 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7859 | -C "dumping 'received mki' (8 bytes)" \ |
| 7860 | -C "error" |
| 7861 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7862 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 7863 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 7864 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7865 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7866 | 0 \ |
| 7867 | -s "found use_srtp extension" \ |
| 7868 | -s "found srtp profile" \ |
| 7869 | -s "selected srtp profile" \ |
| 7870 | -s "server hello, adding use_srtp extension" \ |
| 7871 | -s "DTLS-SRTP key material is"\ |
| 7872 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7873 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 7874 | |
| 7875 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7876 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 7877 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7878 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7879 | 0 \ |
| 7880 | -s "found use_srtp extension" \ |
| 7881 | -s "found srtp profile" \ |
| 7882 | -s "selected srtp profile" \ |
| 7883 | -s "server hello, adding use_srtp extension" \ |
| 7884 | -s "DTLS-SRTP key material is"\ |
| 7885 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7886 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7887 | |
| 7888 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7889 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 7890 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7891 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7892 | 0 \ |
| 7893 | -s "found use_srtp extension" \ |
| 7894 | -s "found srtp profile" \ |
| 7895 | -s "selected srtp profile" \ |
| 7896 | -s "server hello, adding use_srtp extension" \ |
| 7897 | -s "DTLS-SRTP key material is"\ |
| 7898 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7899 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7900 | |
| 7901 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7902 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 7903 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7904 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7905 | 0 \ |
| 7906 | -s "found use_srtp extension" \ |
| 7907 | -s "found srtp profile" \ |
| 7908 | -s "selected srtp profile" \ |
| 7909 | -s "server hello, adding use_srtp extension" \ |
| 7910 | -s "DTLS-SRTP key material is"\ |
| 7911 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7912 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7913 | |
| 7914 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7915 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 7916 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7917 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7918 | 0 \ |
| 7919 | -s "found use_srtp extension" \ |
| 7920 | -s "found srtp profile" \ |
| 7921 | -s "selected srtp profile" \ |
| 7922 | -s "server hello, adding use_srtp extension" \ |
| 7923 | -s "DTLS-SRTP key material is"\ |
| 7924 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7925 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7926 | |
| 7927 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7928 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 7929 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 7930 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7931 | 0 \ |
| 7932 | -s "found use_srtp extension" \ |
| 7933 | -s "found srtp profile" \ |
| 7934 | -S "selected srtp profile" \ |
| 7935 | -S "server hello, adding use_srtp extension" \ |
| 7936 | -S "DTLS-SRTP key material is"\ |
| 7937 | -C "SRTP Extension negotiated, profile" |
| 7938 | |
| 7939 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7940 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 7941 | "$P_SRV dtls=1 debug_level=3" \ |
| 7942 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7943 | 0 \ |
| 7944 | -s "found use_srtp extension" \ |
| 7945 | -S "server hello, adding use_srtp extension" \ |
| 7946 | -S "DTLS-SRTP key material is"\ |
| 7947 | -C "SRTP Extension negotiated, profile" |
| 7948 | |
| 7949 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7950 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 7951 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7952 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7953 | 0 \ |
| 7954 | -c "client hello, adding use_srtp extension" \ |
| 7955 | -c "found use_srtp extension" \ |
| 7956 | -c "found srtp profile" \ |
| 7957 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 7958 | -c "DTLS-SRTP key material is"\ |
| 7959 | -C "error" |
| 7960 | |
| 7961 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7962 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 7963 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7964 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7965 | 0 \ |
| 7966 | -c "client hello, adding use_srtp extension" \ |
| 7967 | -c "found use_srtp extension" \ |
| 7968 | -c "found srtp profile" \ |
| 7969 | -c "selected srtp profile" \ |
| 7970 | -c "DTLS-SRTP key material is"\ |
| 7971 | -C "error" |
| 7972 | |
| 7973 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7974 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 7975 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7976 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7977 | 0 \ |
| 7978 | -c "client hello, adding use_srtp extension" \ |
| 7979 | -c "found use_srtp extension" \ |
| 7980 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7981 | -c "selected srtp profile" \ |
| 7982 | -c "DTLS-SRTP key material is"\ |
| 7983 | -C "error" |
| 7984 | |
| 7985 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7986 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 7987 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7988 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7989 | 0 \ |
| 7990 | -c "client hello, adding use_srtp extension" \ |
| 7991 | -c "found use_srtp extension" \ |
| 7992 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7993 | -c "selected srtp profile" \ |
| 7994 | -c "DTLS-SRTP key material is"\ |
| 7995 | -C "error" |
| 7996 | |
| 7997 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7998 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 7999 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8000 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8001 | 0 \ |
| 8002 | -c "client hello, adding use_srtp extension" \ |
| 8003 | -c "found use_srtp extension" \ |
| 8004 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8005 | -c "selected srtp profile" \ |
| 8006 | -c "DTLS-SRTP key material is"\ |
| 8007 | -C "error" |
| 8008 | |
| 8009 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8010 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 8011 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8012 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 8013 | 0 \ |
| 8014 | -c "client hello, adding use_srtp extension" \ |
| 8015 | -C "found use_srtp extension" \ |
| 8016 | -C "found srtp profile" \ |
| 8017 | -C "selected srtp profile" \ |
| 8018 | -C "DTLS-SRTP key material is"\ |
| 8019 | -C "error" |
| 8020 | |
| 8021 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8022 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 8023 | "$O_SRV -dtls" \ |
| 8024 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8025 | 0 \ |
| 8026 | -c "client hello, adding use_srtp extension" \ |
| 8027 | -C "found use_srtp extension" \ |
| 8028 | -C "found srtp profile" \ |
| 8029 | -C "selected srtp profile" \ |
| 8030 | -C "DTLS-SRTP key material is"\ |
| 8031 | -C "error" |
| 8032 | |
| 8033 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8034 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 8035 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8036 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8037 | 0 \ |
| 8038 | -c "client hello, adding use_srtp extension" \ |
| 8039 | -c "found use_srtp extension" \ |
| 8040 | -c "found srtp profile" \ |
| 8041 | -c "selected srtp profile" \ |
| 8042 | -c "DTLS-SRTP key material is"\ |
| 8043 | -c "DTLS-SRTP no mki value negotiated"\ |
| 8044 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8045 | -C "dumping 'received mki' (8 bytes)" \ |
| 8046 | -C "error" |
| 8047 | |
| 8048 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8049 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8050 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8051 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8052 | "$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] | 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" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8058 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8059 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 8060 | |
| 8061 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8062 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8063 | 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] | 8064 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8065 | "$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] | 8066 | 0 \ |
| 8067 | -s "found use_srtp extension" \ |
| 8068 | -s "found srtp profile" \ |
| 8069 | -s "selected srtp profile" \ |
| 8070 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8071 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8072 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 8073 | |
| 8074 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8075 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8076 | 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] | 8077 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8078 | "$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] | 8079 | 0 \ |
| 8080 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8081 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8082 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8083 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8084 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8085 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 8086 | |
| 8087 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8088 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8089 | 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] | 8090 | "$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] | 8091 | "$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] | 8092 | 0 \ |
| 8093 | -s "found use_srtp extension" \ |
| 8094 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8095 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8096 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8097 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8098 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 8099 | |
| 8100 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8101 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8102 | 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] | 8103 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8104 | "$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] | 8105 | 0 \ |
| 8106 | -s "found use_srtp extension" \ |
| 8107 | -s "found srtp profile" \ |
| 8108 | -s "selected srtp profile" \ |
| 8109 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8110 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8111 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 8112 | |
| 8113 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8114 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8115 | 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] | 8116 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 8117 | "$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] | 8118 | 0 \ |
| 8119 | -s "found use_srtp extension" \ |
| 8120 | -s "found srtp profile" \ |
| 8121 | -S "selected srtp profile" \ |
| 8122 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8123 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8124 | -C "SRTP profile:" |
| 8125 | |
| 8126 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8127 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8128 | 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] | 8129 | "$P_SRV dtls=1 debug_level=3" \ |
| 8130 | "$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] | 8131 | 0 \ |
| 8132 | -s "found use_srtp extension" \ |
| 8133 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8134 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8135 | -C "SRTP profile:" |
| 8136 | |
| 8137 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8138 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8139 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 8140 | "$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" \ |
| 8141 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8142 | 0 \ |
| 8143 | -c "client hello, adding use_srtp extension" \ |
| 8144 | -c "found use_srtp extension" \ |
| 8145 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8146 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8147 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8148 | -C "error" |
| 8149 | |
| 8150 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8151 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8152 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 8153 | "$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" \ |
| 8154 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8155 | 0 \ |
| 8156 | -c "client hello, adding use_srtp extension" \ |
| 8157 | -c "found use_srtp extension" \ |
| 8158 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8159 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8160 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8161 | -C "error" |
| 8162 | |
| 8163 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8164 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8165 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 8166 | "$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" \ |
| 8167 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8168 | 0 \ |
| 8169 | -c "client hello, adding use_srtp extension" \ |
| 8170 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8171 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8172 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8173 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8174 | -C "error" |
| 8175 | |
| 8176 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8177 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8178 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 8179 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8180 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8181 | 0 \ |
| 8182 | -c "client hello, adding use_srtp extension" \ |
| 8183 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8184 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8185 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8186 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8187 | -C "error" |
| 8188 | |
| 8189 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8190 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8191 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 8192 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8193 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8194 | 0 \ |
| 8195 | -c "client hello, adding use_srtp extension" \ |
| 8196 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8197 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8198 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8199 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8200 | -C "error" |
| 8201 | |
| 8202 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8203 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8204 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 8205 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8206 | "$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] | 8207 | 0 \ |
| 8208 | -c "client hello, adding use_srtp extension" \ |
| 8209 | -C "found use_srtp extension" \ |
| 8210 | -C "found srtp profile" \ |
| 8211 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8212 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8213 | -C "error" |
| 8214 | |
| 8215 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8216 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8217 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 8218 | "$G_SRV -u" \ |
| 8219 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8220 | 0 \ |
| 8221 | -c "client hello, adding use_srtp extension" \ |
| 8222 | -C "found use_srtp extension" \ |
| 8223 | -C "found srtp profile" \ |
| 8224 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8225 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8226 | -C "error" |
| 8227 | |
| 8228 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8229 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8230 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 8231 | "$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" \ |
| 8232 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8233 | 0 \ |
| 8234 | -c "client hello, adding use_srtp extension" \ |
| 8235 | -c "found use_srtp extension" \ |
| 8236 | -c "found srtp profile" \ |
| 8237 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8238 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 8239 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8240 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8241 | -c "dumping 'received mki' (8 bytes)" \ |
| 8242 | -C "error" |
| 8243 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 8244 | # Tests for specific things with "unreliable" UDP connection |
| 8245 | |
| 8246 | not_with_valgrind # spurious resend due to timeout |
| 8247 | run_test "DTLS proxy: reference" \ |
| 8248 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8249 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 8250 | "$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] | 8251 | 0 \ |
| 8252 | -C "replayed record" \ |
| 8253 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 8254 | -C "Buffer record from epoch" \ |
| 8255 | -S "Buffer record from epoch" \ |
| 8256 | -C "ssl_buffer_message" \ |
| 8257 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8258 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8259 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8260 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8261 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8262 | -c "HTTP/1.0 200 OK" |
| 8263 | |
| 8264 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8265 | run_test "DTLS proxy: duplicate every packet" \ |
| 8266 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8267 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 8268 | "$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] | 8269 | 0 \ |
| 8270 | -c "replayed record" \ |
| 8271 | -s "replayed record" \ |
| 8272 | -c "record from another epoch" \ |
| 8273 | -s "record from another epoch" \ |
| 8274 | -S "resend" \ |
| 8275 | -s "Extra-header:" \ |
| 8276 | -c "HTTP/1.0 200 OK" |
| 8277 | |
| 8278 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 8279 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8280 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 8281 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8282 | 0 \ |
| 8283 | -c "replayed record" \ |
| 8284 | -S "replayed record" \ |
| 8285 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8286 | -s "record from another epoch" \ |
| 8287 | -c "resend" \ |
| 8288 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8289 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8290 | -c "HTTP/1.0 200 OK" |
| 8291 | |
| 8292 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 8293 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8294 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8295 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8296 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8297 | -c "next record in same datagram" \ |
| 8298 | -s "next record in same datagram" |
| 8299 | |
| 8300 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 8301 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8302 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8303 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8304 | 0 \ |
| 8305 | -c "next record in same datagram" \ |
| 8306 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8307 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8308 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 8309 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8310 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 8311 | "$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] | 8312 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8313 | -c "discarding invalid record (mac)" \ |
| 8314 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8315 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8316 | -c "HTTP/1.0 200 OK" \ |
| 8317 | -S "too many records with bad MAC" \ |
| 8318 | -S "Verification of the message MAC failed" |
| 8319 | |
| 8320 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 8321 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8322 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 8323 | "$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] | 8324 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8325 | -C "discarding invalid record (mac)" \ |
| 8326 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8327 | -S "Extra-header:" \ |
| 8328 | -C "HTTP/1.0 200 OK" \ |
| 8329 | -s "too many records with bad MAC" \ |
| 8330 | -s "Verification of the message MAC failed" |
| 8331 | |
| 8332 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 8333 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8334 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 8335 | "$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] | 8336 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8337 | -c "discarding invalid record (mac)" \ |
| 8338 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8339 | -s "Extra-header:" \ |
| 8340 | -c "HTTP/1.0 200 OK" \ |
| 8341 | -S "too many records with bad MAC" \ |
| 8342 | -S "Verification of the message MAC failed" |
| 8343 | |
| 8344 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 8345 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8346 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 8347 | "$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] | 8348 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8349 | -c "discarding invalid record (mac)" \ |
| 8350 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8351 | -s "Extra-header:" \ |
| 8352 | -c "HTTP/1.0 200 OK" \ |
| 8353 | -s "too many records with bad MAC" \ |
| 8354 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8355 | |
| 8356 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 8357 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 8358 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 8359 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8360 | 0 \ |
| 8361 | -c "record from another epoch" \ |
| 8362 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8363 | -s "Extra-header:" \ |
| 8364 | -c "HTTP/1.0 200 OK" |
| 8365 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8366 | # Tests for reordering support with DTLS |
| 8367 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8368 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 8369 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8370 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8371 | hs_timeout=2500-60000" \ |
| 8372 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8373 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8374 | 0 \ |
| 8375 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8376 | -c "Next handshake message has been buffered - load"\ |
| 8377 | -S "Buffering HS message" \ |
| 8378 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8379 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8380 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8381 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8382 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8383 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8384 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 8385 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8386 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8387 | hs_timeout=2500-60000" \ |
| 8388 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8389 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8390 | 0 \ |
| 8391 | -c "Buffering HS message" \ |
| 8392 | -c "found fragmented DTLS handshake message"\ |
| 8393 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 8394 | -c "Next handshake message has been buffered - load"\ |
| 8395 | -S "Buffering HS message" \ |
| 8396 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8397 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8398 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8399 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8400 | -S "Remember CCS message" |
| 8401 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8402 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 8403 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 8404 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 8405 | # while keeping the ServerKeyExchange. |
| 8406 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 8407 | 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] | 8408 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8409 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8410 | hs_timeout=2500-60000" \ |
| 8411 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8412 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8413 | 0 \ |
| 8414 | -c "Buffering HS message" \ |
| 8415 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8416 | -C "attempt to make space by freeing buffered messages" \ |
| 8417 | -S "Buffering HS message" \ |
| 8418 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8419 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8420 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8421 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8422 | -S "Remember CCS message" |
| 8423 | |
| 8424 | # The size constraints ensure that the delayed certificate message can't |
| 8425 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 8426 | # when dropping it first. |
| 8427 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 8428 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 8429 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 8430 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8431 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8432 | hs_timeout=2500-60000" \ |
| 8433 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8434 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8435 | 0 \ |
| 8436 | -c "Buffering HS message" \ |
| 8437 | -c "attempt to make space by freeing buffered future messages" \ |
| 8438 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8439 | -S "Buffering HS message" \ |
| 8440 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8441 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8442 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8443 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8444 | -S "Remember CCS message" |
| 8445 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8446 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 8447 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8448 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 8449 | hs_timeout=2500-60000" \ |
| 8450 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8451 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8452 | 0 \ |
| 8453 | -C "Buffering HS message" \ |
| 8454 | -C "Next handshake message has been buffered - load"\ |
| 8455 | -s "Buffering HS message" \ |
| 8456 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8457 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8458 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8459 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8460 | -S "Remember CCS message" |
| 8461 | |
| 8462 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 8463 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8464 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8465 | hs_timeout=2500-60000" \ |
| 8466 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8467 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8468 | 0 \ |
| 8469 | -C "Buffering HS message" \ |
| 8470 | -C "Next handshake message has been buffered - load"\ |
| 8471 | -S "Buffering HS message" \ |
| 8472 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8473 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8474 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8475 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8476 | -S "Remember CCS message" |
| 8477 | |
| 8478 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 8479 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8480 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8481 | hs_timeout=2500-60000" \ |
| 8482 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8483 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8484 | 0 \ |
| 8485 | -C "Buffering HS message" \ |
| 8486 | -C "Next handshake message has been buffered - load"\ |
| 8487 | -S "Buffering HS message" \ |
| 8488 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8489 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8490 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8491 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8492 | -s "Remember CCS message" |
| 8493 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8494 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8495 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8496 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8497 | hs_timeout=2500-60000" \ |
| 8498 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8499 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 8500 | 0 \ |
| 8501 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8502 | -s "Found buffered record from current epoch - load" \ |
| 8503 | -c "Buffer record from epoch 1" \ |
| 8504 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8505 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8506 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 8507 | # from the server are delayed, so that the encrypted Finished message |
| 8508 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 8509 | # in afterwards, the encrypted Finished message must be freed in order |
| 8510 | # to make space for the NewSessionTicket to be reassembled. |
| 8511 | # This works only in very particular circumstances: |
| 8512 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 8513 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 8514 | # the encrypted Finished message. |
| 8515 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 8516 | # needs to be fragmented. |
| 8517 | # - All messages sent by the server must be small enough to be either sent |
| 8518 | # without fragmentation or be reassembled within the bounds of |
| 8519 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 8520 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 8521 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 8522 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8523 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 8524 | -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] | 8525 | "$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] | 8526 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 8527 | 0 \ |
| 8528 | -s "Buffer record from epoch 1" \ |
| 8529 | -s "Found buffered record from current epoch - load" \ |
| 8530 | -c "Buffer record from epoch 1" \ |
| 8531 | -C "Found buffered record from current epoch - load" \ |
| 8532 | -c "Enough space available after freeing future epoch record" |
| 8533 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 8534 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 8535 | |
| 8536 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8537 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 8538 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8539 | "$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] | 8540 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8541 | "$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] | 8542 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8543 | 0 \ |
| 8544 | -s "Extra-header:" \ |
| 8545 | -c "HTTP/1.0 200 OK" |
| 8546 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8547 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8548 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 8549 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8550 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8551 | "$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] | 8552 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8553 | 0 \ |
| 8554 | -s "Extra-header:" \ |
| 8555 | -c "HTTP/1.0 200 OK" |
| 8556 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8557 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8558 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 8559 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8560 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8561 | "$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] | 8562 | 0 \ |
| 8563 | -s "Extra-header:" \ |
| 8564 | -c "HTTP/1.0 200 OK" |
| 8565 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8566 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8567 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 8568 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8569 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 8570 | "$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] | 8571 | 0 \ |
| 8572 | -s "Extra-header:" \ |
| 8573 | -c "HTTP/1.0 200 OK" |
| 8574 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8575 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8576 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 8577 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8578 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 8579 | "$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] | 8580 | 0 \ |
| 8581 | -s "Extra-header:" \ |
| 8582 | -c "HTTP/1.0 200 OK" |
| 8583 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8584 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8585 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 8586 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8587 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 8588 | "$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] | 8589 | 0 \ |
| 8590 | -s "Extra-header:" \ |
| 8591 | -c "HTTP/1.0 200 OK" |
| 8592 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8593 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8594 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 8595 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8596 | "$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] | 8597 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8598 | "$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] | 8599 | 0 \ |
| 8600 | -s "Extra-header:" \ |
| 8601 | -c "HTTP/1.0 200 OK" |
| 8602 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8603 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 8604 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 8605 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8606 | "$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] | 8607 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8608 | "$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] | 8609 | 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] | 8610 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8611 | 0 \ |
| 8612 | -s "a session has been resumed" \ |
| 8613 | -c "a session has been resumed" \ |
| 8614 | -s "Extra-header:" \ |
| 8615 | -c "HTTP/1.0 200 OK" |
| 8616 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8617 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 8618 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 8619 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8620 | "$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] | 8621 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8622 | "$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] | 8623 | 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] | 8624 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 8625 | 0 \ |
| 8626 | -s "a session has been resumed" \ |
| 8627 | -c "a session has been resumed" \ |
| 8628 | -s "Extra-header:" \ |
| 8629 | -c "HTTP/1.0 200 OK" |
| 8630 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8631 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8632 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8633 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8634 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8635 | "$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] | 8636 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8637 | "$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] | 8638 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8639 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8640 | 0 \ |
| 8641 | -c "=> renegotiate" \ |
| 8642 | -s "=> renegotiate" \ |
| 8643 | -s "Extra-header:" \ |
| 8644 | -c "HTTP/1.0 200 OK" |
| 8645 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8646 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8647 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8648 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 8649 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8650 | "$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] | 8651 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8652 | "$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] | 8653 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8654 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8655 | 0 \ |
| 8656 | -c "=> renegotiate" \ |
| 8657 | -s "=> renegotiate" \ |
| 8658 | -s "Extra-header:" \ |
| 8659 | -c "HTTP/1.0 200 OK" |
| 8660 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8661 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8662 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8663 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 8664 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8665 | "$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] | 8666 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8667 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8668 | "$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] | 8669 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8670 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8671 | 0 \ |
| 8672 | -c "=> renegotiate" \ |
| 8673 | -s "=> renegotiate" \ |
| 8674 | -s "Extra-header:" \ |
| 8675 | -c "HTTP/1.0 200 OK" |
| 8676 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8677 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8678 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8679 | 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] | 8680 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8681 | "$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] | 8682 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8683 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8684 | "$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] | 8685 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8686 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8687 | 0 \ |
| 8688 | -c "=> renegotiate" \ |
| 8689 | -s "=> renegotiate" \ |
| 8690 | -s "Extra-header:" \ |
| 8691 | -c "HTTP/1.0 200 OK" |
| 8692 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8693 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 8694 | ## all versions installed on the CI machines), reported here: |
| 8695 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 8696 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8697 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 8698 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8699 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8700 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8701 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8702 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8703 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8704 | "$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] | 8705 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8706 | -c "HTTP/1.0 200 OK" |
| 8707 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8708 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8709 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8710 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8711 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 8712 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8713 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8714 | "$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] | 8715 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8716 | -c "HTTP/1.0 200 OK" |
| 8717 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8718 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8719 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8720 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8721 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 8722 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8723 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8724 | "$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] | 8725 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8726 | -c "HTTP/1.0 200 OK" |
| 8727 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 8728 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8729 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8730 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8731 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 8732 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 8733 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8734 | "$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] | 8735 | 0 \ |
| 8736 | -s "Extra-header:" \ |
| 8737 | -c "Extra-header:" |
| 8738 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8739 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8740 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8741 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8742 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 8743 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8744 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8745 | "$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] | 8746 | 0 \ |
| 8747 | -s "Extra-header:" \ |
| 8748 | -c "Extra-header:" |
| 8749 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8750 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8751 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8752 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8753 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 8754 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8755 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8756 | "$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] | 8757 | 0 \ |
| 8758 | -s "Extra-header:" \ |
| 8759 | -c "Extra-header:" |
| 8760 | |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8761 | run_test "export keys functionality" \ |
| 8762 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 8763 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 8764 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 8765 | -c "EAP-TLS key material is:"\ |
| 8766 | -s "EAP-TLS key material is:"\ |
| 8767 | -c "EAP-TLS IV is:" \ |
| 8768 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8769 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 8770 | # openssl feature tests: check if tls1.3 exists. |
| 8771 | requires_openssl_tls1_3 |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 8772 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 8773 | run_test "TLS1.3: Test openssl tls1_3 feature" \ |
| 8774 | "$O_NEXT_SRV -tls1_3 -msg" \ |
| 8775 | "$O_NEXT_CLI -tls1_3 -msg" \ |
| 8776 | 0 \ |
| 8777 | -c "TLS 1.3" \ |
| 8778 | -s "TLS 1.3" |
| 8779 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 8780 | # 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] | 8781 | requires_gnutls_tls1_3 |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 8782 | requires_gnutls_next_no_ticket |
| 8783 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 8784 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 8785 | run_test "TLS1.3: Test gnutls tls1_3 feature" \ |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 8786 | "$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] | 8787 | "$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] | 8788 | 0 \ |
| 8789 | -s "Version: TLS1.3" \ |
| 8790 | -c "Version: TLS1.3" |
| 8791 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 8792 | # TLS1.3 test cases |
| 8793 | # TODO: remove or rewrite this test case if #4832 is resolved. |
| 8794 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8795 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 8796 | skip_handshake_stage_check |
Xiaofei Bai | d25fab6 | 2021-12-02 06:36:27 +0000 | [diff] [blame] | 8797 | run_test "TLS1.3: Not supported version check: tls12 and tls13" \ |
| 8798 | "$P_SRV debug_level=1 min_version=tls12 max_version=tls13" \ |
| 8799 | "$P_CLI debug_level=1 min_version=tls12 max_version=tls13" \ |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 8800 | 1 \ |
| 8801 | -s "SSL - The requested feature is not available" \ |
| 8802 | -c "SSL - The requested feature is not available" \ |
| 8803 | -s "Hybrid TLS 1.2 + TLS 1.3 configurations are not yet supported" \ |
| 8804 | -c "Hybrid TLS 1.2 + TLS 1.3 configurations are not yet supported" |
| 8805 | |
Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 8806 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8807 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
Xiaofei Bai | d25fab6 | 2021-12-02 06:36:27 +0000 | [diff] [blame] | 8808 | run_test "TLS1.3: handshake dispatch test: tls13 only" \ |
| 8809 | "$P_SRV debug_level=2 min_version=tls13 max_version=tls13" \ |
| 8810 | "$P_CLI debug_level=2 min_version=tls13 max_version=tls13" \ |
Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 8811 | 1 \ |
Xiaofei Bai | d25fab6 | 2021-12-02 06:36:27 +0000 | [diff] [blame] | 8812 | -s "tls13 server state: 0" \ |
| 8813 | -c "tls13 client state: 0" |
Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 8814 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 8815 | requires_openssl_tls1_3 |
| 8816 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
Jerry Yu | 42920ec | 2021-09-28 14:31:15 +0800 | [diff] [blame] | 8817 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 8818 | run_test "TLS1.3: minimal feature sets - openssl" \ |
| 8819 | "$O_NEXT_SRV -msg -tls1_3 -no_middlebox -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
Xiaofei Bai | d25fab6 | 2021-12-02 06:36:27 +0000 | [diff] [blame] | 8820 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 8821 | 0 \ |
Xiaofei Bai | d25fab6 | 2021-12-02 06:36:27 +0000 | [diff] [blame] | 8822 | -c "tls13 client state: 0" \ |
| 8823 | -c "tls13 client state: 2" \ |
| 8824 | -c "tls13 client state: 19" \ |
| 8825 | -c "tls13 client state: 5" \ |
| 8826 | -c "tls13 client state: 3" \ |
| 8827 | -c "tls13 client state: 9" \ |
| 8828 | -c "tls13 client state: 13" \ |
| 8829 | -c "tls13 client state: 11" \ |
| 8830 | -c "tls13 client state: 14" \ |
| 8831 | -c "tls13 client state: 15" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 8832 | -c "<= ssl_tls13_process_server_hello" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 8833 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 8834 | -c "ECDH curve: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 8835 | -c "=> ssl_tls13_process_server_hello" \ |
Jerry Yu | daac359 | 2021-10-29 20:01:42 +0800 | [diff] [blame] | 8836 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 8837 | -c "Certificate verification flags clear" \ |
Jerry Yu | 5398c10 | 2021-11-05 13:32:38 +0800 | [diff] [blame] | 8838 | -c "=> parse certificate verify" \ |
| 8839 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 8840 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 8841 | -c "<= parse finished message" \ |
| 8842 | -c "HTTP/1.0 200 ok" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 8843 | |
XiaokangQian | 3887ab5 | 2021-11-22 07:14:39 +0000 | [diff] [blame] | 8844 | requires_openssl_tls1_3 |
XiaokangQian | d940e64 | 2021-11-11 10:22:08 +0000 | [diff] [blame] | 8845 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
XiaokangQian | 4b82ca1 | 2021-11-18 08:27:17 +0000 | [diff] [blame] | 8846 | requires_config_enabled MBEDTLS_DEBUG_C |
| 8847 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 8848 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
XiaokangQian | a27b352 | 2021-11-23 02:27:07 +0000 | [diff] [blame] | 8849 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
XiaokangQian | 4b82ca1 | 2021-11-18 08:27:17 +0000 | [diff] [blame] | 8850 | run_test "TLS 1.3 m->O AES_128_GCM_SHA256 , RSA_PSS_RSAE_SHA256" \ |
XiaokangQian | 3887ab5 | 2021-11-22 07:14:39 +0000 | [diff] [blame] | 8851 | "$O_NEXT_SRV_RSA -ciphersuites TLS_AES_128_GCM_SHA256 -tls1_3 -msg -no_middlebox -num_tickets 0" \ |
Xiaofei Bai | d25fab6 | 2021-12-02 06:36:27 +0000 | [diff] [blame] | 8852 | "$P_CLI debug_level=4 force_version=tls13 server_name=localhost force_ciphersuite=TLS1-3-AES-128-GCM-SHA256 allow_sha1=0" \ |
XiaokangQian | 22dd68c | 2021-11-22 05:54:50 +0000 | [diff] [blame] | 8853 | 0 \ |
XiaokangQian | 4b82ca1 | 2021-11-18 08:27:17 +0000 | [diff] [blame] | 8854 | -c "ECDH curve: x25519" \ |
XiaokangQian | 4b82ca1 | 2021-11-18 08:27:17 +0000 | [diff] [blame] | 8855 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 8856 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
XiaokangQian | 4b82ca1 | 2021-11-18 08:27:17 +0000 | [diff] [blame] | 8857 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
XiaokangQian | 22dd68c | 2021-11-22 05:54:50 +0000 | [diff] [blame] | 8858 | -c "HTTP/1.0 200 ok" |
XiaokangQian | d940e64 | 2021-11-11 10:22:08 +0000 | [diff] [blame] | 8859 | |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 8860 | requires_gnutls_tls1_3 |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 8861 | requires_gnutls_next_no_ticket |
| 8862 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 8863 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
Jerry Yu | 42920ec | 2021-09-28 14:31:15 +0800 | [diff] [blame] | 8864 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 8865 | run_test "TLS1.3: minimal feature sets - gnutls" \ |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 8866 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE --disable-client-cert" \ |
Xiaofei Bai | d25fab6 | 2021-12-02 06:36:27 +0000 | [diff] [blame] | 8867 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 8868 | 0 \ |
Xiaofei Bai | d25fab6 | 2021-12-02 06:36:27 +0000 | [diff] [blame] | 8869 | -s "SERVER HELLO was queued" \ |
| 8870 | -c "tls13 client state: 0" \ |
| 8871 | -c "tls13 client state: 2" \ |
| 8872 | -c "tls13 client state: 19" \ |
| 8873 | -c "tls13 client state: 5" \ |
| 8874 | -c "tls13 client state: 3" \ |
| 8875 | -c "tls13 client state: 9" \ |
| 8876 | -c "tls13 client state: 13" \ |
| 8877 | -c "tls13 client state: 11" \ |
| 8878 | -c "tls13 client state: 14" \ |
| 8879 | -c "tls13 client state: 15" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 8880 | -c "<= ssl_tls13_process_server_hello" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 8881 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 8882 | -c "ECDH curve: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 8883 | -c "=> ssl_tls13_process_server_hello" \ |
Jerry Yu | daac359 | 2021-10-29 20:01:42 +0800 | [diff] [blame] | 8884 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 8885 | -c "Certificate verification flags clear" \ |
Jerry Yu | 5398c10 | 2021-11-05 13:32:38 +0800 | [diff] [blame] | 8886 | -c "=> parse certificate verify" \ |
| 8887 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 8888 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 8889 | -c "<= parse finished message" \ |
| 8890 | -c "HTTP/1.0 200 OK" |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 8891 | |
XiaokangQian | a27b352 | 2021-11-23 02:27:07 +0000 | [diff] [blame] | 8892 | requires_gnutls_next_no_ticket |
| 8893 | requires_gnutls_next_disable_tls13_compat |
XiaokangQian | 4b82ca1 | 2021-11-18 08:27:17 +0000 | [diff] [blame] | 8894 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 8895 | requires_config_enabled MBEDTLS_DEBUG_C |
| 8896 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 8897 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
XiaokangQian | a27b352 | 2021-11-23 02:27:07 +0000 | [diff] [blame] | 8898 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
XiaokangQian | 4b82ca1 | 2021-11-18 08:27:17 +0000 | [diff] [blame] | 8899 | requires_gnutls_next |
| 8900 | run_test "TLS 1.3 m->G AES_128_GCM_SHA256 , RSA_PSS_RSAE_SHA256" \ |
| 8901 | "$G_NEXT_SRV_RSA --disable-client-cert --priority=NORMAL:+CIPHER-ALL:+SHA256:+GROUP-SECP256R1:+ECDHE-ECDSA:+AEAD:+SIGN-RSA-PSS-RSAE-SHA256:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \ |
Xiaofei Bai | d25fab6 | 2021-12-02 06:36:27 +0000 | [diff] [blame] | 8902 | "$P_CLI debug_level=4 force_version=tls13 server_name=localhost force_ciphersuite=TLS1-3-AES-128-GCM-SHA256 allow_sha1=0" \ |
XiaokangQian | 22dd68c | 2021-11-22 05:54:50 +0000 | [diff] [blame] | 8903 | 0 \ |
XiaokangQian | 4b82ca1 | 2021-11-18 08:27:17 +0000 | [diff] [blame] | 8904 | -c "ECDH curve: x25519" \ |
XiaokangQian | f9fca8a | 2021-11-23 23:21:27 +0000 | [diff] [blame] | 8905 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
XiaokangQian | 4b82ca1 | 2021-11-18 08:27:17 +0000 | [diff] [blame] | 8906 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
XiaokangQian | 4b82ca1 | 2021-11-18 08:27:17 +0000 | [diff] [blame] | 8907 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
XiaokangQian | 22dd68c | 2021-11-22 05:54:50 +0000 | [diff] [blame] | 8908 | -c "HTTP/1.0 200 OK" |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 8909 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 8910 | # Test heap memory usage after handshake |
| 8911 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 8912 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 8913 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8914 | requires_max_content_len 16384 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 8915 | run_tests_memory_after_hanshake |
| 8916 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 8917 | # Final report |
| 8918 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8919 | echo "------------------------------------------------------------------------" |
| 8920 | |
| 8921 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8922 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8923 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8924 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8925 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 8926 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 8927 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8928 | |
| 8929 | exit $FAILS |