Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 3 | # ssl-opt.sh |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 4 | # |
Bence Szépkúti | 1e14827 | 2020-08-07 13:07:28 +0200 | [diff] [blame] | 5 | # Copyright The Mbed TLS Contributors |
Bence Szépkúti | c7da1fe | 2020-05-26 01:54:15 +0200 | [diff] [blame] | 6 | # SPDX-License-Identifier: Apache-2.0 |
| 7 | # |
| 8 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 9 | # not use this file except in compliance with the License. |
| 10 | # You may obtain a copy of the License at |
| 11 | # |
| 12 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 13 | # |
| 14 | # Unless required by applicable law or agreed to in writing, software |
| 15 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 16 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 17 | # See the License for the specific language governing permissions and |
| 18 | # limitations under the License. |
| 19 | # |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 20 | # Purpose |
| 21 | # |
| 22 | # Executes tests to prove various TLS/SSL options and extensions. |
| 23 | # |
| 24 | # The goal is not to cover every ciphersuite/version, but instead to cover |
| 25 | # specific options (max fragment length, truncated hmac, etc) or procedures |
| 26 | # (session resumption from cache or ticket, renego, etc). |
| 27 | # |
| 28 | # The tests assume a build with default options, with exceptions expressed |
| 29 | # with a dependency. The tests focus on functionality and do not consider |
| 30 | # performance. |
| 31 | # |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 32 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 33 | set -u |
| 34 | |
Jaeden Amero | 6e70eb2 | 2019-07-03 13:51:04 +0100 | [diff] [blame] | 35 | # Limit the size of each log to 10 GiB, in case of failures with this script |
| 36 | # where it may output seemingly unlimited length error logs. |
| 37 | ulimit -f 20971520 |
| 38 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 39 | ORIGINAL_PWD=$PWD |
| 40 | if ! cd "$(dirname "$0")"; then |
| 41 | exit 125 |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 42 | fi |
| 43 | |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 44 | # default values, can be overridden by the environment |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 45 | : ${P_SRV:=../programs/ssl/ssl_server2} |
| 46 | : ${P_CLI:=../programs/ssl/ssl_client2} |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 47 | : ${P_PXY:=../programs/test/udp_proxy} |
Jerry Yu | d04fd35 | 2021-12-06 16:52:57 +0800 | [diff] [blame] | 48 | : ${P_QUERY:=../programs/test/query_compile_time_config} |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 49 | : ${OPENSSL_CMD:=openssl} # OPENSSL would conflict with the build system |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 50 | : ${GNUTLS_CLI:=gnutls-cli} |
| 51 | : ${GNUTLS_SERV:=gnutls-serv} |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 52 | : ${PERL:=perl} |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 53 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 54 | guess_config_name() { |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 55 | if git diff --quiet ../include/mbedtls/mbedtls_config.h 2>/dev/null; then |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 56 | echo "default" |
| 57 | else |
| 58 | echo "unknown" |
| 59 | fi |
| 60 | } |
| 61 | : ${MBEDTLS_TEST_OUTCOME_FILE=} |
| 62 | : ${MBEDTLS_TEST_CONFIGURATION:="$(guess_config_name)"} |
| 63 | : ${MBEDTLS_TEST_PLATFORM:="$(uname -s | tr -c \\n0-9A-Za-z _)-$(uname -m | tr -c \\n0-9A-Za-z _)"} |
| 64 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 65 | O_SRV="$OPENSSL_CMD s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 66 | O_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_CMD s_client" |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 67 | G_SRV="$GNUTLS_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 68 | G_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_CLI --x509cafile data_files/test-ca_cat12.crt" |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 69 | TCP_CLIENT="$PERL scripts/tcp_client.pl" |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 70 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 71 | # alternative versions of OpenSSL and GnuTLS (no default path) |
| 72 | |
| 73 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 74 | O_LEGACY_SRV="$OPENSSL_LEGACY s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
| 75 | O_LEGACY_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_LEGACY s_client" |
| 76 | else |
| 77 | O_LEGACY_SRV=false |
| 78 | O_LEGACY_CLI=false |
| 79 | fi |
| 80 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 81 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
XiaokangQian | 30f5560 | 2021-11-24 01:54:50 +0000 | [diff] [blame] | 82 | O_NEXT_SRV="$OPENSSL_NEXT s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 83 | O_NEXT_SRV_NO_CERT="$OPENSSL_NEXT s_server -www " |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 84 | O_NEXT_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_NEXT s_client" |
| 85 | else |
| 86 | O_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 87 | O_NEXT_SRV_NO_CERT=false |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 88 | O_NEXT_CLI=false |
| 89 | fi |
| 90 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 91 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 92 | G_NEXT_SRV="$GNUTLS_NEXT_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 93 | G_NEXT_SRV_NO_CERT="$GNUTLS_NEXT_SERV" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 94 | else |
| 95 | G_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 96 | G_NEXT_SRV_NO_CERT=false |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 97 | fi |
| 98 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 99 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 100 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile data_files/test-ca_cat12.crt" |
| 101 | else |
| 102 | G_NEXT_CLI=false |
| 103 | fi |
| 104 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 105 | TESTS=0 |
| 106 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 107 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 108 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 109 | CONFIG_H='../include/mbedtls/mbedtls_config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 110 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 111 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 112 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 113 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 114 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 115 | SHOW_TEST_NUMBER=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 116 | RUN_TEST_NUMBER='' |
| 117 | |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 118 | PRESERVE_LOGS=0 |
| 119 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 120 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 121 | # port which is this plus 10000. Each port number may be independently |
| 122 | # overridden by a command line option. |
| 123 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 124 | PXY_PORT=$((SRV_PORT + 10000)) |
| 125 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 126 | print_usage() { |
| 127 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 128 | printf " -h|--help\tPrint this help.\n" |
| 129 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 130 | printf " -f|--filter\tOnly matching tests are executed (substring or BRE)\n" |
| 131 | printf " -e|--exclude\tMatching tests are excluded (substring or BRE)\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 132 | printf " -n|--number\tExecute only numbered test (comma-separated, e.g. '245,256')\n" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 133 | printf " -s|--show-numbers\tShow test numbers in front of test names\n" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 134 | printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 135 | printf " --outcome-file\tFile where test outcomes are written\n" |
| 136 | printf " \t(default: \$MBEDTLS_TEST_OUTCOME_FILE, none if empty)\n" |
| 137 | printf " --port \tTCP/UDP port (default: randomish 1xxxx)\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 138 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 139 | printf " --seed \tInteger seed value to use for this test run\n" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 140 | } |
| 141 | |
| 142 | get_options() { |
| 143 | while [ $# -gt 0 ]; do |
| 144 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 145 | -f|--filter) |
| 146 | shift; FILTER=$1 |
| 147 | ;; |
| 148 | -e|--exclude) |
| 149 | shift; EXCLUDE=$1 |
| 150 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 151 | -m|--memcheck) |
| 152 | MEMCHECK=1 |
| 153 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 154 | -n|--number) |
| 155 | shift; RUN_TEST_NUMBER=$1 |
| 156 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 157 | -s|--show-numbers) |
| 158 | SHOW_TEST_NUMBER=1 |
| 159 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 160 | -p|--preserve-logs) |
| 161 | PRESERVE_LOGS=1 |
| 162 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 163 | --port) |
| 164 | shift; SRV_PORT=$1 |
| 165 | ;; |
| 166 | --proxy-port) |
| 167 | shift; PXY_PORT=$1 |
| 168 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 169 | --seed) |
| 170 | shift; SEED="$1" |
| 171 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 172 | -h|--help) |
| 173 | print_usage |
| 174 | exit 0 |
| 175 | ;; |
| 176 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 177 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 178 | print_usage |
| 179 | exit 1 |
| 180 | ;; |
| 181 | esac |
| 182 | shift |
| 183 | done |
| 184 | } |
| 185 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 186 | # Make the outcome file path relative to the original directory, not |
| 187 | # to .../tests |
| 188 | case "$MBEDTLS_TEST_OUTCOME_FILE" in |
| 189 | [!/]*) |
| 190 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" |
| 191 | ;; |
| 192 | esac |
| 193 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 194 | # Read boolean configuration options from mbedtls_config.h for easy and quick |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 195 | # testing. Skip non-boolean options (with something other than spaces |
| 196 | # and a comment after "#define SYMBOL"). The variable contains a |
| 197 | # space-separated list of symbols. |
Jerry Yu | d0fcf7f | 2021-12-10 18:45:51 +0800 | [diff] [blame] | 198 | CONFIGS_ENABLED=" $(echo `$P_QUERY -l` )" |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 199 | # Skip next test; use this macro to skip tests which are legitimate |
| 200 | # in theory and expected to be re-introduced at some point, but |
| 201 | # aren't expected to succeed at the moment due to problems outside |
| 202 | # our control (such as bugs in other TLS implementations). |
| 203 | skip_next_test() { |
| 204 | SKIP_NEXT="YES" |
| 205 | } |
| 206 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 207 | # skip next test if the flag is not enabled in mbedtls_config.h |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 208 | requires_config_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 209 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 210 | *" $1"[\ =]*) :;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 211 | *) SKIP_NEXT="YES";; |
| 212 | esac |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 213 | } |
| 214 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 215 | # skip next test if the flag is enabled in mbedtls_config.h |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 216 | requires_config_disabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 217 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 218 | *" $1"[\ =]*) SKIP_NEXT="YES";; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 219 | esac |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 220 | } |
| 221 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 222 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 223 | # This function uses the query_config command line option to query the |
| 224 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 225 | # program. The command will always return a success value if the |
| 226 | # configuration is defined and the value will be printed to stdout. |
| 227 | # |
| 228 | # Note that if the configuration is not defined or is defined to nothing, |
| 229 | # the output of this function will be an empty string. |
| 230 | ${P_SRV} "query_config=${1}" |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 231 | } |
| 232 | |
| 233 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 234 | VAL="$( get_config_value_or_default "$1" )" |
| 235 | if [ -z "$VAL" ]; then |
| 236 | # Should never happen |
| 237 | echo "Mbed TLS configuration $1 is not defined" |
| 238 | exit 1 |
| 239 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 240 | SKIP_NEXT="YES" |
| 241 | fi |
| 242 | } |
| 243 | |
| 244 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 245 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 246 | if [ -z "$VAL" ]; then |
| 247 | # Should never happen |
| 248 | echo "Mbed TLS configuration $1 is not defined" |
| 249 | exit 1 |
| 250 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 251 | SKIP_NEXT="YES" |
| 252 | fi |
| 253 | } |
| 254 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 255 | requires_config_value_equals() { |
| 256 | VAL=$( get_config_value_or_default "$1" ) |
| 257 | if [ -z "$VAL" ]; then |
| 258 | # Should never happen |
| 259 | echo "Mbed TLS configuration $1 is not defined" |
| 260 | exit 1 |
| 261 | elif [ "$VAL" -ne "$2" ]; then |
| 262 | SKIP_NEXT="YES" |
| 263 | fi |
| 264 | } |
| 265 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 266 | # Space-separated list of ciphersuites supported by this build of |
| 267 | # Mbed TLS. |
| 268 | P_CIPHERSUITES=" $($P_CLI --help 2>/dev/null | |
XiaokangQian | 4b82ca1 | 2021-11-18 08:27:17 +0000 | [diff] [blame] | 269 | grep 'TLS-\|TLS1-3' | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 270 | tr -s ' \n' ' ')" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 271 | requires_ciphersuite_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 272 | case $P_CIPHERSUITES in |
| 273 | *" $1 "*) :;; |
| 274 | *) SKIP_NEXT="YES";; |
| 275 | esac |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 276 | } |
| 277 | |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 278 | # maybe_requires_ciphersuite_enabled CMD [RUN_TEST_OPTION...] |
| 279 | # If CMD (call to a TLS client or server program) requires a specific |
| 280 | # ciphersuite, arrange to only run the test case if this ciphersuite is |
Dave Rodgman | c424098 | 2021-06-29 19:53:16 +0100 | [diff] [blame] | 281 | # enabled. |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 282 | maybe_requires_ciphersuite_enabled() { |
| 283 | case "$1" in |
| 284 | *\ force_ciphersuite=*) :;; |
| 285 | *) return;; # No specific required ciphersuite |
| 286 | esac |
| 287 | ciphersuite="${1##*\ force_ciphersuite=}" |
| 288 | ciphersuite="${ciphersuite%%[!-0-9A-Z_a-z]*}" |
| 289 | shift |
| 290 | |
Dave Rodgman | c424098 | 2021-06-29 19:53:16 +0100 | [diff] [blame] | 291 | requires_ciphersuite_enabled "$ciphersuite" |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 292 | |
| 293 | unset ciphersuite |
| 294 | } |
| 295 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 296 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 297 | requires_openssl_with_fallback_scsv() { |
| 298 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 299 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 300 | then |
| 301 | OPENSSL_HAS_FBSCSV="YES" |
| 302 | else |
| 303 | OPENSSL_HAS_FBSCSV="NO" |
| 304 | fi |
| 305 | fi |
| 306 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 307 | SKIP_NEXT="YES" |
| 308 | fi |
| 309 | } |
| 310 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 311 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 312 | requires_max_content_len() { |
| 313 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 314 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 315 | } |
| 316 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 317 | # skip next test if GnuTLS isn't available |
| 318 | requires_gnutls() { |
| 319 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 320 | if ( which "$GNUTLS_CLI" && which "$GNUTLS_SERV" ) >/dev/null 2>&1; then |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 321 | GNUTLS_AVAILABLE="YES" |
| 322 | else |
| 323 | GNUTLS_AVAILABLE="NO" |
| 324 | fi |
| 325 | fi |
| 326 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 327 | SKIP_NEXT="YES" |
| 328 | fi |
| 329 | } |
| 330 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 331 | # skip next test if GnuTLS-next isn't available |
| 332 | requires_gnutls_next() { |
| 333 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 334 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 335 | GNUTLS_NEXT_AVAILABLE="YES" |
| 336 | else |
| 337 | GNUTLS_NEXT_AVAILABLE="NO" |
| 338 | fi |
| 339 | fi |
| 340 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 341 | SKIP_NEXT="YES" |
| 342 | fi |
| 343 | } |
| 344 | |
| 345 | # skip next test if OpenSSL-legacy isn't available |
| 346 | requires_openssl_legacy() { |
| 347 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 348 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 349 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 350 | else |
| 351 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 352 | fi |
| 353 | fi |
| 354 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 355 | SKIP_NEXT="YES" |
| 356 | fi |
| 357 | } |
| 358 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 359 | requires_openssl_next() { |
| 360 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then |
| 361 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then |
| 362 | OPENSSL_NEXT_AVAILABLE="YES" |
| 363 | else |
| 364 | OPENSSL_NEXT_AVAILABLE="NO" |
| 365 | fi |
| 366 | fi |
| 367 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 368 | SKIP_NEXT="YES" |
| 369 | fi |
| 370 | } |
| 371 | |
| 372 | # skip next test if tls1_3 is not available |
| 373 | requires_openssl_tls1_3() { |
| 374 | requires_openssl_next |
| 375 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 376 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 377 | fi |
| 378 | if [ -z "${OPENSSL_TLS1_3_AVAILABLE:-}" ]; then |
| 379 | if $OPENSSL_NEXT s_client -help 2>&1 | grep tls1_3 >/dev/null |
| 380 | then |
| 381 | OPENSSL_TLS1_3_AVAILABLE="YES" |
| 382 | else |
| 383 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 384 | fi |
| 385 | fi |
| 386 | if [ "$OPENSSL_TLS1_3_AVAILABLE" = "NO" ]; then |
| 387 | SKIP_NEXT="YES" |
| 388 | fi |
| 389 | } |
| 390 | |
| 391 | # skip next test if tls1_3 is not available |
| 392 | requires_gnutls_tls1_3() { |
| 393 | requires_gnutls_next |
| 394 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 395 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 396 | fi |
| 397 | if [ -z "${GNUTLS_TLS1_3_AVAILABLE:-}" ]; then |
| 398 | if $GNUTLS_NEXT_CLI -l 2>&1 | grep VERS-TLS1.3 >/dev/null |
| 399 | then |
| 400 | GNUTLS_TLS1_3_AVAILABLE="YES" |
| 401 | else |
| 402 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 403 | fi |
| 404 | fi |
| 405 | if [ "$GNUTLS_TLS1_3_AVAILABLE" = "NO" ]; then |
| 406 | SKIP_NEXT="YES" |
| 407 | fi |
| 408 | } |
| 409 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 410 | # Check %NO_TICKETS option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 411 | requires_gnutls_next_no_ticket() { |
| 412 | requires_gnutls_next |
| 413 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 414 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 415 | fi |
| 416 | if [ -z "${GNUTLS_NO_TICKETS_AVAILABLE:-}" ]; then |
| 417 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep NO_TICKETS >/dev/null |
| 418 | then |
| 419 | GNUTLS_NO_TICKETS_AVAILABLE="YES" |
| 420 | else |
| 421 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 422 | fi |
| 423 | fi |
| 424 | if [ "$GNUTLS_NO_TICKETS_AVAILABLE" = "NO" ]; then |
| 425 | SKIP_NEXT="YES" |
| 426 | fi |
| 427 | } |
| 428 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 429 | # Check %DISABLE_TLS13_COMPAT_MODE option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 430 | requires_gnutls_next_disable_tls13_compat() { |
| 431 | requires_gnutls_next |
| 432 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 433 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 434 | fi |
| 435 | if [ -z "${GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE:-}" ]; then |
| 436 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep DISABLE_TLS13_COMPAT_MODE >/dev/null |
| 437 | then |
| 438 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="YES" |
| 439 | else |
| 440 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 441 | fi |
| 442 | fi |
| 443 | if [ "$GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE" = "NO" ]; then |
| 444 | SKIP_NEXT="YES" |
| 445 | fi |
| 446 | } |
| 447 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 448 | # skip next test if IPv6 isn't available on this host |
| 449 | requires_ipv6() { |
| 450 | if [ -z "${HAS_IPV6:-}" ]; then |
| 451 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 452 | SRV_PID=$! |
| 453 | sleep 1 |
| 454 | kill $SRV_PID >/dev/null 2>&1 |
| 455 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 456 | HAS_IPV6="NO" |
| 457 | else |
| 458 | HAS_IPV6="YES" |
| 459 | fi |
| 460 | rm -r $SRV_OUT |
| 461 | fi |
| 462 | |
| 463 | if [ "$HAS_IPV6" = "NO" ]; then |
| 464 | SKIP_NEXT="YES" |
| 465 | fi |
| 466 | } |
| 467 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 468 | # skip next test if it's i686 or uname is not available |
| 469 | requires_not_i686() { |
| 470 | if [ -z "${IS_I686:-}" ]; then |
| 471 | IS_I686="YES" |
| 472 | if which "uname" >/dev/null 2>&1; then |
| 473 | if [ -z "$(uname -a | grep i686)" ]; then |
| 474 | IS_I686="NO" |
| 475 | fi |
| 476 | fi |
| 477 | fi |
| 478 | if [ "$IS_I686" = "YES" ]; then |
| 479 | SKIP_NEXT="YES" |
| 480 | fi |
| 481 | } |
| 482 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 483 | # Calculate the input & output maximum content lengths set in the config |
David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 484 | MAX_CONTENT_LEN=16384 |
Yuto Takano | 2be6f1a | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 485 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 486 | MAX_OUT_LEN=$( get_config_value_or_default "MBEDTLS_SSL_OUT_CONTENT_LEN" ) |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 487 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 488 | # Calculate the maximum content length that fits both |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 489 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 490 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 491 | fi |
| 492 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 493 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 494 | fi |
| 495 | |
| 496 | # skip the next test if the SSL output buffer is less than 16KB |
| 497 | requires_full_size_output_buffer() { |
| 498 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 499 | SKIP_NEXT="YES" |
| 500 | fi |
| 501 | } |
| 502 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 503 | # skip the next test if valgrind is in use |
| 504 | not_with_valgrind() { |
| 505 | if [ "$MEMCHECK" -gt 0 ]; then |
| 506 | SKIP_NEXT="YES" |
| 507 | fi |
| 508 | } |
| 509 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 510 | # skip the next test if valgrind is NOT in use |
| 511 | only_with_valgrind() { |
| 512 | if [ "$MEMCHECK" -eq 0 ]; then |
| 513 | SKIP_NEXT="YES" |
| 514 | fi |
| 515 | } |
| 516 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 517 | # multiply the client timeout delay by the given factor for the next test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 518 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 519 | CLI_DELAY_FACTOR=$1 |
| 520 | } |
| 521 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 522 | # wait for the given seconds after the client finished in the next test |
| 523 | server_needs_more_time() { |
| 524 | SRV_DELAY_SECONDS=$1 |
| 525 | } |
| 526 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 527 | # print_name <name> |
| 528 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 529 | TESTS=$(( $TESTS + 1 )) |
| 530 | LINE="" |
| 531 | |
| 532 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 533 | LINE="$TESTS " |
| 534 | fi |
| 535 | |
| 536 | LINE="$LINE$1" |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 537 | printf "%s " "$LINE" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 538 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 539 | for i in `seq 1 $LEN`; do printf '.'; done |
| 540 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 541 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 542 | } |
| 543 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 544 | # record_outcome <outcome> [<failure-reason>] |
| 545 | # The test name must be in $NAME. |
| 546 | record_outcome() { |
| 547 | echo "$1" |
| 548 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 549 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 550 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
| 551 | "ssl-opt" "$NAME" \ |
| 552 | "$1" "${2-}" \ |
| 553 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 554 | fi |
| 555 | } |
| 556 | |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 557 | # True if the presence of the given pattern in a log definitely indicates |
| 558 | # that the test has failed. False if the presence is inconclusive. |
| 559 | # |
| 560 | # Inputs: |
| 561 | # * $1: pattern found in the logs |
| 562 | # * $TIMES_LEFT: >0 if retrying is an option |
| 563 | # |
| 564 | # Outputs: |
| 565 | # * $outcome: set to a retry reason if the pattern is inconclusive, |
| 566 | # unchanged otherwise. |
| 567 | # * Return value: 1 if the pattern is inconclusive, |
| 568 | # 0 if the failure is definitive. |
| 569 | log_pattern_presence_is_conclusive() { |
| 570 | # If we've run out of attempts, then don't retry no matter what. |
| 571 | if [ $TIMES_LEFT -eq 0 ]; then |
| 572 | return 0 |
| 573 | fi |
| 574 | case $1 in |
| 575 | "resend") |
| 576 | # An undesired resend may have been caused by the OS dropping or |
| 577 | # delaying a packet at an inopportune time. |
| 578 | outcome="RETRY(resend)" |
| 579 | return 1;; |
| 580 | esac |
| 581 | } |
| 582 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 583 | # fail <message> |
| 584 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 585 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 586 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 587 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 588 | mv $SRV_OUT o-srv-${TESTS}.log |
| 589 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 590 | if [ -n "$PXY_CMD" ]; then |
| 591 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 592 | fi |
| 593 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 594 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 595 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 596 | echo " ! server output:" |
| 597 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 598 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 599 | echo " ! client output:" |
| 600 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 601 | if [ -n "$PXY_CMD" ]; then |
| 602 | echo " ! ========================================================" |
| 603 | echo " ! proxy output:" |
| 604 | cat o-pxy-${TESTS}.log |
| 605 | fi |
| 606 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 607 | fi |
| 608 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 609 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 610 | } |
| 611 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 612 | # is_polar <cmd_line> |
| 613 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 614 | case "$1" in |
| 615 | *ssl_client2*) true;; |
| 616 | *ssl_server2*) true;; |
| 617 | *) false;; |
| 618 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 619 | } |
| 620 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 621 | # openssl s_server doesn't have -www with DTLS |
| 622 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 623 | case "$SRV_CMD" in |
| 624 | *s_server*-dtls*) |
| 625 | NEEDS_INPUT=1 |
| 626 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 627 | *) NEEDS_INPUT=0;; |
| 628 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 629 | } |
| 630 | |
| 631 | # provide input to commands that need it |
| 632 | provide_input() { |
| 633 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 634 | return |
| 635 | fi |
| 636 | |
| 637 | while true; do |
| 638 | echo "HTTP/1.0 200 OK" |
| 639 | sleep 1 |
| 640 | done |
| 641 | } |
| 642 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 643 | # has_mem_err <log_file_name> |
| 644 | has_mem_err() { |
| 645 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 646 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 647 | then |
| 648 | return 1 # false: does not have errors |
| 649 | else |
| 650 | return 0 # true: has errors |
| 651 | fi |
| 652 | } |
| 653 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 654 | # Wait for process $2 named $3 to be listening on port $1. Print error to $4. |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 655 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 656 | wait_app_start() { |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 657 | newline=' |
| 658 | ' |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 659 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 660 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 661 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 662 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 663 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 664 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 665 | # Make a tight loop, server normally takes less than 1s to start. |
Paul Elliott | 58ed8a7 | 2021-10-19 17:56:39 +0100 | [diff] [blame] | 666 | while true; do |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 667 | SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -F p) |
| 668 | # When we use a proxy, it will be listening on the same port we |
| 669 | # are checking for as well as the server and lsof will list both. |
| 670 | # If multiple PIDs are returned, each one will be on a separate |
| 671 | # line, each prepended with 'p'. |
| 672 | case ${newline}${SERVER_PIDS}${newline} in |
| 673 | *${newline}p${2}${newline}*) break;; |
| 674 | esac |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 675 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 676 | echo "$3 START TIMEOUT" |
| 677 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 678 | break |
| 679 | fi |
| 680 | # Linux and *BSD support decimal arguments to sleep. On other |
| 681 | # OSes this may be a tight loop. |
| 682 | sleep 0.1 2>/dev/null || true |
| 683 | done |
| 684 | } |
| 685 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 686 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 687 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 688 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 689 | } |
| 690 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 691 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 692 | # Wait for server process $2 to be listening on port $1. |
| 693 | wait_server_start() { |
| 694 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 695 | } |
| 696 | |
| 697 | # Wait for proxy process $2 to be listening on port $1. |
| 698 | wait_proxy_start() { |
| 699 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 700 | } |
| 701 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 702 | # Given the client or server debug output, parse the unix timestamp that is |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 703 | # included in the first 4 bytes of the random bytes and check that it's within |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 704 | # acceptable bounds |
| 705 | check_server_hello_time() { |
| 706 | # Extract the time from the debug (lvl 3) output of the client |
Andres Amaya Garcia | 67d8da5 | 2017-09-15 15:49:24 +0100 | [diff] [blame] | 707 | SERVER_HELLO_TIME="$(sed -n 's/.*server hello, current time: //p' < "$1")" |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 708 | # Get the Unix timestamp for now |
| 709 | CUR_TIME=$(date +'%s') |
| 710 | THRESHOLD_IN_SECS=300 |
| 711 | |
| 712 | # Check if the ServerHello time was printed |
| 713 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 714 | return 1 |
| 715 | fi |
| 716 | |
| 717 | # Check the time in ServerHello is within acceptable bounds |
| 718 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 719 | # The time in ServerHello is at least 5 minutes before now |
| 720 | return 1 |
| 721 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 722 | # The time in ServerHello is at least 5 minutes later than now |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 723 | return 1 |
| 724 | else |
| 725 | return 0 |
| 726 | fi |
| 727 | } |
| 728 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 729 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 730 | handshake_memory_get() { |
| 731 | OUTPUT_VARIABLE="$1" |
| 732 | OUTPUT_FILE="$2" |
| 733 | |
| 734 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 735 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 736 | |
| 737 | # Check if memory usage was read |
| 738 | if [ -z "$MEM_USAGE" ]; then |
| 739 | echo "Error: Can not read the value of handshake memory usage" |
| 740 | return 1 |
| 741 | else |
| 742 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 743 | return 0 |
| 744 | fi |
| 745 | } |
| 746 | |
| 747 | # Get handshake memory usage from server or client output and check if this value |
| 748 | # is not higher than the maximum given by the first argument |
| 749 | handshake_memory_check() { |
| 750 | MAX_MEMORY="$1" |
| 751 | OUTPUT_FILE="$2" |
| 752 | |
| 753 | # Get memory usage |
| 754 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 755 | return 1 |
| 756 | fi |
| 757 | |
| 758 | # Check if memory usage is below max value |
| 759 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 760 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 761 | "but should be below $MAX_MEMORY bytes" |
| 762 | return 1 |
| 763 | else |
| 764 | return 0 |
| 765 | fi |
| 766 | } |
| 767 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 768 | # wait for client to terminate and set CLI_EXIT |
| 769 | # must be called right after starting the client |
| 770 | wait_client_done() { |
| 771 | CLI_PID=$! |
| 772 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 773 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 774 | CLI_DELAY_FACTOR=1 |
| 775 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 776 | ( sleep $CLI_DELAY; echo "===CLIENT_TIMEOUT===" >> $CLI_OUT; kill $CLI_PID ) & |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 777 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 778 | |
| 779 | wait $CLI_PID |
| 780 | CLI_EXIT=$? |
| 781 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 782 | kill $DOG_PID >/dev/null 2>&1 |
| 783 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 784 | |
| 785 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 786 | |
| 787 | sleep $SRV_DELAY_SECONDS |
| 788 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 789 | } |
| 790 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 791 | # check if the given command uses dtls and sets global variable DTLS |
| 792 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 793 | case "$1" in |
Paul Elliott | 1428f25 | 2021-10-12 16:02:55 +0100 | [diff] [blame] | 794 | *dtls=1*|*-dtls*|*-u*) DTLS=1;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 795 | *) DTLS=0;; |
| 796 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 797 | } |
| 798 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 799 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 800 | is_gnutls() { |
| 801 | case "$1" in |
| 802 | *gnutls-cli*) |
| 803 | CMD_IS_GNUTLS=1 |
| 804 | ;; |
| 805 | *gnutls-serv*) |
| 806 | CMD_IS_GNUTLS=1 |
| 807 | ;; |
| 808 | *) |
| 809 | CMD_IS_GNUTLS=0 |
| 810 | ;; |
| 811 | esac |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 812 | } |
| 813 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 814 | # Compare file content |
| 815 | # Usage: find_in_both pattern file1 file2 |
| 816 | # extract from file1 the first line matching the pattern |
| 817 | # check in file2 that the same line can be found |
| 818 | find_in_both() { |
| 819 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 820 | if [ -z "$srv_pattern" ]; then |
| 821 | return 1; |
| 822 | fi |
| 823 | |
| 824 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 825 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 826 | else |
| 827 | return 1; |
| 828 | fi |
| 829 | } |
| 830 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 831 | SKIP_HANDSHAKE_CHECK="NO" |
| 832 | skip_handshake_stage_check() { |
| 833 | SKIP_HANDSHAKE_CHECK="YES" |
| 834 | } |
| 835 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 836 | # Analyze the commands that will be used in a test. |
| 837 | # |
| 838 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass |
| 839 | # extra arguments or go through wrappers. |
| 840 | # Set $DTLS (0=TLS, 1=DTLS). |
| 841 | analyze_test_commands() { |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 842 | # update DTLS variable |
| 843 | detect_dtls "$SRV_CMD" |
| 844 | |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 845 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 846 | # as it provides timing info that's useful to debug failures |
Manuel Pégourié-Gonnard | 70fce98 | 2020-06-25 09:54:46 +0200 | [diff] [blame] | 847 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 848 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 849 | case " $SRV_CMD " in |
| 850 | *' server_addr=::1 '*) |
| 851 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 852 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 853 | fi |
| 854 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 855 | # update CMD_IS_GNUTLS variable |
| 856 | is_gnutls "$SRV_CMD" |
| 857 | |
| 858 | # if the server uses gnutls but doesn't set priority, explicitly |
| 859 | # set the default priority |
| 860 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 861 | case "$SRV_CMD" in |
| 862 | *--priority*) :;; |
| 863 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 864 | esac |
| 865 | fi |
| 866 | |
| 867 | # update CMD_IS_GNUTLS variable |
| 868 | is_gnutls "$CLI_CMD" |
| 869 | |
| 870 | # if the client uses gnutls but doesn't set priority, explicitly |
| 871 | # set the default priority |
| 872 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 873 | case "$CLI_CMD" in |
| 874 | *--priority*) :;; |
| 875 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 876 | esac |
| 877 | fi |
| 878 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 879 | # fix client port |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 880 | if [ -n "$PXY_CMD" ]; then |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 881 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 882 | else |
| 883 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 884 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 885 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 886 | # prepend valgrind to our commands if active |
| 887 | if [ "$MEMCHECK" -gt 0 ]; then |
| 888 | if is_polar "$SRV_CMD"; then |
| 889 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 890 | fi |
| 891 | if is_polar "$CLI_CMD"; then |
| 892 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 893 | fi |
| 894 | fi |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 895 | } |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 896 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 897 | # Check for failure conditions after a test case. |
| 898 | # |
| 899 | # Inputs from run_test: |
| 900 | # * positional parameters: test options (see run_test documentation) |
| 901 | # * $CLI_EXIT: client return code |
| 902 | # * $CLI_EXPECT: expected client return code |
| 903 | # * $SRV_RET: server return code |
| 904 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 905 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 906 | # |
| 907 | # Outputs: |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 908 | # * $outcome: one of PASS/RETRY*/FAIL |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 909 | check_test_failure() { |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 910 | outcome=FAIL |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 911 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 912 | if [ $TIMES_LEFT -gt 0 ] && |
| 913 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null |
| 914 | then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 915 | outcome="RETRY(client-timeout)" |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 916 | return |
| 917 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 918 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 919 | # check if the client and server went at least to the handshake stage |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 920 | # (useful to avoid tests with only negative assertions and non-zero |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 921 | # expected client exit to incorrectly succeed in case of catastrophic |
| 922 | # failure) |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 923 | if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ] |
| 924 | then |
| 925 | if is_polar "$SRV_CMD"; then |
| 926 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
| 927 | else |
| 928 | fail "server or client failed to reach handshake stage" |
| 929 | return |
| 930 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 931 | fi |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 932 | if is_polar "$CLI_CMD"; then |
| 933 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
| 934 | else |
| 935 | fail "server or client failed to reach handshake stage" |
| 936 | return |
| 937 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 938 | fi |
| 939 | fi |
| 940 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 941 | SKIP_HANDSHAKE_CHECK="NO" |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 942 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 943 | # exit with status 0 when interrupted by a signal, and we don't really |
| 944 | # care anyway), in case e.g. the server reports a memory leak. |
| 945 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 946 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 947 | return |
| 948 | fi |
| 949 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 950 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 951 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 952 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 953 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 954 | fail "bad client exit code (expected $CLI_EXPECT, got $CLI_EXIT)" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 955 | return |
| 956 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 957 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 958 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 959 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 960 | # lines with 'Serious error when reading debug info', are valgrind issues as well |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 961 | while [ $# -gt 0 ] |
| 962 | do |
| 963 | case $1 in |
| 964 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 965 | if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then :; else |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 966 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 967 | return |
| 968 | fi |
| 969 | ;; |
| 970 | |
| 971 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 972 | if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then :; else |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 973 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 974 | return |
| 975 | fi |
| 976 | ;; |
| 977 | |
| 978 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 979 | if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 980 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 981 | fail "pattern '$2' MUST NOT be present in the Server output" |
| 982 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 983 | return |
| 984 | fi |
| 985 | ;; |
| 986 | |
| 987 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 988 | if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 989 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 990 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 991 | fi |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 992 | return |
| 993 | fi |
| 994 | ;; |
| 995 | |
| 996 | # The filtering in the following two options (-u and -U) do the following |
| 997 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 998 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 999 | # - keep one of each non-unique line |
| 1000 | # - count how many lines remain |
| 1001 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 1002 | # if there were no duplicates. |
| 1003 | "-U") |
| 1004 | if [ $(grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep -A1 "$2" | grep -v "$2" | sort | uniq -d | wc -l) -gt 1 ]; then |
| 1005 | fail "lines following pattern '$2' must be unique in Server output" |
| 1006 | return |
| 1007 | fi |
| 1008 | ;; |
| 1009 | |
| 1010 | "-u") |
| 1011 | if [ $(grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep -A1 "$2" | grep -v "$2" | sort | uniq -d | wc -l) -gt 1 ]; then |
| 1012 | fail "lines following pattern '$2' must be unique in Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1013 | return |
| 1014 | fi |
| 1015 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 1016 | "-F") |
| 1017 | if ! $2 "$SRV_OUT"; then |
| 1018 | fail "function call to '$2' failed on Server output" |
| 1019 | return |
| 1020 | fi |
| 1021 | ;; |
| 1022 | "-f") |
| 1023 | if ! $2 "$CLI_OUT"; then |
| 1024 | fail "function call to '$2' failed on Client output" |
| 1025 | return |
| 1026 | fi |
| 1027 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1028 | "-g") |
| 1029 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 1030 | fail "function call to '$2' failed on Server and Client output" |
| 1031 | return |
| 1032 | fi |
| 1033 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1034 | |
| 1035 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1036 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1037 | exit 1 |
| 1038 | esac |
| 1039 | shift 2 |
| 1040 | done |
| 1041 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1042 | # check valgrind's results |
| 1043 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1044 | if is_polar "$SRV_CMD" && has_mem_err $SRV_OUT; then |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1045 | fail "Server has memory errors" |
| 1046 | return |
| 1047 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1048 | if is_polar "$CLI_CMD" && has_mem_err $CLI_OUT; then |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1049 | fail "Client has memory errors" |
| 1050 | return |
| 1051 | fi |
| 1052 | fi |
| 1053 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1054 | # if we're here, everything is ok |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1055 | outcome=PASS |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1056 | } |
| 1057 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1058 | # Run the current test case: start the server and if applicable the proxy, run |
| 1059 | # the client, wait for all processes to finish or time out. |
| 1060 | # |
| 1061 | # Inputs: |
| 1062 | # * $NAME: test case name |
| 1063 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run |
| 1064 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs |
| 1065 | # |
| 1066 | # Outputs: |
| 1067 | # * $CLI_EXIT: client return code |
| 1068 | # * $SRV_RET: server return code |
| 1069 | do_run_test_once() { |
| 1070 | # run the commands |
| 1071 | if [ -n "$PXY_CMD" ]; then |
| 1072 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
| 1073 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 1074 | PXY_PID=$! |
| 1075 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
| 1076 | fi |
| 1077 | |
| 1078 | check_osrv_dtls |
| 1079 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
| 1080 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 1081 | SRV_PID=$! |
| 1082 | wait_server_start "$SRV_PORT" "$SRV_PID" |
| 1083 | |
| 1084 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
| 1085 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 1086 | wait_client_done |
| 1087 | |
| 1088 | sleep 0.05 |
| 1089 | |
| 1090 | # terminate the server (and the proxy) |
| 1091 | kill $SRV_PID |
| 1092 | wait $SRV_PID |
| 1093 | SRV_RET=$? |
| 1094 | |
| 1095 | if [ -n "$PXY_CMD" ]; then |
| 1096 | kill $PXY_PID >/dev/null 2>&1 |
| 1097 | wait $PXY_PID |
| 1098 | fi |
| 1099 | } |
| 1100 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1101 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
| 1102 | # Options: -s pattern pattern that must be present in server output |
| 1103 | # -c pattern pattern that must be present in client output |
| 1104 | # -u pattern lines after pattern must be unique in client output |
| 1105 | # -f call shell function on client output |
| 1106 | # -S pattern pattern that must be absent in server output |
| 1107 | # -C pattern pattern that must be absent in client output |
| 1108 | # -U pattern lines after pattern must be unique in server output |
| 1109 | # -F call shell function on server output |
| 1110 | # -g call shell function on server and client output |
| 1111 | run_test() { |
| 1112 | NAME="$1" |
| 1113 | shift 1 |
| 1114 | |
| 1115 | if is_excluded "$NAME"; then |
| 1116 | SKIP_NEXT="NO" |
| 1117 | # There was no request to run the test, so don't record its outcome. |
| 1118 | return |
| 1119 | fi |
| 1120 | |
| 1121 | print_name "$NAME" |
| 1122 | |
| 1123 | # Do we only run numbered tests? |
| 1124 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 1125 | case ",$RUN_TEST_NUMBER," in |
| 1126 | *",$TESTS,"*) :;; |
| 1127 | *) SKIP_NEXT="YES";; |
| 1128 | esac |
| 1129 | fi |
| 1130 | |
| 1131 | # does this test use a proxy? |
| 1132 | if [ "X$1" = "X-p" ]; then |
| 1133 | PXY_CMD="$2" |
| 1134 | shift 2 |
| 1135 | else |
| 1136 | PXY_CMD="" |
| 1137 | fi |
| 1138 | |
| 1139 | # get commands and client output |
| 1140 | SRV_CMD="$1" |
| 1141 | CLI_CMD="$2" |
| 1142 | CLI_EXPECT="$3" |
| 1143 | shift 3 |
| 1144 | |
| 1145 | # Check if test uses files |
| 1146 | case "$SRV_CMD $CLI_CMD" in |
| 1147 | *data_files/*) |
| 1148 | requires_config_enabled MBEDTLS_FS_IO;; |
| 1149 | esac |
| 1150 | |
| 1151 | # If the client or serve requires a ciphersuite, check that it's enabled. |
| 1152 | maybe_requires_ciphersuite_enabled "$SRV_CMD" "$@" |
| 1153 | maybe_requires_ciphersuite_enabled "$CLI_CMD" "$@" |
| 1154 | |
| 1155 | # should we skip? |
| 1156 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 1157 | SKIP_NEXT="NO" |
| 1158 | record_outcome "SKIP" |
| 1159 | SKIPS=$(( $SKIPS + 1 )) |
| 1160 | return |
| 1161 | fi |
| 1162 | |
| 1163 | analyze_test_commands "$@" |
| 1164 | |
| 1165 | TIMES_LEFT=2 |
| 1166 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1167 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1168 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1169 | do_run_test_once |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1170 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1171 | check_test_failure "$@" |
| 1172 | case $outcome in |
| 1173 | PASS) break;; |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1174 | RETRY*) printf "$outcome ";; |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1175 | FAIL) return;; |
| 1176 | esac |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1177 | done |
| 1178 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1179 | # If we get this far, the test case passed. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1180 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1181 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1182 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1183 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1184 | if [ -n "$PXY_CMD" ]; then |
| 1185 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1186 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1187 | fi |
| 1188 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1189 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1190 | } |
| 1191 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1192 | run_test_psa() { |
| 1193 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1194 | run_test "PSA-supported ciphersuite: $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1195 | "$P_SRV debug_level=3 force_version=tls12" \ |
| 1196 | "$P_CLI debug_level=3 force_version=tls12 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1197 | 0 \ |
| 1198 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 1199 | -c "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1200 | -c "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1201 | -c "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1202 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 1203 | -s "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1204 | -s "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1205 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1206 | -C "Failed to setup PSA-based cipher context"\ |
| 1207 | -S "Failed to setup PSA-based cipher context"\ |
| 1208 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1209 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1210 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1211 | -S "error" \ |
| 1212 | -C "error" |
| 1213 | } |
| 1214 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1215 | run_test_psa_force_curve() { |
| 1216 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1217 | run_test "PSA - ECDH with $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1218 | "$P_SRV debug_level=4 force_version=tls12 curves=$1" \ |
| 1219 | "$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] | 1220 | 0 \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1221 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 1222 | -c "Successfully setup PSA-based encryption cipher context" \ |
| 1223 | -c "PSA calc verify" \ |
| 1224 | -c "calc PSA finished" \ |
| 1225 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 1226 | -s "Successfully setup PSA-based encryption cipher context" \ |
| 1227 | -s "PSA calc verify" \ |
| 1228 | -s "calc PSA finished" \ |
| 1229 | -C "Failed to setup PSA-based cipher context"\ |
| 1230 | -S "Failed to setup PSA-based cipher context"\ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1231 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1232 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1233 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1234 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1235 | -C "error" |
| 1236 | } |
| 1237 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1238 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1239 | # a maximum fragment length. |
| 1240 | # first argument ($1) is MFL for SSL client |
| 1241 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1242 | run_test_memory_after_hanshake_with_mfl() |
| 1243 | { |
| 1244 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1245 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1246 | |
| 1247 | # Leave some margin for robustness |
| 1248 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1249 | |
| 1250 | run_test "Handshake memory usage (MFL $1)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1251 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
| 1252 | "$P_CLI debug_level=3 force_version=tls12 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1253 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1254 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1255 | 0 \ |
| 1256 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1257 | } |
| 1258 | |
| 1259 | |
| 1260 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1261 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1262 | run_tests_memory_after_hanshake() |
| 1263 | { |
| 1264 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1265 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1266 | |
| 1267 | # first test with default MFU is to get reference memory usage |
| 1268 | MEMORY_USAGE_MFL_16K=0 |
| 1269 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1270 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
| 1271 | "$P_CLI debug_level=3 force_version=tls12 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1272 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1273 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1274 | 0 \ |
| 1275 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1276 | |
| 1277 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1278 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1279 | |
| 1280 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1281 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1282 | |
| 1283 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1284 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1285 | |
| 1286 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1287 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1288 | } |
| 1289 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1290 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1291 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1292 | rm -f context_srv.txt |
| 1293 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1294 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1295 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1296 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1297 | 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] | 1298 | exit 1 |
| 1299 | } |
| 1300 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1301 | # |
| 1302 | # MAIN |
| 1303 | # |
| 1304 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1305 | get_options "$@" |
| 1306 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1307 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1308 | # patterns rather than regular expressions, use a case statement instead |
| 1309 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1310 | # detects simple cases: plain substring, everything, nothing. |
| 1311 | # |
| 1312 | # As an exception, the character '.' is treated as an ordinary character |
| 1313 | # if it is the only special character in the string. This is because it's |
| 1314 | # rare to need "any one character", but needing a literal '.' is common |
| 1315 | # (e.g. '-f "DTLS 1.2"'). |
| 1316 | need_grep= |
| 1317 | case "$FILTER" in |
| 1318 | '^$') simple_filter=;; |
| 1319 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1320 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1321 | need_grep=1;; |
| 1322 | *) # No regexp or shell-pattern special character |
| 1323 | simple_filter="*$FILTER*";; |
| 1324 | esac |
| 1325 | case "$EXCLUDE" in |
| 1326 | '^$') simple_exclude=;; |
| 1327 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1328 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1329 | need_grep=1;; |
| 1330 | *) # No regexp or shell-pattern special character |
| 1331 | simple_exclude="*$EXCLUDE*";; |
| 1332 | esac |
| 1333 | if [ -n "$need_grep" ]; then |
| 1334 | is_excluded () { |
| 1335 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1336 | } |
| 1337 | else |
| 1338 | is_excluded () { |
| 1339 | case "$1" in |
| 1340 | $simple_exclude) true;; |
| 1341 | $simple_filter) false;; |
| 1342 | *) true;; |
| 1343 | esac |
| 1344 | } |
| 1345 | fi |
| 1346 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1347 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1348 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1349 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1350 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1351 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1352 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1353 | exit 1 |
| 1354 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1355 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1356 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1357 | exit 1 |
| 1358 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1359 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1360 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1361 | exit 1 |
| 1362 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1363 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1364 | if which valgrind >/dev/null 2>&1; then :; else |
| 1365 | echo "Memcheck not possible. Valgrind not found" |
| 1366 | exit 1 |
| 1367 | fi |
| 1368 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1369 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 1370 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1371 | exit 1 |
| 1372 | fi |
| 1373 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1374 | # used by watchdog |
| 1375 | MAIN_PID="$$" |
| 1376 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1377 | # We use somewhat arbitrary delays for tests: |
| 1378 | # - how long do we wait for the server to start (when lsof not available)? |
| 1379 | # - how long do we allow for the client to finish? |
| 1380 | # (not to check performance, just to avoid waiting indefinitely) |
| 1381 | # Things are slower with valgrind, so give extra time here. |
| 1382 | # |
| 1383 | # Note: without lsof, there is a trade-off between the running time of this |
| 1384 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1385 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1386 | # 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] | 1387 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1388 | START_DELAY=6 |
| 1389 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1390 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1391 | START_DELAY=2 |
| 1392 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1393 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1394 | |
| 1395 | # some particular tests need more time: |
| 1396 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1397 | # - for the server, we sleep for a number of seconds after the client exits |
| 1398 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1399 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1400 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1401 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1402 | # 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] | 1403 | # +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] | 1404 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 1405 | # 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] | 1406 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1407 | 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] | 1408 | 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] | 1409 | O_SRV="$O_SRV -accept $SRV_PORT" |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1410 | 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] | 1411 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1412 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1413 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1414 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1415 | 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] | 1416 | 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] | 1417 | fi |
| 1418 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 1419 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 1420 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1421 | O_NEXT_SRV_NO_CERT="$O_NEXT_SRV_NO_CERT -accept $SRV_PORT" |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1422 | 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] | 1423 | fi |
| 1424 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1425 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1426 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1427 | G_NEXT_SRV_NO_CERT="$G_NEXT_SRV_NO_CERT -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1428 | fi |
| 1429 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1430 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1431 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1432 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1433 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1434 | # Allow SHA-1, because many of our test certificates use it |
| 1435 | P_SRV="$P_SRV allow_sha1=1" |
| 1436 | P_CLI="$P_CLI allow_sha1=1" |
| 1437 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1438 | # Also pick a unique name for intermediate files |
| 1439 | SRV_OUT="srv_out.$$" |
| 1440 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1441 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1442 | SESSION="session.$$" |
| 1443 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1444 | SKIP_NEXT="NO" |
| 1445 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1446 | trap cleanup INT TERM HUP |
| 1447 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1448 | # Basic test |
| 1449 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1450 | # Checks that: |
| 1451 | # - 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] | 1452 | # - the expected parameters are selected |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1453 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1454 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1455 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1456 | "$P_CLI" \ |
| 1457 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1458 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1459 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1460 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 1461 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1462 | -S "error" \ |
| 1463 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1464 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1465 | run_test "Default, DTLS" \ |
| 1466 | "$P_SRV dtls=1" \ |
| 1467 | "$P_CLI dtls=1" \ |
| 1468 | 0 \ |
| 1469 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1470 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1471 | |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1472 | run_test "TLS client auth: required" \ |
| 1473 | "$P_SRV auth_mode=required" \ |
| 1474 | "$P_CLI" \ |
| 1475 | 0 \ |
| 1476 | -s "Verifying peer X.509 certificate... ok" |
| 1477 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1478 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1479 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1480 | requires_config_enabled MBEDTLS_SHA256_C |
| 1481 | run_test "TLS: password protected client key" \ |
| 1482 | "$P_SRV auth_mode=required" \ |
| 1483 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1484 | 0 |
| 1485 | |
| 1486 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1487 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1488 | requires_config_enabled MBEDTLS_SHA256_C |
| 1489 | run_test "TLS: password protected server key" \ |
| 1490 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1491 | "$P_CLI" \ |
| 1492 | 0 |
| 1493 | |
| 1494 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1495 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1496 | requires_config_enabled MBEDTLS_RSA_C |
| 1497 | requires_config_enabled MBEDTLS_SHA256_C |
| 1498 | run_test "TLS: password protected server key, two certificates" \ |
| 1499 | "$P_SRV \ |
| 1500 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1501 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1502 | "$P_CLI" \ |
| 1503 | 0 |
| 1504 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1505 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1506 | run_test "CA callback on client" \ |
| 1507 | "$P_SRV debug_level=3" \ |
| 1508 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1509 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1510 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1511 | -S "error" \ |
| 1512 | -C "error" |
| 1513 | |
| 1514 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1515 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1516 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1517 | requires_config_enabled MBEDTLS_SHA256_C |
| 1518 | run_test "CA callback on server" \ |
| 1519 | "$P_SRV auth_mode=required" \ |
| 1520 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1521 | key_file=data_files/server5.key" \ |
| 1522 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1523 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1524 | -s "Verifying peer X.509 certificate... ok" \ |
| 1525 | -S "error" \ |
| 1526 | -C "error" |
| 1527 | |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1528 | # Test using an opaque private key for client authentication |
| 1529 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1530 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1531 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1532 | requires_config_enabled MBEDTLS_SHA256_C |
| 1533 | run_test "Opaque key for client authentication" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1534 | "$P_SRV auth_mode=required crt_file=data_files/server5.crt \ |
| 1535 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1536 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1537 | key_file=data_files/server5.key" \ |
| 1538 | 0 \ |
| 1539 | -c "key type: Opaque" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1540 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1541 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1542 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1543 | -S "error" \ |
| 1544 | -C "error" |
| 1545 | |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1546 | # Test using an opaque private key for server authentication |
| 1547 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1548 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1549 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1550 | requires_config_enabled MBEDTLS_SHA256_C |
| 1551 | run_test "Opaque key for server authentication" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1552 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
| 1553 | key_file=data_files/server5.key" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1554 | "$P_CLI crt_file=data_files/server5.crt \ |
| 1555 | key_file=data_files/server5.key" \ |
| 1556 | 0 \ |
| 1557 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1558 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 1559 | -s "key types: Opaque - invalid PK" \ |
| 1560 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1561 | -S "error" \ |
| 1562 | -C "error" |
| 1563 | |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1564 | # Test using an opaque private key for client/server authentication |
| 1565 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1566 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1567 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1568 | requires_config_enabled MBEDTLS_SHA256_C |
| 1569 | run_test "Opaque key for client/server authentication" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1570 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
| 1571 | key_file=data_files/server5.key" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1572 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1573 | key_file=data_files/server5.key" \ |
| 1574 | 0 \ |
| 1575 | -c "key type: Opaque" \ |
| 1576 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1577 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 1578 | -s "key types: Opaque - invalid PK" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1579 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1580 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1581 | -S "error" \ |
| 1582 | -C "error" |
| 1583 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1584 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 1585 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 1586 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 1587 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 1588 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 1589 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 1590 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 1591 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 1592 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 1593 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 1594 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 1595 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1596 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1597 | run_test_psa_force_curve "secp521r1" |
| 1598 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 1599 | run_test_psa_force_curve "brainpoolP512r1" |
| 1600 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 1601 | run_test_psa_force_curve "secp384r1" |
| 1602 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1603 | run_test_psa_force_curve "brainpoolP384r1" |
| 1604 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1605 | run_test_psa_force_curve "secp256r1" |
| 1606 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1607 | run_test_psa_force_curve "secp256k1" |
| 1608 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1609 | run_test_psa_force_curve "brainpoolP256r1" |
| 1610 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1611 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1612 | ## SECP224K1 is buggy via the PSA API |
| 1613 | ## (https://github.com/ARMmbed/mbedtls/issues/3541), |
| 1614 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 1615 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 1616 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 1617 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1618 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1619 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1620 | run_test_psa_force_curve "secp192r1" |
| 1621 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1622 | run_test_psa_force_curve "secp192k1" |
| 1623 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1624 | # Test current time in ServerHello |
| 1625 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 1626 | run_test "ServerHello contains gmt_unix_time" \ |
| 1627 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1628 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1629 | 0 \ |
| 1630 | -f "check_server_hello_time" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1631 | -F "check_server_hello_time" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1632 | |
| 1633 | # Test for uniqueness of IVs in AEAD ciphersuites |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1634 | run_test "Unique IV in GCM" \ |
| 1635 | "$P_SRV exchanges=20 debug_level=4" \ |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1636 | "$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] | 1637 | 0 \ |
| 1638 | -u "IV used" \ |
| 1639 | -U "IV used" |
| 1640 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1641 | # Tests for certificate verification callback |
| 1642 | run_test "Configuration-specific CRT verification callback" \ |
| 1643 | "$P_SRV debug_level=3" \ |
| 1644 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1645 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1646 | -S "error" \ |
| 1647 | -c "Verify requested for " \ |
| 1648 | -c "Use configuration-specific verification callback" \ |
| 1649 | -C "Use context-specific verification callback" \ |
| 1650 | -C "error" |
| 1651 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1652 | run_test "Context-specific CRT verification callback" \ |
| 1653 | "$P_SRV debug_level=3" \ |
| 1654 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 1655 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1656 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1657 | -c "Verify requested for " \ |
| 1658 | -c "Use context-specific verification callback" \ |
| 1659 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1660 | -C "error" |
| 1661 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1662 | # Tests for SHA-1 support |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1663 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1664 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1665 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1666 | 1 \ |
| 1667 | -c "The certificate is signed with an unacceptable hash" |
| 1668 | |
| 1669 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1670 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1671 | "$P_CLI allow_sha1=1" \ |
| 1672 | 0 |
| 1673 | |
| 1674 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1675 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1676 | "$P_CLI allow_sha1=0" \ |
| 1677 | 0 |
| 1678 | |
| 1679 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1680 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1681 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1682 | 1 \ |
| 1683 | -s "The certificate is signed with an unacceptable hash" |
| 1684 | |
| 1685 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1686 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1687 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1688 | 0 |
| 1689 | |
| 1690 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1691 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1692 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1693 | 0 |
| 1694 | |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1695 | # Dummy TLS 1.3 test |
| 1696 | # Currently only checking that passing TLS 1.3 key exchange modes to |
| 1697 | # ssl_client2/ssl_server2 example programs works. |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1698 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1699 | run_test "TLS 1.3, key exchange mode parameter passing: PSK only" \ |
Jerry Yu | 31c01d3 | 2021-08-24 10:49:06 +0800 | [diff] [blame] | 1700 | "$P_SRV tls13_kex_modes=psk" \ |
| 1701 | "$P_CLI tls13_kex_modes=psk" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1702 | 0 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1703 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1704 | run_test "TLS 1.3, key exchange mode parameter passing: PSK-ephemeral only" \ |
| 1705 | "$P_SRV tls13_kex_modes=psk_ephemeral" \ |
| 1706 | "$P_CLI tls13_kex_modes=psk_ephemeral" \ |
| 1707 | 0 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1708 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1709 | 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] | 1710 | "$P_SRV tls13_kex_modes=ephemeral" \ |
| 1711 | "$P_CLI tls13_kex_modes=ephemeral" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1712 | 0 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1713 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1714 | run_test "TLS 1.3, key exchange mode parameter passing: All ephemeral" \ |
| 1715 | "$P_SRV tls13_kex_modes=ephemeral_all" \ |
| 1716 | "$P_CLI tls13_kex_modes=ephemeral_all" \ |
| 1717 | 0 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1718 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1719 | run_test "TLS 1.3, key exchange mode parameter passing: All PSK" \ |
| 1720 | "$P_SRV tls13_kex_modes=psk_all" \ |
| 1721 | "$P_CLI tls13_kex_modes=psk_all" \ |
| 1722 | 0 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1723 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1724 | run_test "TLS 1.3, key exchange mode parameter passing: All" \ |
| 1725 | "$P_SRV tls13_kex_modes=all" \ |
| 1726 | "$P_CLI tls13_kex_modes=all" \ |
| 1727 | 0 |
| 1728 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1729 | # Tests for datagram packing |
| 1730 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1731 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1732 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1733 | 0 \ |
| 1734 | -c "next record in same datagram" \ |
| 1735 | -s "next record in same datagram" |
| 1736 | |
| 1737 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1738 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1739 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1740 | 0 \ |
| 1741 | -s "next record in same datagram" \ |
| 1742 | -C "next record in same datagram" |
| 1743 | |
| 1744 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1745 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1746 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1747 | 0 \ |
| 1748 | -S "next record in same datagram" \ |
| 1749 | -c "next record in same datagram" |
| 1750 | |
| 1751 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1752 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1753 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1754 | 0 \ |
| 1755 | -S "next record in same datagram" \ |
| 1756 | -C "next record in same datagram" |
| 1757 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1758 | # Tests for Context serialization |
| 1759 | |
| 1760 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1761 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1762 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1763 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1764 | 0 \ |
| 1765 | -c "Deserializing connection..." \ |
| 1766 | -S "Deserializing connection..." |
| 1767 | |
| 1768 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1769 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 1770 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1771 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1772 | 0 \ |
| 1773 | -c "Deserializing connection..." \ |
| 1774 | -S "Deserializing connection..." |
| 1775 | |
| 1776 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1777 | run_test "Context serialization, client serializes, GCM" \ |
| 1778 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1779 | "$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] | 1780 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1781 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1782 | -S "Deserializing connection..." |
| 1783 | |
| 1784 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1785 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1786 | run_test "Context serialization, client serializes, with CID" \ |
| 1787 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1788 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1789 | 0 \ |
| 1790 | -c "Deserializing connection..." \ |
| 1791 | -S "Deserializing connection..." |
| 1792 | |
| 1793 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1794 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1795 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1796 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1797 | 0 \ |
| 1798 | -C "Deserializing connection..." \ |
| 1799 | -s "Deserializing connection..." |
| 1800 | |
| 1801 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1802 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 1803 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1804 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1805 | 0 \ |
| 1806 | -C "Deserializing connection..." \ |
| 1807 | -s "Deserializing connection..." |
| 1808 | |
| 1809 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1810 | run_test "Context serialization, server serializes, GCM" \ |
| 1811 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1812 | "$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] | 1813 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1814 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1815 | -s "Deserializing connection..." |
| 1816 | |
| 1817 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1818 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1819 | run_test "Context serialization, server serializes, with CID" \ |
| 1820 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1821 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1822 | 0 \ |
| 1823 | -C "Deserializing connection..." \ |
| 1824 | -s "Deserializing connection..." |
| 1825 | |
| 1826 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1827 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1828 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1829 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1830 | 0 \ |
| 1831 | -c "Deserializing connection..." \ |
| 1832 | -s "Deserializing connection..." |
| 1833 | |
| 1834 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1835 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 1836 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1837 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1838 | 0 \ |
| 1839 | -c "Deserializing connection..." \ |
| 1840 | -s "Deserializing connection..." |
| 1841 | |
| 1842 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1843 | run_test "Context serialization, both serialize, GCM" \ |
| 1844 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1845 | "$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] | 1846 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1847 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1848 | -s "Deserializing connection..." |
| 1849 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1850 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1851 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1852 | run_test "Context serialization, both serialize, with CID" \ |
| 1853 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1854 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1855 | 0 \ |
| 1856 | -c "Deserializing connection..." \ |
| 1857 | -s "Deserializing connection..." |
| 1858 | |
| 1859 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1860 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1861 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1862 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1863 | 0 \ |
| 1864 | -c "Deserializing connection..." \ |
| 1865 | -S "Deserializing connection..." |
| 1866 | |
| 1867 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1868 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 1869 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1870 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1871 | 0 \ |
| 1872 | -c "Deserializing connection..." \ |
| 1873 | -S "Deserializing connection..." |
| 1874 | |
| 1875 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1876 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 1877 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1878 | "$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] | 1879 | 0 \ |
| 1880 | -c "Deserializing connection..." \ |
| 1881 | -S "Deserializing connection..." |
| 1882 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1883 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1884 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1885 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 1886 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1887 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1888 | 0 \ |
| 1889 | -c "Deserializing connection..." \ |
| 1890 | -S "Deserializing connection..." |
| 1891 | |
| 1892 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1893 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1894 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1895 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1896 | 0 \ |
| 1897 | -C "Deserializing connection..." \ |
| 1898 | -s "Deserializing connection..." |
| 1899 | |
| 1900 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1901 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 1902 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1903 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1904 | 0 \ |
| 1905 | -C "Deserializing connection..." \ |
| 1906 | -s "Deserializing connection..." |
| 1907 | |
| 1908 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1909 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 1910 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1911 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1912 | 0 \ |
| 1913 | -C "Deserializing connection..." \ |
| 1914 | -s "Deserializing connection..." |
| 1915 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1916 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1917 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1918 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 1919 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1920 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1921 | 0 \ |
| 1922 | -C "Deserializing connection..." \ |
| 1923 | -s "Deserializing connection..." |
| 1924 | |
| 1925 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1926 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1927 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1928 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1929 | 0 \ |
| 1930 | -c "Deserializing connection..." \ |
| 1931 | -s "Deserializing connection..." |
| 1932 | |
| 1933 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1934 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 1935 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1936 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1937 | 0 \ |
| 1938 | -c "Deserializing connection..." \ |
| 1939 | -s "Deserializing connection..." |
| 1940 | |
| 1941 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1942 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 1943 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1944 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1945 | 0 \ |
| 1946 | -c "Deserializing connection..." \ |
| 1947 | -s "Deserializing connection..." |
| 1948 | |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1949 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1950 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1951 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 1952 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1953 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1954 | 0 \ |
| 1955 | -c "Deserializing connection..." \ |
| 1956 | -s "Deserializing connection..." |
| 1957 | |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1958 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1959 | run_test "Saving the serialized context to a file" \ |
| 1960 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 1961 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 1962 | 0 \ |
| 1963 | -s "Save serialized context to a file... ok" \ |
| 1964 | -c "Save serialized context to a file... ok" |
| 1965 | rm -f context_srv.txt |
| 1966 | rm -f context_cli.txt |
| 1967 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1968 | # Tests for DTLS Connection ID extension |
| 1969 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1970 | # So far, the CID API isn't implemented, so we can't |
| 1971 | # grep for output witnessing its use. This needs to be |
| 1972 | # changed once the CID extension is implemented. |
| 1973 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1974 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1975 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1976 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 1977 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1978 | 0 \ |
| 1979 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1980 | -s "found CID extension" \ |
| 1981 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1982 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1983 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1984 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1985 | -C "found CID extension" \ |
| 1986 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1987 | -C "Copy CIDs into SSL transform" \ |
| 1988 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1989 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1990 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1991 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1992 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1993 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 1994 | 0 \ |
| 1995 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1996 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1997 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1998 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1999 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2000 | -C "found CID extension" \ |
| 2001 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2002 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 2003 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2004 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2005 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2006 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2007 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2008 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 2009 | 0 \ |
| 2010 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2011 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2012 | -c "client hello, adding CID extension" \ |
| 2013 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2014 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2015 | -s "server hello, adding CID extension" \ |
| 2016 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2017 | -c "Use of CID extension negotiated" \ |
| 2018 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2019 | -c "Copy CIDs into SSL transform" \ |
| 2020 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2021 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2022 | -s "Use of Connection ID has been negotiated" \ |
| 2023 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2024 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2025 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2026 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2027 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2028 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 2029 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 2030 | 0 \ |
| 2031 | -c "Enable use of CID extension." \ |
| 2032 | -s "Enable use of CID extension." \ |
| 2033 | -c "client hello, adding CID extension" \ |
| 2034 | -s "found CID extension" \ |
| 2035 | -s "Use of CID extension negotiated" \ |
| 2036 | -s "server hello, adding CID extension" \ |
| 2037 | -c "found CID extension" \ |
| 2038 | -c "Use of CID extension negotiated" \ |
| 2039 | -s "Copy CIDs into SSL transform" \ |
| 2040 | -c "Copy CIDs into SSL transform" \ |
| 2041 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2042 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2043 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2044 | -c "Use of Connection ID has been negotiated" \ |
| 2045 | -c "ignoring unexpected CID" \ |
| 2046 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2047 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2048 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2049 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 2050 | -p "$P_PXY mtu=800" \ |
| 2051 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2052 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2053 | 0 \ |
| 2054 | -c "Enable use of CID extension." \ |
| 2055 | -s "Enable use of CID extension." \ |
| 2056 | -c "client hello, adding CID extension" \ |
| 2057 | -s "found CID extension" \ |
| 2058 | -s "Use of CID extension negotiated" \ |
| 2059 | -s "server hello, adding CID extension" \ |
| 2060 | -c "found CID extension" \ |
| 2061 | -c "Use of CID extension negotiated" \ |
| 2062 | -s "Copy CIDs into SSL transform" \ |
| 2063 | -c "Copy CIDs into SSL transform" \ |
| 2064 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2065 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2066 | -s "Use of Connection ID has been negotiated" \ |
| 2067 | -c "Use of Connection ID has been negotiated" |
| 2068 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2069 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2070 | 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] | 2071 | -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] | 2072 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2073 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2074 | 0 \ |
| 2075 | -c "Enable use of CID extension." \ |
| 2076 | -s "Enable use of CID extension." \ |
| 2077 | -c "client hello, adding CID extension" \ |
| 2078 | -s "found CID extension" \ |
| 2079 | -s "Use of CID extension negotiated" \ |
| 2080 | -s "server hello, adding CID extension" \ |
| 2081 | -c "found CID extension" \ |
| 2082 | -c "Use of CID extension negotiated" \ |
| 2083 | -s "Copy CIDs into SSL transform" \ |
| 2084 | -c "Copy CIDs into SSL transform" \ |
| 2085 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2086 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2087 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2088 | -c "Use of Connection ID has been negotiated" \ |
| 2089 | -c "ignoring unexpected CID" \ |
| 2090 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2091 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2092 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2093 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2094 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2095 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2096 | 0 \ |
| 2097 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2098 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2099 | -c "client hello, adding CID extension" \ |
| 2100 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2101 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2102 | -s "server hello, adding CID extension" \ |
| 2103 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2104 | -c "Use of CID extension negotiated" \ |
| 2105 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2106 | -c "Copy CIDs into SSL transform" \ |
| 2107 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2108 | -s "Peer CID (length 0 Bytes):" \ |
| 2109 | -s "Use of Connection ID has been negotiated" \ |
| 2110 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2111 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2112 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2113 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2114 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2115 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2116 | 0 \ |
| 2117 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2118 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2119 | -c "client hello, adding CID extension" \ |
| 2120 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2121 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2122 | -s "server hello, adding CID extension" \ |
| 2123 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2124 | -c "Use of CID extension negotiated" \ |
| 2125 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2126 | -c "Copy CIDs into SSL transform" \ |
| 2127 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2128 | -c "Peer CID (length 0 Bytes):" \ |
| 2129 | -s "Use of Connection ID has been negotiated" \ |
| 2130 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2131 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2132 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2133 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2134 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2135 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2136 | 0 \ |
| 2137 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2138 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2139 | -c "client hello, adding CID extension" \ |
| 2140 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2141 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2142 | -s "server hello, adding CID extension" \ |
| 2143 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2144 | -c "Use of CID extension negotiated" \ |
| 2145 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2146 | -c "Copy CIDs into SSL transform" \ |
| 2147 | -S "Use of Connection ID has been negotiated" \ |
| 2148 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2149 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2150 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2151 | 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] | 2152 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2153 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2154 | 0 \ |
| 2155 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2156 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2157 | -c "client hello, adding CID extension" \ |
| 2158 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2159 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2160 | -s "server hello, adding CID extension" \ |
| 2161 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2162 | -c "Use of CID extension negotiated" \ |
| 2163 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2164 | -c "Copy CIDs into SSL transform" \ |
| 2165 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2166 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2167 | -s "Use of Connection ID has been negotiated" \ |
| 2168 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2169 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2170 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2171 | 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] | 2172 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2173 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2174 | 0 \ |
| 2175 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2176 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2177 | -c "client hello, adding CID extension" \ |
| 2178 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2179 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2180 | -s "server hello, adding CID extension" \ |
| 2181 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2182 | -c "Use of CID extension negotiated" \ |
| 2183 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2184 | -c "Copy CIDs into SSL transform" \ |
| 2185 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2186 | -s "Peer CID (length 0 Bytes):" \ |
| 2187 | -s "Use of Connection ID has been negotiated" \ |
| 2188 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2189 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2190 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2191 | 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] | 2192 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2193 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2194 | 0 \ |
| 2195 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2196 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2197 | -c "client hello, adding CID extension" \ |
| 2198 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2199 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2200 | -s "server hello, adding CID extension" \ |
| 2201 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2202 | -c "Use of CID extension negotiated" \ |
| 2203 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2204 | -c "Copy CIDs into SSL transform" \ |
| 2205 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2206 | -c "Peer CID (length 0 Bytes):" \ |
| 2207 | -s "Use of Connection ID has been negotiated" \ |
| 2208 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2209 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2210 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2211 | 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] | 2212 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2213 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2214 | 0 \ |
| 2215 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2216 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2217 | -c "client hello, adding CID extension" \ |
| 2218 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2219 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2220 | -s "server hello, adding CID extension" \ |
| 2221 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2222 | -c "Use of CID extension negotiated" \ |
| 2223 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2224 | -c "Copy CIDs into SSL transform" \ |
| 2225 | -S "Use of Connection ID has been negotiated" \ |
| 2226 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2227 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2228 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2229 | 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] | 2230 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2231 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2232 | 0 \ |
| 2233 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2234 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2235 | -c "client hello, adding CID extension" \ |
| 2236 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2237 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2238 | -s "server hello, adding CID extension" \ |
| 2239 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2240 | -c "Use of CID extension negotiated" \ |
| 2241 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2242 | -c "Copy CIDs into SSL transform" \ |
| 2243 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2244 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2245 | -s "Use of Connection ID has been negotiated" \ |
| 2246 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2247 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2248 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2249 | 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] | 2250 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2251 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2252 | 0 \ |
| 2253 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2254 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2255 | -c "client hello, adding CID extension" \ |
| 2256 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2257 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2258 | -s "server hello, adding CID extension" \ |
| 2259 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2260 | -c "Use of CID extension negotiated" \ |
| 2261 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2262 | -c "Copy CIDs into SSL transform" \ |
| 2263 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2264 | -s "Peer CID (length 0 Bytes):" \ |
| 2265 | -s "Use of Connection ID has been negotiated" \ |
| 2266 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2267 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2268 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2269 | 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] | 2270 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2271 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2272 | 0 \ |
| 2273 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2274 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2275 | -c "client hello, adding CID extension" \ |
| 2276 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2277 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2278 | -s "server hello, adding CID extension" \ |
| 2279 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2280 | -c "Use of CID extension negotiated" \ |
| 2281 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2282 | -c "Copy CIDs into SSL transform" \ |
| 2283 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2284 | -c "Peer CID (length 0 Bytes):" \ |
| 2285 | -s "Use of Connection ID has been negotiated" \ |
| 2286 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2287 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2288 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2289 | 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] | 2290 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2291 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2292 | 0 \ |
| 2293 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2294 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2295 | -c "client hello, adding CID extension" \ |
| 2296 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2297 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2298 | -s "server hello, adding CID extension" \ |
| 2299 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2300 | -c "Use of CID extension negotiated" \ |
| 2301 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2302 | -c "Copy CIDs into SSL transform" \ |
| 2303 | -S "Use of Connection ID has been negotiated" \ |
| 2304 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2305 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2306 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 2307 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2308 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2309 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2310 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2311 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2312 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2313 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2314 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2315 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2316 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2317 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2318 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2319 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2320 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2321 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2322 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2323 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2324 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2325 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2326 | 0 \ |
| 2327 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2328 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2329 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2330 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2331 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2332 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2333 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2334 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2335 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2336 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2337 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2338 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 2339 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2340 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2341 | 0 \ |
| 2342 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2343 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2344 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2345 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2346 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2347 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2348 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2349 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2350 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2351 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2352 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2353 | 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] | 2354 | -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] | 2355 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2356 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2357 | 0 \ |
| 2358 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2359 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2360 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2361 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2362 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2363 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2364 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2365 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2366 | -c "ignoring unexpected CID" \ |
| 2367 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2368 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2369 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2370 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2371 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2372 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2373 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2374 | 0 \ |
| 2375 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2376 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2377 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2378 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2379 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2380 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2381 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2382 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2383 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2384 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2385 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2386 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 2387 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2388 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2389 | 0 \ |
| 2390 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2391 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2392 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2393 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2394 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2395 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2396 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2397 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2398 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2399 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2400 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2401 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2402 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2403 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2404 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2405 | 0 \ |
| 2406 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2407 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2408 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2409 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2410 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2411 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2412 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2413 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2414 | -c "ignoring unexpected CID" \ |
| 2415 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2416 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2417 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2418 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2419 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2420 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2421 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2422 | 0 \ |
| 2423 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2424 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2425 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2426 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2427 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2428 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2429 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2430 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2431 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2432 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 2433 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2434 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2435 | 0 \ |
| 2436 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2437 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2438 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2439 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2440 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2441 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2442 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2443 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2444 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2445 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2446 | -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] | 2447 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2448 | "$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" \ |
| 2449 | 0 \ |
| 2450 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2451 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2452 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2453 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2454 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2455 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2456 | -c "ignoring unexpected CID" \ |
| 2457 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2458 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2459 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2460 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2461 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2462 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2463 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2464 | 0 \ |
| 2465 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2466 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2467 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2468 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2469 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2470 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2471 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2472 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2473 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 2474 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2475 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2476 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2477 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2478 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2479 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2480 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2481 | 0 \ |
| 2482 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2483 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2484 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2485 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2486 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2487 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2488 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2489 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2490 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2491 | -c "ignoring unexpected CID" \ |
| 2492 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2493 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2494 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2495 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2496 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 2497 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2498 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2499 | 0 \ |
| 2500 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2501 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2502 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2503 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2504 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2505 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2506 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2507 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2508 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2509 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2510 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2511 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2512 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2513 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2514 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2515 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2516 | 0 \ |
| 2517 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2518 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2519 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2520 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2521 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2522 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2523 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2524 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2525 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2526 | -c "ignoring unexpected CID" \ |
| 2527 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2528 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 2529 | # 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] | 2530 | # tests check that the buffer contents are reallocated when the message is |
| 2531 | # larger than the buffer. |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2532 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2533 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2534 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2535 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 2536 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2537 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 2538 | 0 \ |
| 2539 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2540 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2541 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2542 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2543 | -s "Reallocating in_buf" \ |
| 2544 | -s "Reallocating out_buf" |
| 2545 | |
| 2546 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2547 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2548 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2549 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 2550 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2551 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 2552 | 0 \ |
| 2553 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2554 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2555 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2556 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2557 | -s "Reallocating in_buf" \ |
| 2558 | -s "Reallocating out_buf" |
| 2559 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2560 | # Tests for Encrypt-then-MAC extension |
| 2561 | |
| 2562 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2563 | "$P_SRV debug_level=3 \ |
| 2564 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2565 | "$P_CLI debug_level=3" \ |
| 2566 | 0 \ |
| 2567 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2568 | -s "found encrypt then mac extension" \ |
| 2569 | -s "server hello, adding encrypt then mac extension" \ |
| 2570 | -c "found encrypt_then_mac extension" \ |
| 2571 | -c "using encrypt then mac" \ |
| 2572 | -s "using encrypt then mac" |
| 2573 | |
| 2574 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2575 | "$P_SRV debug_level=3 etm=0 \ |
| 2576 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2577 | "$P_CLI debug_level=3 etm=1" \ |
| 2578 | 0 \ |
| 2579 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2580 | -s "found encrypt then mac extension" \ |
| 2581 | -S "server hello, adding encrypt then mac extension" \ |
| 2582 | -C "found encrypt_then_mac extension" \ |
| 2583 | -C "using encrypt then mac" \ |
| 2584 | -S "using encrypt then mac" |
| 2585 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2586 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 2587 | "$P_SRV debug_level=3 etm=1 \ |
| 2588 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 2589 | "$P_CLI debug_level=3 etm=1" \ |
| 2590 | 0 \ |
| 2591 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2592 | -s "found encrypt then mac extension" \ |
| 2593 | -S "server hello, adding encrypt then mac extension" \ |
| 2594 | -C "found encrypt_then_mac extension" \ |
| 2595 | -C "using encrypt then mac" \ |
| 2596 | -S "using encrypt then mac" |
| 2597 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2598 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2599 | "$P_SRV debug_level=3 etm=1 \ |
| 2600 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2601 | "$P_CLI debug_level=3 etm=0" \ |
| 2602 | 0 \ |
| 2603 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2604 | -S "found encrypt then mac extension" \ |
| 2605 | -S "server hello, adding encrypt then mac extension" \ |
| 2606 | -C "found encrypt_then_mac extension" \ |
| 2607 | -C "using encrypt then mac" \ |
| 2608 | -S "using encrypt then mac" |
| 2609 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2610 | # Tests for Extended Master Secret extension |
| 2611 | |
| 2612 | run_test "Extended Master Secret: default" \ |
| 2613 | "$P_SRV debug_level=3" \ |
| 2614 | "$P_CLI debug_level=3" \ |
| 2615 | 0 \ |
| 2616 | -c "client hello, adding extended_master_secret extension" \ |
| 2617 | -s "found extended master secret extension" \ |
| 2618 | -s "server hello, adding extended master secret extension" \ |
| 2619 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2620 | -c "session hash for extended master secret" \ |
| 2621 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2622 | |
| 2623 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 2624 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 2625 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 2626 | 0 \ |
| 2627 | -c "client hello, adding extended_master_secret extension" \ |
| 2628 | -s "found extended master secret extension" \ |
| 2629 | -S "server hello, adding extended master secret extension" \ |
| 2630 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2631 | -C "session hash for extended master secret" \ |
| 2632 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2633 | |
| 2634 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 2635 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 2636 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 2637 | 0 \ |
| 2638 | -C "client hello, adding extended_master_secret extension" \ |
| 2639 | -S "found extended master secret extension" \ |
| 2640 | -S "server hello, adding extended master secret extension" \ |
| 2641 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2642 | -C "session hash for extended master secret" \ |
| 2643 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2644 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2645 | # Test sending and receiving empty application data records |
| 2646 | |
| 2647 | run_test "Encrypt then MAC: empty application data record" \ |
| 2648 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 2649 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 2650 | 0 \ |
| 2651 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2652 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2653 | -c "0 bytes written in 1 fragments" |
| 2654 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2655 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2656 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 2657 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 2658 | 0 \ |
| 2659 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2660 | -c "0 bytes written in 1 fragments" |
| 2661 | |
| 2662 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 2663 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 2664 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 2665 | 0 \ |
| 2666 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2667 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2668 | -c "0 bytes written in 1 fragments" |
| 2669 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2670 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2671 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 2672 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 2673 | 0 \ |
| 2674 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2675 | -c "0 bytes written in 1 fragments" |
| 2676 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2677 | # Tests for CBC 1/n-1 record splitting |
| 2678 | |
| 2679 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 2680 | "$P_SRV" \ |
| 2681 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 2682 | request_size=123 force_version=tls12" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2683 | 0 \ |
| 2684 | -s "Read from client: 123 bytes read" \ |
| 2685 | -S "Read from client: 1 bytes read" \ |
| 2686 | -S "122 bytes read" |
| 2687 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2688 | # Tests for Session Tickets |
| 2689 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2690 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2691 | "$P_SRV debug_level=3 tickets=1" \ |
| 2692 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2693 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2694 | -c "client hello, adding session ticket extension" \ |
| 2695 | -s "found session ticket extension" \ |
| 2696 | -s "server hello, adding session ticket extension" \ |
| 2697 | -c "found session_ticket extension" \ |
| 2698 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2699 | -S "session successfully restored from cache" \ |
| 2700 | -s "session successfully restored from ticket" \ |
| 2701 | -s "a session has been resumed" \ |
| 2702 | -c "a session has been resumed" |
| 2703 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2704 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2705 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2706 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2707 | 0 \ |
| 2708 | -c "client hello, adding session ticket extension" \ |
| 2709 | -s "found session ticket extension" \ |
| 2710 | -s "server hello, adding session ticket extension" \ |
| 2711 | -c "found session_ticket extension" \ |
| 2712 | -c "parse new session ticket" \ |
| 2713 | -S "session successfully restored from cache" \ |
| 2714 | -s "session successfully restored from ticket" \ |
| 2715 | -s "a session has been resumed" \ |
| 2716 | -c "a session has been resumed" |
| 2717 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2718 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2719 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2720 | "$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] | 2721 | 0 \ |
| 2722 | -c "client hello, adding session ticket extension" \ |
| 2723 | -s "found session ticket extension" \ |
| 2724 | -s "server hello, adding session ticket extension" \ |
| 2725 | -c "found session_ticket extension" \ |
| 2726 | -c "parse new session ticket" \ |
| 2727 | -S "session successfully restored from cache" \ |
| 2728 | -S "session successfully restored from ticket" \ |
| 2729 | -S "a session has been resumed" \ |
| 2730 | -C "a session has been resumed" |
| 2731 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2732 | run_test "Session resume using tickets: session copy" \ |
| 2733 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2734 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 2735 | 0 \ |
| 2736 | -c "client hello, adding session ticket extension" \ |
| 2737 | -s "found session ticket extension" \ |
| 2738 | -s "server hello, adding session ticket extension" \ |
| 2739 | -c "found session_ticket extension" \ |
| 2740 | -c "parse new session ticket" \ |
| 2741 | -S "session successfully restored from cache" \ |
| 2742 | -s "session successfully restored from ticket" \ |
| 2743 | -s "a session has been resumed" \ |
| 2744 | -c "a session has been resumed" |
| 2745 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2746 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2747 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2748 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2749 | 0 \ |
| 2750 | -c "client hello, adding session ticket extension" \ |
| 2751 | -c "found session_ticket extension" \ |
| 2752 | -c "parse new session ticket" \ |
| 2753 | -c "a session has been resumed" |
| 2754 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2755 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2756 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2757 | "( $O_CLI -sess_out $SESSION; \ |
| 2758 | $O_CLI -sess_in $SESSION; \ |
| 2759 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2760 | 0 \ |
| 2761 | -s "found session ticket extension" \ |
| 2762 | -s "server hello, adding session ticket extension" \ |
| 2763 | -S "session successfully restored from cache" \ |
| 2764 | -s "session successfully restored from ticket" \ |
| 2765 | -s "a session has been resumed" |
| 2766 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2767 | # Tests for Session Tickets with DTLS |
| 2768 | |
| 2769 | run_test "Session resume using tickets, DTLS: basic" \ |
| 2770 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2771 | "$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] | 2772 | 0 \ |
| 2773 | -c "client hello, adding session ticket extension" \ |
| 2774 | -s "found session ticket extension" \ |
| 2775 | -s "server hello, adding session ticket extension" \ |
| 2776 | -c "found session_ticket extension" \ |
| 2777 | -c "parse new session ticket" \ |
| 2778 | -S "session successfully restored from cache" \ |
| 2779 | -s "session successfully restored from ticket" \ |
| 2780 | -s "a session has been resumed" \ |
| 2781 | -c "a session has been resumed" |
| 2782 | |
| 2783 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 2784 | "$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] | 2785 | "$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] | 2786 | 0 \ |
| 2787 | -c "client hello, adding session ticket extension" \ |
| 2788 | -s "found session ticket extension" \ |
| 2789 | -s "server hello, adding session ticket extension" \ |
| 2790 | -c "found session_ticket extension" \ |
| 2791 | -c "parse new session ticket" \ |
| 2792 | -S "session successfully restored from cache" \ |
| 2793 | -s "session successfully restored from ticket" \ |
| 2794 | -s "a session has been resumed" \ |
| 2795 | -c "a session has been resumed" |
| 2796 | |
| 2797 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 2798 | "$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] | 2799 | "$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] | 2800 | 0 \ |
| 2801 | -c "client hello, adding session ticket extension" \ |
| 2802 | -s "found session ticket extension" \ |
| 2803 | -s "server hello, adding session ticket extension" \ |
| 2804 | -c "found session_ticket extension" \ |
| 2805 | -c "parse new session ticket" \ |
| 2806 | -S "session successfully restored from cache" \ |
| 2807 | -S "session successfully restored from ticket" \ |
| 2808 | -S "a session has been resumed" \ |
| 2809 | -C "a session has been resumed" |
| 2810 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2811 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 2812 | "$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] | 2813 | "$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] | 2814 | 0 \ |
| 2815 | -c "client hello, adding session ticket extension" \ |
| 2816 | -s "found session ticket extension" \ |
| 2817 | -s "server hello, adding session ticket extension" \ |
| 2818 | -c "found session_ticket extension" \ |
| 2819 | -c "parse new session ticket" \ |
| 2820 | -S "session successfully restored from cache" \ |
| 2821 | -s "session successfully restored from ticket" \ |
| 2822 | -s "a session has been resumed" \ |
| 2823 | -c "a session has been resumed" |
| 2824 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2825 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 2826 | "$O_SRV -dtls" \ |
| 2827 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 2828 | 0 \ |
| 2829 | -c "client hello, adding session ticket extension" \ |
| 2830 | -c "found session_ticket extension" \ |
| 2831 | -c "parse new session ticket" \ |
| 2832 | -c "a session has been resumed" |
| 2833 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 2834 | # 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] | 2835 | # 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] | 2836 | requires_openssl_next |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2837 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 2838 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 2839 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 2840 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2841 | rm -f $SESSION )" \ |
| 2842 | 0 \ |
| 2843 | -s "found session ticket extension" \ |
| 2844 | -s "server hello, adding session ticket extension" \ |
| 2845 | -S "session successfully restored from cache" \ |
| 2846 | -s "session successfully restored from ticket" \ |
| 2847 | -s "a session has been resumed" |
| 2848 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2849 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2850 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2851 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2852 | "$P_SRV debug_level=3 tickets=0" \ |
| 2853 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2854 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2855 | -c "client hello, adding session ticket extension" \ |
| 2856 | -s "found session ticket extension" \ |
| 2857 | -S "server hello, adding session ticket extension" \ |
| 2858 | -C "found session_ticket extension" \ |
| 2859 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2860 | -s "session successfully restored from cache" \ |
| 2861 | -S "session successfully restored from ticket" \ |
| 2862 | -s "a session has been resumed" \ |
| 2863 | -c "a session has been resumed" |
| 2864 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2865 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2866 | "$P_SRV debug_level=3 tickets=1" \ |
| 2867 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2868 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2869 | -C "client hello, adding session ticket extension" \ |
| 2870 | -S "found session ticket extension" \ |
| 2871 | -S "server hello, adding session ticket extension" \ |
| 2872 | -C "found session_ticket extension" \ |
| 2873 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2874 | -s "session successfully restored from cache" \ |
| 2875 | -S "session successfully restored from ticket" \ |
| 2876 | -s "a session has been resumed" \ |
| 2877 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2878 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2879 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2880 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 2881 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2882 | 0 \ |
| 2883 | -S "session successfully restored from cache" \ |
| 2884 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2885 | -S "a session has been resumed" \ |
| 2886 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2887 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2888 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2889 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 2890 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2891 | 0 \ |
| 2892 | -s "session successfully restored from cache" \ |
| 2893 | -S "session successfully restored from ticket" \ |
| 2894 | -s "a session has been resumed" \ |
| 2895 | -c "a session has been resumed" |
| 2896 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 2897 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2898 | "$P_SRV debug_level=3 tickets=0" \ |
| 2899 | "$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] | 2900 | 0 \ |
| 2901 | -s "session successfully restored from cache" \ |
| 2902 | -S "session successfully restored from ticket" \ |
| 2903 | -s "a session has been resumed" \ |
| 2904 | -c "a session has been resumed" |
| 2905 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2906 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2907 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 2908 | "$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] | 2909 | 0 \ |
| 2910 | -S "session successfully restored from cache" \ |
| 2911 | -S "session successfully restored from ticket" \ |
| 2912 | -S "a session has been resumed" \ |
| 2913 | -C "a session has been resumed" |
| 2914 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2915 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2916 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 2917 | "$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] | 2918 | 0 \ |
| 2919 | -s "session successfully restored from cache" \ |
| 2920 | -S "session successfully restored from ticket" \ |
| 2921 | -s "a session has been resumed" \ |
| 2922 | -c "a session has been resumed" |
| 2923 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2924 | run_test "Session resume using cache: session copy" \ |
| 2925 | "$P_SRV debug_level=3 tickets=0" \ |
| 2926 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 2927 | 0 \ |
| 2928 | -s "session successfully restored from cache" \ |
| 2929 | -S "session successfully restored from ticket" \ |
| 2930 | -s "a session has been resumed" \ |
| 2931 | -c "a session has been resumed" |
| 2932 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2933 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2934 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2935 | "( $O_CLI -sess_out $SESSION; \ |
| 2936 | $O_CLI -sess_in $SESSION; \ |
| 2937 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2938 | 0 \ |
| 2939 | -s "found session ticket extension" \ |
| 2940 | -S "server hello, adding session ticket extension" \ |
| 2941 | -s "session successfully restored from cache" \ |
| 2942 | -S "session successfully restored from ticket" \ |
| 2943 | -s "a session has been resumed" |
| 2944 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2945 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2946 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2947 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2948 | 0 \ |
| 2949 | -C "found session_ticket extension" \ |
| 2950 | -C "parse new session ticket" \ |
| 2951 | -c "a session has been resumed" |
| 2952 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2953 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 2954 | |
| 2955 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 2956 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2957 | "$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] | 2958 | 0 \ |
| 2959 | -c "client hello, adding session ticket extension" \ |
| 2960 | -s "found session ticket extension" \ |
| 2961 | -S "server hello, adding session ticket extension" \ |
| 2962 | -C "found session_ticket extension" \ |
| 2963 | -C "parse new session ticket" \ |
| 2964 | -s "session successfully restored from cache" \ |
| 2965 | -S "session successfully restored from ticket" \ |
| 2966 | -s "a session has been resumed" \ |
| 2967 | -c "a session has been resumed" |
| 2968 | |
| 2969 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 2970 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2971 | "$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] | 2972 | 0 \ |
| 2973 | -C "client hello, adding session ticket extension" \ |
| 2974 | -S "found session ticket extension" \ |
| 2975 | -S "server hello, adding session ticket extension" \ |
| 2976 | -C "found session_ticket extension" \ |
| 2977 | -C "parse new session ticket" \ |
| 2978 | -s "session successfully restored from cache" \ |
| 2979 | -S "session successfully restored from ticket" \ |
| 2980 | -s "a session has been resumed" \ |
| 2981 | -c "a session has been resumed" |
| 2982 | |
| 2983 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 2984 | "$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] | 2985 | "$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] | 2986 | 0 \ |
| 2987 | -S "session successfully restored from cache" \ |
| 2988 | -S "session successfully restored from ticket" \ |
| 2989 | -S "a session has been resumed" \ |
| 2990 | -C "a session has been resumed" |
| 2991 | |
| 2992 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 2993 | "$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] | 2994 | "$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] | 2995 | 0 \ |
| 2996 | -s "session successfully restored from cache" \ |
| 2997 | -S "session successfully restored from ticket" \ |
| 2998 | -s "a session has been resumed" \ |
| 2999 | -c "a session has been resumed" |
| 3000 | |
| 3001 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 3002 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3003 | "$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] | 3004 | 0 \ |
| 3005 | -s "session successfully restored from cache" \ |
| 3006 | -S "session successfully restored from ticket" \ |
| 3007 | -s "a session has been resumed" \ |
| 3008 | -c "a session has been resumed" |
| 3009 | |
| 3010 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 3011 | "$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] | 3012 | "$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] | 3013 | 0 \ |
| 3014 | -S "session successfully restored from cache" \ |
| 3015 | -S "session successfully restored from ticket" \ |
| 3016 | -S "a session has been resumed" \ |
| 3017 | -C "a session has been resumed" |
| 3018 | |
| 3019 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 3020 | "$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] | 3021 | "$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] | 3022 | 0 \ |
| 3023 | -s "session successfully restored from cache" \ |
| 3024 | -S "session successfully restored from ticket" \ |
| 3025 | -s "a session has been resumed" \ |
| 3026 | -c "a session has been resumed" |
| 3027 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3028 | run_test "Session resume using cache, DTLS: session copy" \ |
| 3029 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3030 | "$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] | 3031 | 0 \ |
| 3032 | -s "session successfully restored from cache" \ |
| 3033 | -S "session successfully restored from ticket" \ |
| 3034 | -s "a session has been resumed" \ |
| 3035 | -c "a session has been resumed" |
| 3036 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3037 | # 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] | 3038 | # 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] | 3039 | requires_openssl_next |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3040 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 3041 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3042 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 3043 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3044 | rm -f $SESSION )" \ |
| 3045 | 0 \ |
| 3046 | -s "found session ticket extension" \ |
| 3047 | -S "server hello, adding session ticket extension" \ |
| 3048 | -s "session successfully restored from cache" \ |
| 3049 | -S "session successfully restored from ticket" \ |
| 3050 | -s "a session has been resumed" |
| 3051 | |
| 3052 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 3053 | "$O_SRV -dtls" \ |
| 3054 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 3055 | 0 \ |
| 3056 | -C "found session_ticket extension" \ |
| 3057 | -C "parse new session ticket" \ |
| 3058 | -c "a session has been resumed" |
| 3059 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3060 | # Tests for Max Fragment Length extension |
| 3061 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3062 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3063 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3064 | "$P_SRV debug_level=3" \ |
| 3065 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3066 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3067 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3068 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3069 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3070 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3071 | -C "client hello, adding max_fragment_length extension" \ |
| 3072 | -S "found max fragment length extension" \ |
| 3073 | -S "server hello, max_fragment_length extension" \ |
| 3074 | -C "found max_fragment_length extension" |
| 3075 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3076 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3077 | run_test "Max fragment length: enabled, default, larger message" \ |
| 3078 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3079 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3080 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3081 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3082 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3083 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3084 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3085 | -C "client hello, adding max_fragment_length extension" \ |
| 3086 | -S "found max fragment length extension" \ |
| 3087 | -S "server hello, max_fragment_length extension" \ |
| 3088 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3089 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3090 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3091 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3092 | |
| 3093 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3094 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 3095 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3096 | "$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] | 3097 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3098 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3099 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3100 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3101 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3102 | -C "client hello, adding max_fragment_length extension" \ |
| 3103 | -S "found max fragment length extension" \ |
| 3104 | -S "server hello, max_fragment_length extension" \ |
| 3105 | -C "found max_fragment_length extension" \ |
| 3106 | -c "fragment larger than.*maximum " |
| 3107 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3108 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 3109 | # (session fragment length will be 16384 regardless of mbedtls |
| 3110 | # content length configuration.) |
| 3111 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3112 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3113 | run_test "Max fragment length: disabled, larger message" \ |
| 3114 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3115 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3116 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3117 | -C "Maximum incoming record payload length is 16384" \ |
| 3118 | -C "Maximum outgoing record payload length is 16384" \ |
| 3119 | -S "Maximum incoming record payload length is 16384" \ |
| 3120 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3121 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3122 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3123 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3124 | |
| 3125 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 3126 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3127 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3128 | "$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] | 3129 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3130 | -C "Maximum incoming record payload length is 16384" \ |
| 3131 | -C "Maximum outgoing record payload length is 16384" \ |
| 3132 | -S "Maximum incoming record payload length is 16384" \ |
| 3133 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3134 | -c "fragment larger than.*maximum " |
| 3135 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3136 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3137 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3138 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3139 | "$P_SRV debug_level=3" \ |
| 3140 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3141 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3142 | -c "Maximum incoming record payload length is 4096" \ |
| 3143 | -c "Maximum outgoing record payload length is 4096" \ |
| 3144 | -s "Maximum incoming record payload length is 4096" \ |
| 3145 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3146 | -c "client hello, adding max_fragment_length extension" \ |
| 3147 | -s "found max fragment length extension" \ |
| 3148 | -s "server hello, max_fragment_length extension" \ |
| 3149 | -c "found max_fragment_length extension" |
| 3150 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3151 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3152 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3153 | run_test "Max fragment length: client 512, server 1024" \ |
| 3154 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3155 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3156 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3157 | -c "Maximum incoming record payload length is 512" \ |
| 3158 | -c "Maximum outgoing record payload length is 512" \ |
| 3159 | -s "Maximum incoming record payload length is 512" \ |
| 3160 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3161 | -c "client hello, adding max_fragment_length extension" \ |
| 3162 | -s "found max fragment length extension" \ |
| 3163 | -s "server hello, max_fragment_length extension" \ |
| 3164 | -c "found max_fragment_length extension" |
| 3165 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3166 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3167 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3168 | run_test "Max fragment length: client 512, server 2048" \ |
| 3169 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3170 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3171 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3172 | -c "Maximum incoming record payload length is 512" \ |
| 3173 | -c "Maximum outgoing record payload length is 512" \ |
| 3174 | -s "Maximum incoming record payload length is 512" \ |
| 3175 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3176 | -c "client hello, adding max_fragment_length extension" \ |
| 3177 | -s "found max fragment length extension" \ |
| 3178 | -s "server hello, max_fragment_length extension" \ |
| 3179 | -c "found max_fragment_length extension" |
| 3180 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3181 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3182 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3183 | run_test "Max fragment length: client 512, server 4096" \ |
| 3184 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3185 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3186 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3187 | -c "Maximum incoming record payload length is 512" \ |
| 3188 | -c "Maximum outgoing record payload length is 512" \ |
| 3189 | -s "Maximum incoming record payload length is 512" \ |
| 3190 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3191 | -c "client hello, adding max_fragment_length extension" \ |
| 3192 | -s "found max fragment length extension" \ |
| 3193 | -s "server hello, max_fragment_length extension" \ |
| 3194 | -c "found max_fragment_length extension" |
| 3195 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3196 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3197 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3198 | run_test "Max fragment length: client 1024, server 512" \ |
| 3199 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3200 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3201 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3202 | -c "Maximum incoming record payload length is 1024" \ |
| 3203 | -c "Maximum outgoing record payload length is 1024" \ |
| 3204 | -s "Maximum incoming record payload length is 1024" \ |
| 3205 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3206 | -c "client hello, adding max_fragment_length extension" \ |
| 3207 | -s "found max fragment length extension" \ |
| 3208 | -s "server hello, max_fragment_length extension" \ |
| 3209 | -c "found max_fragment_length extension" |
| 3210 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3211 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3212 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3213 | run_test "Max fragment length: client 1024, server 2048" \ |
| 3214 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3215 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3216 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3217 | -c "Maximum incoming record payload length is 1024" \ |
| 3218 | -c "Maximum outgoing record payload length is 1024" \ |
| 3219 | -s "Maximum incoming record payload length is 1024" \ |
| 3220 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3221 | -c "client hello, adding max_fragment_length extension" \ |
| 3222 | -s "found max fragment length extension" \ |
| 3223 | -s "server hello, max_fragment_length extension" \ |
| 3224 | -c "found max_fragment_length extension" |
| 3225 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3226 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3227 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3228 | run_test "Max fragment length: client 1024, server 4096" \ |
| 3229 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3230 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3231 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3232 | -c "Maximum incoming record payload length is 1024" \ |
| 3233 | -c "Maximum outgoing record payload length is 1024" \ |
| 3234 | -s "Maximum incoming record payload length is 1024" \ |
| 3235 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3236 | -c "client hello, adding max_fragment_length extension" \ |
| 3237 | -s "found max fragment length extension" \ |
| 3238 | -s "server hello, max_fragment_length extension" \ |
| 3239 | -c "found max_fragment_length extension" |
| 3240 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3241 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3242 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3243 | run_test "Max fragment length: client 2048, server 512" \ |
| 3244 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3245 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3246 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3247 | -c "Maximum incoming record payload length is 2048" \ |
| 3248 | -c "Maximum outgoing record payload length is 2048" \ |
| 3249 | -s "Maximum incoming record payload length is 2048" \ |
| 3250 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3251 | -c "client hello, adding max_fragment_length extension" \ |
| 3252 | -s "found max fragment length extension" \ |
| 3253 | -s "server hello, max_fragment_length extension" \ |
| 3254 | -c "found max_fragment_length extension" |
| 3255 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3256 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3257 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3258 | run_test "Max fragment length: client 2048, server 1024" \ |
| 3259 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3260 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3261 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3262 | -c "Maximum incoming record payload length is 2048" \ |
| 3263 | -c "Maximum outgoing record payload length is 2048" \ |
| 3264 | -s "Maximum incoming record payload length is 2048" \ |
| 3265 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3266 | -c "client hello, adding max_fragment_length extension" \ |
| 3267 | -s "found max fragment length extension" \ |
| 3268 | -s "server hello, max_fragment_length extension" \ |
| 3269 | -c "found max_fragment_length extension" |
| 3270 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3271 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3272 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3273 | run_test "Max fragment length: client 2048, server 4096" \ |
| 3274 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3275 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3276 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3277 | -c "Maximum incoming record payload length is 2048" \ |
| 3278 | -c "Maximum outgoing record payload length is 2048" \ |
| 3279 | -s "Maximum incoming record payload length is 2048" \ |
| 3280 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3281 | -c "client hello, adding max_fragment_length extension" \ |
| 3282 | -s "found max fragment length extension" \ |
| 3283 | -s "server hello, max_fragment_length extension" \ |
| 3284 | -c "found max_fragment_length extension" |
| 3285 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3286 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3287 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3288 | run_test "Max fragment length: client 4096, server 512" \ |
| 3289 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3290 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3291 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3292 | -c "Maximum incoming record payload length is 4096" \ |
| 3293 | -c "Maximum outgoing record payload length is 4096" \ |
| 3294 | -s "Maximum incoming record payload length is 4096" \ |
| 3295 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3296 | -c "client hello, adding max_fragment_length extension" \ |
| 3297 | -s "found max fragment length extension" \ |
| 3298 | -s "server hello, max_fragment_length extension" \ |
| 3299 | -c "found max_fragment_length extension" |
| 3300 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3301 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3302 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3303 | run_test "Max fragment length: client 4096, server 1024" \ |
| 3304 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3305 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3306 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3307 | -c "Maximum incoming record payload length is 4096" \ |
| 3308 | -c "Maximum outgoing record payload length is 4096" \ |
| 3309 | -s "Maximum incoming record payload length is 4096" \ |
| 3310 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3311 | -c "client hello, adding max_fragment_length extension" \ |
| 3312 | -s "found max fragment length extension" \ |
| 3313 | -s "server hello, max_fragment_length extension" \ |
| 3314 | -c "found max_fragment_length extension" |
| 3315 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3316 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3317 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3318 | run_test "Max fragment length: client 4096, server 2048" \ |
| 3319 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3320 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3321 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3322 | -c "Maximum incoming record payload length is 4096" \ |
| 3323 | -c "Maximum outgoing record payload length is 4096" \ |
| 3324 | -s "Maximum incoming record payload length is 4096" \ |
| 3325 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3326 | -c "client hello, adding max_fragment_length extension" \ |
| 3327 | -s "found max fragment length extension" \ |
| 3328 | -s "server hello, max_fragment_length extension" \ |
| 3329 | -c "found max_fragment_length extension" |
| 3330 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3331 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3332 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3333 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3334 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3335 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3336 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3337 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3338 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3339 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3340 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3341 | -C "client hello, adding max_fragment_length extension" \ |
| 3342 | -S "found max fragment length extension" \ |
| 3343 | -S "server hello, max_fragment_length extension" \ |
| 3344 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3345 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3346 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3347 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3348 | requires_gnutls |
| 3349 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3350 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3351 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3352 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3353 | -c "Maximum incoming record payload length is 4096" \ |
| 3354 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3355 | -c "client hello, adding max_fragment_length extension" \ |
| 3356 | -c "found max_fragment_length extension" |
| 3357 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3358 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3359 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3360 | run_test "Max fragment length: client, message just fits" \ |
| 3361 | "$P_SRV debug_level=3" \ |
| 3362 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 3363 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3364 | -c "Maximum incoming record payload length is 2048" \ |
| 3365 | -c "Maximum outgoing record payload length is 2048" \ |
| 3366 | -s "Maximum incoming record payload length is 2048" \ |
| 3367 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3368 | -c "client hello, adding max_fragment_length extension" \ |
| 3369 | -s "found max fragment length extension" \ |
| 3370 | -s "server hello, max_fragment_length extension" \ |
| 3371 | -c "found max_fragment_length extension" \ |
| 3372 | -c "2048 bytes written in 1 fragments" \ |
| 3373 | -s "2048 bytes read" |
| 3374 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3375 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3376 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3377 | run_test "Max fragment length: client, larger message" \ |
| 3378 | "$P_SRV debug_level=3" \ |
| 3379 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 3380 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3381 | -c "Maximum incoming record payload length is 2048" \ |
| 3382 | -c "Maximum outgoing record payload length is 2048" \ |
| 3383 | -s "Maximum incoming record payload length is 2048" \ |
| 3384 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3385 | -c "client hello, adding max_fragment_length extension" \ |
| 3386 | -s "found max fragment length extension" \ |
| 3387 | -s "server hello, max_fragment_length extension" \ |
| 3388 | -c "found max_fragment_length extension" \ |
| 3389 | -c "2345 bytes written in 2 fragments" \ |
| 3390 | -s "2048 bytes read" \ |
| 3391 | -s "297 bytes read" |
| 3392 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3393 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3394 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 3395 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3396 | "$P_SRV debug_level=3 dtls=1" \ |
| 3397 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 3398 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3399 | -c "Maximum incoming record payload length is 2048" \ |
| 3400 | -c "Maximum outgoing record payload length is 2048" \ |
| 3401 | -s "Maximum incoming record payload length is 2048" \ |
| 3402 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3403 | -c "client hello, adding max_fragment_length extension" \ |
| 3404 | -s "found max fragment length extension" \ |
| 3405 | -s "server hello, max_fragment_length extension" \ |
| 3406 | -c "found max_fragment_length extension" \ |
| 3407 | -c "fragment larger than.*maximum" |
| 3408 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3409 | # Tests for renegotiation |
| 3410 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3411 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3412 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3413 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3414 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3415 | 0 \ |
| 3416 | -C "client hello, adding renegotiation extension" \ |
| 3417 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3418 | -S "found renegotiation extension" \ |
| 3419 | -s "server hello, secure renegotiation extension" \ |
| 3420 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3421 | -C "=> renegotiate" \ |
| 3422 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3423 | -S "write hello request" |
| 3424 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3425 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3426 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3427 | "$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] | 3428 | "$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] | 3429 | 0 \ |
| 3430 | -c "client hello, adding renegotiation extension" \ |
| 3431 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3432 | -s "found renegotiation extension" \ |
| 3433 | -s "server hello, secure renegotiation extension" \ |
| 3434 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3435 | -c "=> renegotiate" \ |
| 3436 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3437 | -S "write hello request" |
| 3438 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3439 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3440 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3441 | "$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] | 3442 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3443 | 0 \ |
| 3444 | -c "client hello, adding renegotiation extension" \ |
| 3445 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3446 | -s "found renegotiation extension" \ |
| 3447 | -s "server hello, secure renegotiation extension" \ |
| 3448 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3449 | -c "=> renegotiate" \ |
| 3450 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3451 | -s "write hello request" |
| 3452 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3453 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3454 | # 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] | 3455 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3456 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3457 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 3458 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 3459 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3460 | 0 \ |
| 3461 | -c "client hello, adding renegotiation extension" \ |
| 3462 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3463 | -s "found renegotiation extension" \ |
| 3464 | -s "server hello, secure renegotiation extension" \ |
| 3465 | -c "found renegotiation extension" \ |
| 3466 | -c "=> renegotiate" \ |
| 3467 | -s "=> renegotiate" \ |
| 3468 | -S "write hello request" \ |
| 3469 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3470 | |
| 3471 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3472 | # 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] | 3473 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3474 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3475 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 3476 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 3477 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3478 | 0 \ |
| 3479 | -c "client hello, adding renegotiation extension" \ |
| 3480 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3481 | -s "found renegotiation extension" \ |
| 3482 | -s "server hello, secure renegotiation extension" \ |
| 3483 | -c "found renegotiation extension" \ |
| 3484 | -c "=> renegotiate" \ |
| 3485 | -s "=> renegotiate" \ |
| 3486 | -s "write hello request" \ |
| 3487 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3488 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3489 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3490 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3491 | "$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] | 3492 | "$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] | 3493 | 0 \ |
| 3494 | -c "client hello, adding renegotiation extension" \ |
| 3495 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3496 | -s "found renegotiation extension" \ |
| 3497 | -s "server hello, secure renegotiation extension" \ |
| 3498 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3499 | -c "=> renegotiate" \ |
| 3500 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3501 | -s "write hello request" |
| 3502 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3503 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3504 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3505 | requires_max_content_len 2048 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3506 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 3507 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 3508 | "$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" \ |
| 3509 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3510 | -c "Maximum incoming record payload length is 2048" \ |
| 3511 | -c "Maximum outgoing record payload length is 2048" \ |
| 3512 | -s "Maximum incoming record payload length is 2048" \ |
| 3513 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3514 | -c "client hello, adding max_fragment_length extension" \ |
| 3515 | -s "found max fragment length extension" \ |
| 3516 | -s "server hello, max_fragment_length extension" \ |
| 3517 | -c "found max_fragment_length extension" \ |
| 3518 | -c "client hello, adding renegotiation extension" \ |
| 3519 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3520 | -s "found renegotiation extension" \ |
| 3521 | -s "server hello, secure renegotiation extension" \ |
| 3522 | -c "found renegotiation extension" \ |
| 3523 | -c "=> renegotiate" \ |
| 3524 | -s "=> renegotiate" \ |
| 3525 | -s "write hello request" |
| 3526 | |
| 3527 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3528 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3529 | "$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] | 3530 | "$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] | 3531 | 1 \ |
| 3532 | -c "client hello, adding renegotiation extension" \ |
| 3533 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3534 | -S "found renegotiation extension" \ |
| 3535 | -s "server hello, secure renegotiation extension" \ |
| 3536 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3537 | -c "=> renegotiate" \ |
| 3538 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3539 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 3540 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3541 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3542 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3543 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3544 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3545 | "$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] | 3546 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3547 | 0 \ |
| 3548 | -C "client hello, adding renegotiation extension" \ |
| 3549 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3550 | -S "found renegotiation extension" \ |
| 3551 | -s "server hello, secure renegotiation extension" \ |
| 3552 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3553 | -C "=> renegotiate" \ |
| 3554 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3555 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 3556 | -S "SSL - An unexpected message was received from our peer" \ |
| 3557 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3558 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3559 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3560 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3561 | "$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] | 3562 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3563 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3564 | 0 \ |
| 3565 | -C "client hello, adding renegotiation extension" \ |
| 3566 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3567 | -S "found renegotiation extension" \ |
| 3568 | -s "server hello, secure renegotiation extension" \ |
| 3569 | -c "found renegotiation extension" \ |
| 3570 | -C "=> renegotiate" \ |
| 3571 | -S "=> renegotiate" \ |
| 3572 | -s "write hello request" \ |
| 3573 | -S "SSL - An unexpected message was received from our peer" \ |
| 3574 | -S "failed" |
| 3575 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3576 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3577 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3578 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3579 | "$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] | 3580 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3581 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3582 | 0 \ |
| 3583 | -C "client hello, adding renegotiation extension" \ |
| 3584 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3585 | -S "found renegotiation extension" \ |
| 3586 | -s "server hello, secure renegotiation extension" \ |
| 3587 | -c "found renegotiation extension" \ |
| 3588 | -C "=> renegotiate" \ |
| 3589 | -S "=> renegotiate" \ |
| 3590 | -s "write hello request" \ |
| 3591 | -S "SSL - An unexpected message was received from our peer" \ |
| 3592 | -S "failed" |
| 3593 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3594 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3595 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3596 | "$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] | 3597 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3598 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3599 | 0 \ |
| 3600 | -C "client hello, adding renegotiation extension" \ |
| 3601 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3602 | -S "found renegotiation extension" \ |
| 3603 | -s "server hello, secure renegotiation extension" \ |
| 3604 | -c "found renegotiation extension" \ |
| 3605 | -C "=> renegotiate" \ |
| 3606 | -S "=> renegotiate" \ |
| 3607 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3608 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3609 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3610 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3611 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3612 | "$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] | 3613 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3614 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3615 | 0 \ |
| 3616 | -c "client hello, adding renegotiation extension" \ |
| 3617 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3618 | -s "found renegotiation extension" \ |
| 3619 | -s "server hello, secure renegotiation extension" \ |
| 3620 | -c "found renegotiation extension" \ |
| 3621 | -c "=> renegotiate" \ |
| 3622 | -s "=> renegotiate" \ |
| 3623 | -s "write hello request" \ |
| 3624 | -S "SSL - An unexpected message was received from our peer" \ |
| 3625 | -S "failed" |
| 3626 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3627 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3628 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3629 | "$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] | 3630 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3631 | 0 \ |
| 3632 | -C "client hello, adding renegotiation extension" \ |
| 3633 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3634 | -S "found renegotiation extension" \ |
| 3635 | -s "server hello, secure renegotiation extension" \ |
| 3636 | -c "found renegotiation extension" \ |
| 3637 | -S "record counter limit reached: renegotiate" \ |
| 3638 | -C "=> renegotiate" \ |
| 3639 | -S "=> renegotiate" \ |
| 3640 | -S "write hello request" \ |
| 3641 | -S "SSL - An unexpected message was received from our peer" \ |
| 3642 | -S "failed" |
| 3643 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 3644 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3645 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3646 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3647 | "$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] | 3648 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3649 | 0 \ |
| 3650 | -c "client hello, adding renegotiation extension" \ |
| 3651 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3652 | -s "found renegotiation extension" \ |
| 3653 | -s "server hello, secure renegotiation extension" \ |
| 3654 | -c "found renegotiation extension" \ |
| 3655 | -s "record counter limit reached: renegotiate" \ |
| 3656 | -c "=> renegotiate" \ |
| 3657 | -s "=> renegotiate" \ |
| 3658 | -s "write hello request" \ |
| 3659 | -S "SSL - An unexpected message was received from our peer" \ |
| 3660 | -S "failed" |
| 3661 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3662 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3663 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3664 | "$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] | 3665 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3666 | 0 \ |
| 3667 | -c "client hello, adding renegotiation extension" \ |
| 3668 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3669 | -s "found renegotiation extension" \ |
| 3670 | -s "server hello, secure renegotiation extension" \ |
| 3671 | -c "found renegotiation extension" \ |
| 3672 | -s "record counter limit reached: renegotiate" \ |
| 3673 | -c "=> renegotiate" \ |
| 3674 | -s "=> renegotiate" \ |
| 3675 | -s "write hello request" \ |
| 3676 | -S "SSL - An unexpected message was received from our peer" \ |
| 3677 | -S "failed" |
| 3678 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3679 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3680 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3681 | "$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] | 3682 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 3683 | 0 \ |
| 3684 | -C "client hello, adding renegotiation extension" \ |
| 3685 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3686 | -S "found renegotiation extension" \ |
| 3687 | -s "server hello, secure renegotiation extension" \ |
| 3688 | -c "found renegotiation extension" \ |
| 3689 | -S "record counter limit reached: renegotiate" \ |
| 3690 | -C "=> renegotiate" \ |
| 3691 | -S "=> renegotiate" \ |
| 3692 | -S "write hello request" \ |
| 3693 | -S "SSL - An unexpected message was received from our peer" \ |
| 3694 | -S "failed" |
| 3695 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3696 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3697 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3698 | "$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] | 3699 | "$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] | 3700 | 0 \ |
| 3701 | -c "client hello, adding renegotiation extension" \ |
| 3702 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3703 | -s "found renegotiation extension" \ |
| 3704 | -s "server hello, secure renegotiation extension" \ |
| 3705 | -c "found renegotiation extension" \ |
| 3706 | -c "=> renegotiate" \ |
| 3707 | -s "=> renegotiate" \ |
| 3708 | -S "write hello request" |
| 3709 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3710 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3711 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3712 | "$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] | 3713 | "$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] | 3714 | 0 \ |
| 3715 | -c "client hello, adding renegotiation extension" \ |
| 3716 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3717 | -s "found renegotiation extension" \ |
| 3718 | -s "server hello, secure renegotiation extension" \ |
| 3719 | -c "found renegotiation extension" \ |
| 3720 | -c "=> renegotiate" \ |
| 3721 | -s "=> renegotiate" \ |
| 3722 | -s "write hello request" |
| 3723 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3724 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3725 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 3726 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3727 | "$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] | 3728 | 0 \ |
| 3729 | -c "client hello, adding renegotiation extension" \ |
| 3730 | -c "found renegotiation extension" \ |
| 3731 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3732 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3733 | -C "error" \ |
| 3734 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3735 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3736 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3737 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3738 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 3739 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3740 | "$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] | 3741 | 0 \ |
| 3742 | -c "client hello, adding renegotiation extension" \ |
| 3743 | -c "found renegotiation extension" \ |
| 3744 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3745 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3746 | -C "error" \ |
| 3747 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3748 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3749 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3750 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3751 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 3752 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3753 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3754 | 1 \ |
| 3755 | -c "client hello, adding renegotiation extension" \ |
| 3756 | -C "found renegotiation extension" \ |
| 3757 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3758 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3759 | -c "error" \ |
| 3760 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3761 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3762 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3763 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3764 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 3765 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3766 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3767 | allow_legacy=0" \ |
| 3768 | 1 \ |
| 3769 | -c "client hello, adding renegotiation extension" \ |
| 3770 | -C "found renegotiation extension" \ |
| 3771 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3772 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3773 | -c "error" \ |
| 3774 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3775 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3776 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3777 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3778 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 3779 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3780 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3781 | allow_legacy=1" \ |
| 3782 | 0 \ |
| 3783 | -c "client hello, adding renegotiation extension" \ |
| 3784 | -C "found renegotiation extension" \ |
| 3785 | -c "=> renegotiate" \ |
| 3786 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3787 | -C "error" \ |
| 3788 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3789 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3790 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 3791 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 3792 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 3793 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3794 | 0 \ |
| 3795 | -c "client hello, adding renegotiation extension" \ |
| 3796 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3797 | -s "found renegotiation extension" \ |
| 3798 | -s "server hello, secure renegotiation extension" \ |
| 3799 | -c "found renegotiation extension" \ |
| 3800 | -c "=> renegotiate" \ |
| 3801 | -s "=> renegotiate" \ |
| 3802 | -S "write hello request" |
| 3803 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3804 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3805 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 3806 | "$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] | 3807 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 3808 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3809 | 0 \ |
| 3810 | -c "client hello, adding renegotiation extension" \ |
| 3811 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3812 | -s "found renegotiation extension" \ |
| 3813 | -s "server hello, secure renegotiation extension" \ |
| 3814 | -c "found renegotiation extension" \ |
| 3815 | -c "=> renegotiate" \ |
| 3816 | -s "=> renegotiate" \ |
| 3817 | -s "write hello request" |
| 3818 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3819 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3820 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 3821 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 3822 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 3823 | 0 \ |
| 3824 | -c "client hello, adding renegotiation extension" \ |
| 3825 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3826 | -s "found renegotiation extension" \ |
| 3827 | -s "server hello, secure renegotiation extension" \ |
| 3828 | -s "record counter limit reached: renegotiate" \ |
| 3829 | -c "=> renegotiate" \ |
| 3830 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3831 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3832 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 3833 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3834 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3835 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 3836 | "$G_SRV -u --mtu 4096" \ |
| 3837 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3838 | 0 \ |
| 3839 | -c "client hello, adding renegotiation extension" \ |
| 3840 | -c "found renegotiation extension" \ |
| 3841 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3842 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3843 | -C "error" \ |
| 3844 | -s "Extra-header:" |
| 3845 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3846 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 3847 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3848 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3849 | run_test "Renego ext: gnutls server strict, client default" \ |
| 3850 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 3851 | "$P_CLI debug_level=3" \ |
| 3852 | 0 \ |
| 3853 | -c "found renegotiation extension" \ |
| 3854 | -C "error" \ |
| 3855 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3856 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3857 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3858 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 3859 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3860 | "$P_CLI debug_level=3" \ |
| 3861 | 0 \ |
| 3862 | -C "found renegotiation extension" \ |
| 3863 | -C "error" \ |
| 3864 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3865 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3866 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3867 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 3868 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3869 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 3870 | 1 \ |
| 3871 | -C "found renegotiation extension" \ |
| 3872 | -c "error" \ |
| 3873 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3874 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3875 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3876 | run_test "Renego ext: gnutls client strict, server default" \ |
| 3877 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3878 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3879 | 0 \ |
| 3880 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3881 | -s "server hello, secure renegotiation extension" |
| 3882 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3883 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3884 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 3885 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3886 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3887 | 0 \ |
| 3888 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3889 | -S "server hello, secure renegotiation extension" |
| 3890 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3891 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3892 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 3893 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3894 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3895 | 1 \ |
| 3896 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3897 | -S "server hello, secure renegotiation extension" |
| 3898 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3899 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 3900 | |
| 3901 | requires_gnutls |
| 3902 | run_test "DER format: no trailing bytes" \ |
| 3903 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 3904 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3905 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3906 | 0 \ |
| 3907 | -c "Handshake was completed" \ |
| 3908 | |
| 3909 | requires_gnutls |
| 3910 | run_test "DER format: with a trailing zero byte" \ |
| 3911 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 3912 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3913 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3914 | 0 \ |
| 3915 | -c "Handshake was completed" \ |
| 3916 | |
| 3917 | requires_gnutls |
| 3918 | run_test "DER format: with a trailing random byte" \ |
| 3919 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 3920 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3921 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3922 | 0 \ |
| 3923 | -c "Handshake was completed" \ |
| 3924 | |
| 3925 | requires_gnutls |
| 3926 | run_test "DER format: with 2 trailing random bytes" \ |
| 3927 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 3928 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3929 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3930 | 0 \ |
| 3931 | -c "Handshake was completed" \ |
| 3932 | |
| 3933 | requires_gnutls |
| 3934 | run_test "DER format: with 4 trailing random bytes" \ |
| 3935 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 3936 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3937 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3938 | 0 \ |
| 3939 | -c "Handshake was completed" \ |
| 3940 | |
| 3941 | requires_gnutls |
| 3942 | run_test "DER format: with 8 trailing random bytes" \ |
| 3943 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 3944 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3945 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3946 | 0 \ |
| 3947 | -c "Handshake was completed" \ |
| 3948 | |
| 3949 | requires_gnutls |
| 3950 | run_test "DER format: with 9 trailing random bytes" \ |
| 3951 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 3952 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3953 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3954 | 0 \ |
| 3955 | -c "Handshake was completed" \ |
| 3956 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 3957 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 3958 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3959 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3960 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3961 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3962 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3963 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3964 | 1 \ |
| 3965 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3966 | -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] | 3967 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3968 | -c "X509 - Certificate verification failed" |
| 3969 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3970 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3971 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3972 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3973 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3974 | 0 \ |
| 3975 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3976 | -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] | 3977 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3978 | -C "X509 - Certificate verification failed" |
| 3979 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 3980 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 3981 | "$P_SRV" \ |
| 3982 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 3983 | 0 \ |
| 3984 | -c "x509_verify_cert() returned" \ |
| 3985 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3986 | -c "! Certificate verification flags"\ |
| 3987 | -C "! mbedtls_ssl_handshake returned" \ |
| 3988 | -C "X509 - Certificate verification failed" \ |
| 3989 | -C "SSL - No CA Chain is set, but required to operate" |
| 3990 | |
| 3991 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 3992 | "$P_SRV" \ |
| 3993 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 3994 | 1 \ |
| 3995 | -c "x509_verify_cert() returned" \ |
| 3996 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3997 | -c "! Certificate verification flags"\ |
| 3998 | -c "! mbedtls_ssl_handshake returned" \ |
| 3999 | -c "SSL - No CA Chain is set, but required to operate" |
| 4000 | |
| 4001 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4002 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4003 | # the client informs the server about the supported curves - it does, though, in the |
| 4004 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4005 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4006 | # different means to have the server ignoring the client's supported curve list. |
| 4007 | |
| 4008 | requires_config_enabled MBEDTLS_ECP_C |
| 4009 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4010 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4011 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4012 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4013 | 1 \ |
| 4014 | -c "bad certificate (EC key curve)"\ |
| 4015 | -c "! Certificate verification flags"\ |
| 4016 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4017 | |
| 4018 | requires_config_enabled MBEDTLS_ECP_C |
| 4019 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4020 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4021 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4022 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4023 | 1 \ |
| 4024 | -c "bad certificate (EC key curve)"\ |
| 4025 | -c "! Certificate verification flags"\ |
| 4026 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4027 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4028 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 4029 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4030 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4031 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4032 | 0 \ |
| 4033 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4034 | -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] | 4035 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4036 | -C "X509 - Certificate verification failed" |
| 4037 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 4038 | run_test "Authentication: client SHA256, server required" \ |
| 4039 | "$P_SRV auth_mode=required" \ |
| 4040 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4041 | key_file=data_files/server6.key \ |
| 4042 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4043 | 0 \ |
| 4044 | -c "Supported Signature Algorithm found: 4," \ |
| 4045 | -c "Supported Signature Algorithm found: 5," |
| 4046 | |
| 4047 | run_test "Authentication: client SHA384, server required" \ |
| 4048 | "$P_SRV auth_mode=required" \ |
| 4049 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4050 | key_file=data_files/server6.key \ |
| 4051 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4052 | 0 \ |
| 4053 | -c "Supported Signature Algorithm found: 4," \ |
| 4054 | -c "Supported Signature Algorithm found: 5," |
| 4055 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4056 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 4057 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4058 | "$P_CLI debug_level=3 crt_file=none \ |
| 4059 | key_file=data_files/server5.key" \ |
| 4060 | 1 \ |
| 4061 | -S "skip write certificate request" \ |
| 4062 | -C "skip parse certificate request" \ |
| 4063 | -c "got a certificate request" \ |
| 4064 | -c "= write certificate$" \ |
| 4065 | -C "skip write certificate$" \ |
| 4066 | -S "x509_verify_cert() returned" \ |
| 4067 | -s "client has no certificate" \ |
| 4068 | -s "! mbedtls_ssl_handshake returned" \ |
| 4069 | -c "! mbedtls_ssl_handshake returned" \ |
| 4070 | -s "No client certification received from the client, but required by the authentication mode" |
| 4071 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4072 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4073 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4074 | "$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] | 4075 | key_file=data_files/server5.key" \ |
| 4076 | 1 \ |
| 4077 | -S "skip write certificate request" \ |
| 4078 | -C "skip parse certificate request" \ |
| 4079 | -c "got a certificate request" \ |
| 4080 | -C "skip write certificate" \ |
| 4081 | -C "skip write certificate verify" \ |
| 4082 | -S "skip parse certificate verify" \ |
| 4083 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4084 | -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] | 4085 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4086 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4087 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4088 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4089 | # We don't check that the client receives the alert because it might |
| 4090 | # detect that its write end of the connection is closed and abort |
| 4091 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4092 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4093 | run_test "Authentication: client cert not trusted, server required" \ |
| 4094 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4095 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4096 | key_file=data_files/server5.key" \ |
| 4097 | 1 \ |
| 4098 | -S "skip write certificate request" \ |
| 4099 | -C "skip parse certificate request" \ |
| 4100 | -c "got a certificate request" \ |
| 4101 | -C "skip write certificate" \ |
| 4102 | -C "skip write certificate verify" \ |
| 4103 | -S "skip parse certificate verify" \ |
| 4104 | -s "x509_verify_cert() returned" \ |
| 4105 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4106 | -s "! mbedtls_ssl_handshake returned" \ |
| 4107 | -c "! mbedtls_ssl_handshake returned" \ |
| 4108 | -s "X509 - Certificate verification failed" |
| 4109 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4110 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4111 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4112 | "$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] | 4113 | key_file=data_files/server5.key" \ |
| 4114 | 0 \ |
| 4115 | -S "skip write certificate request" \ |
| 4116 | -C "skip parse certificate request" \ |
| 4117 | -c "got a certificate request" \ |
| 4118 | -C "skip write certificate" \ |
| 4119 | -C "skip write certificate verify" \ |
| 4120 | -S "skip parse certificate verify" \ |
| 4121 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4122 | -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] | 4123 | -S "! mbedtls_ssl_handshake returned" \ |
| 4124 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4125 | -S "X509 - Certificate verification failed" |
| 4126 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4127 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4128 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 4129 | "$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] | 4130 | key_file=data_files/server5.key" \ |
| 4131 | 0 \ |
| 4132 | -s "skip write certificate request" \ |
| 4133 | -C "skip parse certificate request" \ |
| 4134 | -c "got no certificate request" \ |
| 4135 | -c "skip write certificate" \ |
| 4136 | -c "skip write certificate verify" \ |
| 4137 | -s "skip parse certificate verify" \ |
| 4138 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4139 | -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] | 4140 | -S "! mbedtls_ssl_handshake returned" \ |
| 4141 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4142 | -S "X509 - Certificate verification failed" |
| 4143 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4144 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4145 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4146 | "$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] | 4147 | 0 \ |
| 4148 | -S "skip write certificate request" \ |
| 4149 | -C "skip parse certificate request" \ |
| 4150 | -c "got a certificate request" \ |
| 4151 | -C "skip write certificate$" \ |
| 4152 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4153 | -c "skip write certificate verify" \ |
| 4154 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4155 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4156 | -S "! mbedtls_ssl_handshake returned" \ |
| 4157 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4158 | -S "X509 - Certificate verification failed" |
| 4159 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4160 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4161 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4162 | "$O_CLI" \ |
| 4163 | 0 \ |
| 4164 | -S "skip write certificate request" \ |
| 4165 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4166 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4167 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4168 | -S "X509 - Certificate verification failed" |
| 4169 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4170 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4171 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4172 | "$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] | 4173 | 0 \ |
| 4174 | -C "skip parse certificate request" \ |
| 4175 | -c "got a certificate request" \ |
| 4176 | -C "skip write certificate$" \ |
| 4177 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4178 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4179 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4180 | run_test "Authentication: client no cert, openssl server required" \ |
| 4181 | "$O_SRV -Verify 10" \ |
| 4182 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 4183 | 1 \ |
| 4184 | -C "skip parse certificate request" \ |
| 4185 | -c "got a certificate request" \ |
| 4186 | -C "skip write certificate$" \ |
| 4187 | -c "skip write certificate verify" \ |
| 4188 | -c "! mbedtls_ssl_handshake returned" |
| 4189 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4190 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 4191 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 4192 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4193 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4194 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4195 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4196 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 4197 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 4198 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 4199 | # 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] | 4200 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4201 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4202 | run_test "Authentication: server max_int chain, client default" \ |
| 4203 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4204 | key_file=data_files/dir-maxpath/09.key" \ |
| 4205 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4206 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4207 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4208 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4209 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4210 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4211 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 4212 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4213 | key_file=data_files/dir-maxpath/10.key" \ |
| 4214 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4215 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4216 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4217 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4218 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4219 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4220 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 4221 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4222 | key_file=data_files/dir-maxpath/10.key" \ |
| 4223 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4224 | auth_mode=optional" \ |
| 4225 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4226 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4227 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4228 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4229 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4230 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 4231 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4232 | key_file=data_files/dir-maxpath/10.key" \ |
| 4233 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4234 | auth_mode=none" \ |
| 4235 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4236 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4237 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4238 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4239 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4240 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 4241 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 4242 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4243 | key_file=data_files/dir-maxpath/10.key" \ |
| 4244 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4245 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4246 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4247 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4248 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4249 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 4250 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4251 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4252 | key_file=data_files/dir-maxpath/10.key" \ |
| 4253 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4254 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4255 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4256 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4257 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4258 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 4259 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4260 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4261 | key_file=data_files/dir-maxpath/10.key" \ |
| 4262 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4263 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4264 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4265 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4266 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4267 | run_test "Authentication: client max_int chain, server required" \ |
| 4268 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4269 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4270 | key_file=data_files/dir-maxpath/09.key" \ |
| 4271 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4272 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4273 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4274 | # Tests for CA list in CertificateRequest messages |
| 4275 | |
| 4276 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 4277 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4278 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4279 | key_file=data_files/server6.key" \ |
| 4280 | 0 \ |
| 4281 | -s "requested DN" |
| 4282 | |
| 4283 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 4284 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4285 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4286 | key_file=data_files/server6.key" \ |
| 4287 | 0 \ |
| 4288 | -S "requested DN" |
| 4289 | |
| 4290 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 4291 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4292 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4293 | key_file=data_files/server5.key" \ |
| 4294 | 1 \ |
| 4295 | -S "requested DN" \ |
| 4296 | -s "x509_verify_cert() returned" \ |
| 4297 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4298 | -s "! mbedtls_ssl_handshake returned" \ |
| 4299 | -c "! mbedtls_ssl_handshake returned" \ |
| 4300 | -s "X509 - Certificate verification failed" |
| 4301 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4302 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 4303 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4304 | |
| 4305 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4306 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 4307 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4308 | key_file=data_files/server5.key" \ |
| 4309 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4310 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4311 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4312 | -c "x509_verify_cert() returned" \ |
| 4313 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4314 | -c "! mbedtls_ssl_handshake returned" \ |
| 4315 | -c "X509 - Certificate verification failed" |
| 4316 | |
| 4317 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4318 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 4319 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4320 | key_file=data_files/server5.key" \ |
| 4321 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4322 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4323 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4324 | -c "x509_verify_cert() returned" \ |
| 4325 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4326 | -C "! mbedtls_ssl_handshake returned" \ |
| 4327 | -C "X509 - Certificate verification failed" |
| 4328 | |
| 4329 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4330 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4331 | # the client informs the server about the supported curves - it does, though, in the |
| 4332 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4333 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4334 | # different means to have the server ignoring the client's supported curve list. |
| 4335 | |
| 4336 | requires_config_enabled MBEDTLS_ECP_C |
| 4337 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4338 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4339 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4340 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4341 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4342 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4343 | -c "use CA callback for X.509 CRT verification" \ |
| 4344 | -c "bad certificate (EC key curve)" \ |
| 4345 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4346 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4347 | |
| 4348 | requires_config_enabled MBEDTLS_ECP_C |
| 4349 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4350 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4351 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4352 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4353 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4354 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4355 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4356 | -c "bad certificate (EC key curve)"\ |
| 4357 | -c "! Certificate verification flags"\ |
| 4358 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4359 | |
| 4360 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4361 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 4362 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4363 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4364 | key_file=data_files/server6.key \ |
| 4365 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4366 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4367 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4368 | -c "Supported Signature Algorithm found: 4," \ |
| 4369 | -c "Supported Signature Algorithm found: 5," |
| 4370 | |
| 4371 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4372 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 4373 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4374 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4375 | key_file=data_files/server6.key \ |
| 4376 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4377 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4378 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4379 | -c "Supported Signature Algorithm found: 4," \ |
| 4380 | -c "Supported Signature Algorithm found: 5," |
| 4381 | |
| 4382 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4383 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 4384 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4385 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4386 | key_file=data_files/server5.key" \ |
| 4387 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4388 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4389 | -S "skip write certificate request" \ |
| 4390 | -C "skip parse certificate request" \ |
| 4391 | -c "got a certificate request" \ |
| 4392 | -C "skip write certificate" \ |
| 4393 | -C "skip write certificate verify" \ |
| 4394 | -S "skip parse certificate verify" \ |
| 4395 | -s "x509_verify_cert() returned" \ |
| 4396 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4397 | -s "! mbedtls_ssl_handshake returned" \ |
| 4398 | -s "send alert level=2 message=48" \ |
| 4399 | -c "! mbedtls_ssl_handshake returned" \ |
| 4400 | -s "X509 - Certificate verification failed" |
| 4401 | # We don't check that the client receives the alert because it might |
| 4402 | # detect that its write end of the connection is closed and abort |
| 4403 | # before reading the alert message. |
| 4404 | |
| 4405 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4406 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 4407 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4408 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4409 | key_file=data_files/server5.key" \ |
| 4410 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4411 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4412 | -S "skip write certificate request" \ |
| 4413 | -C "skip parse certificate request" \ |
| 4414 | -c "got a certificate request" \ |
| 4415 | -C "skip write certificate" \ |
| 4416 | -C "skip write certificate verify" \ |
| 4417 | -S "skip parse certificate verify" \ |
| 4418 | -s "x509_verify_cert() returned" \ |
| 4419 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4420 | -s "! mbedtls_ssl_handshake returned" \ |
| 4421 | -c "! mbedtls_ssl_handshake returned" \ |
| 4422 | -s "X509 - Certificate verification failed" |
| 4423 | |
| 4424 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4425 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 4426 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4427 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4428 | key_file=data_files/server5.key" \ |
| 4429 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4430 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4431 | -S "skip write certificate request" \ |
| 4432 | -C "skip parse certificate request" \ |
| 4433 | -c "got a certificate request" \ |
| 4434 | -C "skip write certificate" \ |
| 4435 | -C "skip write certificate verify" \ |
| 4436 | -S "skip parse certificate verify" \ |
| 4437 | -s "x509_verify_cert() returned" \ |
| 4438 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4439 | -S "! mbedtls_ssl_handshake returned" \ |
| 4440 | -C "! mbedtls_ssl_handshake returned" \ |
| 4441 | -S "X509 - Certificate verification failed" |
| 4442 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4443 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4444 | requires_full_size_output_buffer |
| 4445 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4446 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 4447 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4448 | key_file=data_files/dir-maxpath/09.key" \ |
| 4449 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4450 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4451 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4452 | -C "X509 - A fatal error occurred" |
| 4453 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4454 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4455 | requires_full_size_output_buffer |
| 4456 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4457 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 4458 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4459 | key_file=data_files/dir-maxpath/10.key" \ |
| 4460 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4461 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4462 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4463 | -c "X509 - A fatal error occurred" |
| 4464 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4465 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4466 | requires_full_size_output_buffer |
| 4467 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4468 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 4469 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4470 | key_file=data_files/dir-maxpath/10.key" \ |
| 4471 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4472 | debug_level=3 auth_mode=optional" \ |
| 4473 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4474 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4475 | -c "X509 - A fatal error occurred" |
| 4476 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4477 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4478 | requires_full_size_output_buffer |
| 4479 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4480 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 4481 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4482 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4483 | key_file=data_files/dir-maxpath/10.key" \ |
| 4484 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4485 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4486 | -s "X509 - A fatal error occurred" |
| 4487 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4488 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4489 | requires_full_size_output_buffer |
| 4490 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4491 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 4492 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4493 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4494 | key_file=data_files/dir-maxpath/10.key" \ |
| 4495 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4496 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4497 | -s "X509 - A fatal error occurred" |
| 4498 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4499 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4500 | requires_full_size_output_buffer |
| 4501 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4502 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 4503 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4504 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4505 | key_file=data_files/dir-maxpath/09.key" \ |
| 4506 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4507 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4508 | -S "X509 - A fatal error occurred" |
| 4509 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4510 | # Tests for certificate selection based on SHA verson |
| 4511 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4512 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4513 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 4514 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4515 | key_file=data_files/server5.key \ |
| 4516 | crt_file2=data_files/server5-sha1.crt \ |
| 4517 | key_file2=data_files/server5.key" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 4518 | "$P_CLI force_version=tls12" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4519 | 0 \ |
| 4520 | -c "signed using.*ECDSA with SHA256" \ |
| 4521 | -C "signed using.*ECDSA with SHA1" |
| 4522 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4523 | # tests for SNI |
| 4524 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4525 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4526 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4527 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4528 | 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] | 4529 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4530 | 0 \ |
| 4531 | -S "parse ServerName extension" \ |
| 4532 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4533 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4534 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4535 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4536 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4537 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4538 | 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] | 4539 | 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] | 4540 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4541 | 0 \ |
| 4542 | -s "parse ServerName extension" \ |
| 4543 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4544 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4545 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4546 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4547 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4548 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4549 | 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] | 4550 | 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] | 4551 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4552 | 0 \ |
| 4553 | -s "parse ServerName extension" \ |
| 4554 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4555 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4556 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4557 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4558 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4559 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4560 | 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] | 4561 | 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] | 4562 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4563 | 1 \ |
| 4564 | -s "parse ServerName extension" \ |
| 4565 | -s "ssl_sni_wrapper() returned" \ |
| 4566 | -s "mbedtls_ssl_handshake returned" \ |
| 4567 | -c "mbedtls_ssl_handshake returned" \ |
| 4568 | -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] | 4569 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4570 | run_test "SNI: client auth no override: optional" \ |
| 4571 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4572 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4573 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4574 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4575 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4576 | -S "skip write certificate request" \ |
| 4577 | -C "skip parse certificate request" \ |
| 4578 | -c "got a certificate request" \ |
| 4579 | -C "skip write certificate" \ |
| 4580 | -C "skip write certificate verify" \ |
| 4581 | -S "skip parse certificate verify" |
| 4582 | |
| 4583 | run_test "SNI: client auth override: none -> optional" \ |
| 4584 | "$P_SRV debug_level=3 auth_mode=none \ |
| 4585 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4586 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4587 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4588 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4589 | -S "skip write certificate request" \ |
| 4590 | -C "skip parse certificate request" \ |
| 4591 | -c "got a certificate request" \ |
| 4592 | -C "skip write certificate" \ |
| 4593 | -C "skip write certificate verify" \ |
| 4594 | -S "skip parse certificate verify" |
| 4595 | |
| 4596 | run_test "SNI: client auth override: optional -> none" \ |
| 4597 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4598 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4599 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4600 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4601 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4602 | -s "skip write certificate request" \ |
| 4603 | -C "skip parse certificate request" \ |
| 4604 | -c "got no certificate request" \ |
| 4605 | -c "skip write certificate" \ |
| 4606 | -c "skip write certificate verify" \ |
| 4607 | -s "skip parse certificate verify" |
| 4608 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4609 | run_test "SNI: CA no override" \ |
| 4610 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4611 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4612 | ca_file=data_files/test-ca.crt \ |
| 4613 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4614 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4615 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4616 | 1 \ |
| 4617 | -S "skip write certificate request" \ |
| 4618 | -C "skip parse certificate request" \ |
| 4619 | -c "got a certificate request" \ |
| 4620 | -C "skip write certificate" \ |
| 4621 | -C "skip write certificate verify" \ |
| 4622 | -S "skip parse certificate verify" \ |
| 4623 | -s "x509_verify_cert() returned" \ |
| 4624 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4625 | -S "The certificate has been revoked (is on a CRL)" |
| 4626 | |
| 4627 | run_test "SNI: CA override" \ |
| 4628 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4629 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4630 | ca_file=data_files/test-ca.crt \ |
| 4631 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4632 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4633 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4634 | 0 \ |
| 4635 | -S "skip write certificate request" \ |
| 4636 | -C "skip parse certificate request" \ |
| 4637 | -c "got a certificate request" \ |
| 4638 | -C "skip write certificate" \ |
| 4639 | -C "skip write certificate verify" \ |
| 4640 | -S "skip parse certificate verify" \ |
| 4641 | -S "x509_verify_cert() returned" \ |
| 4642 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4643 | -S "The certificate has been revoked (is on a CRL)" |
| 4644 | |
| 4645 | run_test "SNI: CA override with CRL" \ |
| 4646 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4647 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4648 | ca_file=data_files/test-ca.crt \ |
| 4649 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4650 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4651 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4652 | 1 \ |
| 4653 | -S "skip write certificate request" \ |
| 4654 | -C "skip parse certificate request" \ |
| 4655 | -c "got a certificate request" \ |
| 4656 | -C "skip write certificate" \ |
| 4657 | -C "skip write certificate verify" \ |
| 4658 | -S "skip parse certificate verify" \ |
| 4659 | -s "x509_verify_cert() returned" \ |
| 4660 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4661 | -s "The certificate has been revoked (is on a CRL)" |
| 4662 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4663 | # Tests for SNI and DTLS |
| 4664 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4665 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4666 | run_test "SNI: DTLS, no SNI callback" \ |
| 4667 | "$P_SRV debug_level=3 dtls=1 \ |
| 4668 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 4669 | "$P_CLI server_name=localhost dtls=1" \ |
| 4670 | 0 \ |
| 4671 | -S "parse ServerName extension" \ |
| 4672 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4673 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4674 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4675 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4676 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4677 | "$P_SRV debug_level=3 dtls=1 \ |
| 4678 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4679 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4680 | "$P_CLI server_name=localhost dtls=1" \ |
| 4681 | 0 \ |
| 4682 | -s "parse ServerName extension" \ |
| 4683 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4684 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4685 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4686 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4687 | run_test "SNI: DTLS, matching cert 2" \ |
| 4688 | "$P_SRV debug_level=3 dtls=1 \ |
| 4689 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4690 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4691 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 4692 | 0 \ |
| 4693 | -s "parse ServerName extension" \ |
| 4694 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4695 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 4696 | |
| 4697 | run_test "SNI: DTLS, no matching cert" \ |
| 4698 | "$P_SRV debug_level=3 dtls=1 \ |
| 4699 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4700 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4701 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 4702 | 1 \ |
| 4703 | -s "parse ServerName extension" \ |
| 4704 | -s "ssl_sni_wrapper() returned" \ |
| 4705 | -s "mbedtls_ssl_handshake returned" \ |
| 4706 | -c "mbedtls_ssl_handshake returned" \ |
| 4707 | -c "SSL - A fatal alert message was received from our peer" |
| 4708 | |
| 4709 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 4710 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4711 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4712 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4713 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4714 | 0 \ |
| 4715 | -S "skip write certificate request" \ |
| 4716 | -C "skip parse certificate request" \ |
| 4717 | -c "got a certificate request" \ |
| 4718 | -C "skip write certificate" \ |
| 4719 | -C "skip write certificate verify" \ |
| 4720 | -S "skip parse certificate verify" |
| 4721 | |
| 4722 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 4723 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 4724 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4725 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4726 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4727 | 0 \ |
| 4728 | -S "skip write certificate request" \ |
| 4729 | -C "skip parse certificate request" \ |
| 4730 | -c "got a certificate request" \ |
| 4731 | -C "skip write certificate" \ |
| 4732 | -C "skip write certificate verify" \ |
| 4733 | -S "skip parse certificate verify" |
| 4734 | |
| 4735 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 4736 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4737 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4738 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4739 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4740 | 0 \ |
| 4741 | -s "skip write certificate request" \ |
| 4742 | -C "skip parse certificate request" \ |
| 4743 | -c "got no certificate request" \ |
| 4744 | -c "skip write certificate" \ |
| 4745 | -c "skip write certificate verify" \ |
| 4746 | -s "skip parse certificate verify" |
| 4747 | |
| 4748 | run_test "SNI: DTLS, CA no override" \ |
| 4749 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4750 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4751 | ca_file=data_files/test-ca.crt \ |
| 4752 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4753 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4754 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4755 | 1 \ |
| 4756 | -S "skip write certificate request" \ |
| 4757 | -C "skip parse certificate request" \ |
| 4758 | -c "got a certificate request" \ |
| 4759 | -C "skip write certificate" \ |
| 4760 | -C "skip write certificate verify" \ |
| 4761 | -S "skip parse certificate verify" \ |
| 4762 | -s "x509_verify_cert() returned" \ |
| 4763 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4764 | -S "The certificate has been revoked (is on a CRL)" |
| 4765 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4766 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4767 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4768 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4769 | ca_file=data_files/test-ca.crt \ |
| 4770 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4771 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4772 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4773 | 0 \ |
| 4774 | -S "skip write certificate request" \ |
| 4775 | -C "skip parse certificate request" \ |
| 4776 | -c "got a certificate request" \ |
| 4777 | -C "skip write certificate" \ |
| 4778 | -C "skip write certificate verify" \ |
| 4779 | -S "skip parse certificate verify" \ |
| 4780 | -S "x509_verify_cert() returned" \ |
| 4781 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4782 | -S "The certificate has been revoked (is on a CRL)" |
| 4783 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4784 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4785 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4786 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 4787 | ca_file=data_files/test-ca.crt \ |
| 4788 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4789 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4790 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4791 | 1 \ |
| 4792 | -S "skip write certificate request" \ |
| 4793 | -C "skip parse certificate request" \ |
| 4794 | -c "got a certificate request" \ |
| 4795 | -C "skip write certificate" \ |
| 4796 | -C "skip write certificate verify" \ |
| 4797 | -S "skip parse certificate verify" \ |
| 4798 | -s "x509_verify_cert() returned" \ |
| 4799 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4800 | -s "The certificate has been revoked (is on a CRL)" |
| 4801 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4802 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 4803 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4804 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4805 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4806 | "$P_CLI nbio=2 tickets=0" \ |
| 4807 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4808 | -S "mbedtls_ssl_handshake returned" \ |
| 4809 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4810 | -c "Read from server: .* bytes read" |
| 4811 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4812 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4813 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 4814 | "$P_CLI nbio=2 tickets=0" \ |
| 4815 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4816 | -S "mbedtls_ssl_handshake returned" \ |
| 4817 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4818 | -c "Read from server: .* bytes read" |
| 4819 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4820 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4821 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4822 | "$P_CLI nbio=2 tickets=1" \ |
| 4823 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4824 | -S "mbedtls_ssl_handshake returned" \ |
| 4825 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4826 | -c "Read from server: .* bytes read" |
| 4827 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4828 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4829 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4830 | "$P_CLI nbio=2 tickets=1" \ |
| 4831 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4832 | -S "mbedtls_ssl_handshake returned" \ |
| 4833 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4834 | -c "Read from server: .* bytes read" |
| 4835 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4836 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4837 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4838 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4839 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4840 | -S "mbedtls_ssl_handshake returned" \ |
| 4841 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4842 | -c "Read from server: .* bytes read" |
| 4843 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4844 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4845 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4846 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4847 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4848 | -S "mbedtls_ssl_handshake returned" \ |
| 4849 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4850 | -c "Read from server: .* bytes read" |
| 4851 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4852 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4853 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4854 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 4855 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4856 | -S "mbedtls_ssl_handshake returned" \ |
| 4857 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4858 | -c "Read from server: .* bytes read" |
| 4859 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 4860 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 4861 | |
| 4862 | run_test "Event-driven I/O: basic handshake" \ |
| 4863 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4864 | "$P_CLI event=1 tickets=0" \ |
| 4865 | 0 \ |
| 4866 | -S "mbedtls_ssl_handshake returned" \ |
| 4867 | -C "mbedtls_ssl_handshake returned" \ |
| 4868 | -c "Read from server: .* bytes read" |
| 4869 | |
| 4870 | run_test "Event-driven I/O: client auth" \ |
| 4871 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 4872 | "$P_CLI event=1 tickets=0" \ |
| 4873 | 0 \ |
| 4874 | -S "mbedtls_ssl_handshake returned" \ |
| 4875 | -C "mbedtls_ssl_handshake returned" \ |
| 4876 | -c "Read from server: .* bytes read" |
| 4877 | |
| 4878 | run_test "Event-driven I/O: ticket" \ |
| 4879 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4880 | "$P_CLI event=1 tickets=1" \ |
| 4881 | 0 \ |
| 4882 | -S "mbedtls_ssl_handshake returned" \ |
| 4883 | -C "mbedtls_ssl_handshake returned" \ |
| 4884 | -c "Read from server: .* bytes read" |
| 4885 | |
| 4886 | run_test "Event-driven I/O: ticket + client auth" \ |
| 4887 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4888 | "$P_CLI event=1 tickets=1" \ |
| 4889 | 0 \ |
| 4890 | -S "mbedtls_ssl_handshake returned" \ |
| 4891 | -C "mbedtls_ssl_handshake returned" \ |
| 4892 | -c "Read from server: .* bytes read" |
| 4893 | |
| 4894 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 4895 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4896 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4897 | 0 \ |
| 4898 | -S "mbedtls_ssl_handshake returned" \ |
| 4899 | -C "mbedtls_ssl_handshake returned" \ |
| 4900 | -c "Read from server: .* bytes read" |
| 4901 | |
| 4902 | run_test "Event-driven I/O: ticket + resume" \ |
| 4903 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4904 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4905 | 0 \ |
| 4906 | -S "mbedtls_ssl_handshake returned" \ |
| 4907 | -C "mbedtls_ssl_handshake returned" \ |
| 4908 | -c "Read from server: .* bytes read" |
| 4909 | |
| 4910 | run_test "Event-driven I/O: session-id resume" \ |
| 4911 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4912 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 4913 | 0 \ |
| 4914 | -S "mbedtls_ssl_handshake returned" \ |
| 4915 | -C "mbedtls_ssl_handshake returned" \ |
| 4916 | -c "Read from server: .* bytes read" |
| 4917 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 4918 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 4919 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 4920 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4921 | 0 \ |
| 4922 | -c "Read from server: .* bytes read" |
| 4923 | |
| 4924 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 4925 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 4926 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4927 | 0 \ |
| 4928 | -c "Read from server: .* bytes read" |
| 4929 | |
| 4930 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 4931 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 4932 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4933 | 0 \ |
| 4934 | -c "Read from server: .* bytes read" |
| 4935 | |
| 4936 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 4937 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 4938 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4939 | 0 \ |
| 4940 | -c "Read from server: .* bytes read" |
| 4941 | |
| 4942 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 4943 | "$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] | 4944 | "$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] | 4945 | 0 \ |
| 4946 | -c "Read from server: .* bytes read" |
| 4947 | |
| 4948 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 4949 | "$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] | 4950 | "$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] | 4951 | 0 \ |
| 4952 | -c "Read from server: .* bytes read" |
| 4953 | |
| 4954 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 4955 | "$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] | 4956 | "$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] | 4957 | 0 \ |
| 4958 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4959 | |
| 4960 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 4961 | # During session resumption, the client will send its ApplicationData record |
| 4962 | # within the same datagram as the Finished messages. In this situation, the |
| 4963 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 4964 | # because the ApplicationData request has already been queued internally. |
| 4965 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 4966 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4967 | "$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] | 4968 | "$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] | 4969 | 0 \ |
| 4970 | -c "Read from server: .* bytes read" |
| 4971 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4972 | # Tests for version negotiation |
| 4973 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4974 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4975 | "$P_SRV" \ |
| 4976 | "$P_CLI" \ |
| 4977 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4978 | -S "mbedtls_ssl_handshake returned" \ |
| 4979 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4980 | -s "Protocol is TLSv1.2" \ |
| 4981 | -c "Protocol is TLSv1.2" |
| 4982 | |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 4983 | run_test "Not supported version check: cli TLS 1.0" \ |
| 4984 | "$P_SRV" \ |
| 4985 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 4986 | 1 \ |
| 4987 | -s "Handshake protocol not within min/max boundaries" \ |
| 4988 | -c "Error in protocol version" \ |
| 4989 | -S "Protocol is TLSv1.0" \ |
| 4990 | -C "Handshake was completed" |
| 4991 | |
| 4992 | run_test "Not supported version check: cli TLS 1.1" \ |
| 4993 | "$P_SRV" \ |
| 4994 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 4995 | 1 \ |
| 4996 | -s "Handshake protocol not within min/max boundaries" \ |
| 4997 | -c "Error in protocol version" \ |
| 4998 | -S "Protocol is TLSv1.1" \ |
| 4999 | -C "Handshake was completed" |
| 5000 | |
| 5001 | run_test "Not supported version check: srv max TLS 1.0" \ |
| 5002 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 5003 | "$P_CLI" \ |
| 5004 | 1 \ |
| 5005 | -s "Error in protocol version" \ |
| 5006 | -c "Handshake protocol not within min/max boundaries" \ |
| 5007 | -S "Version: TLS1.0" \ |
| 5008 | -C "Protocol is TLSv1.0" |
| 5009 | |
| 5010 | run_test "Not supported version check: srv max TLS 1.1" \ |
| 5011 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 5012 | "$P_CLI" \ |
| 5013 | 1 \ |
| 5014 | -s "Error in protocol version" \ |
| 5015 | -c "Handshake protocol not within min/max boundaries" \ |
| 5016 | -S "Version: TLS1.1" \ |
| 5017 | -C "Protocol is TLSv1.1" |
| 5018 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5019 | # Tests for ALPN extension |
| 5020 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5021 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5022 | "$P_SRV debug_level=3" \ |
| 5023 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5024 | 0 \ |
| 5025 | -C "client hello, adding alpn extension" \ |
| 5026 | -S "found alpn extension" \ |
| 5027 | -C "got an alert message, type: \\[2:120]" \ |
| 5028 | -S "server hello, adding alpn extension" \ |
| 5029 | -C "found alpn extension " \ |
| 5030 | -C "Application Layer Protocol is" \ |
| 5031 | -S "Application Layer Protocol is" |
| 5032 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5033 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5034 | "$P_SRV debug_level=3" \ |
| 5035 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5036 | 0 \ |
| 5037 | -c "client hello, adding alpn extension" \ |
| 5038 | -s "found alpn extension" \ |
| 5039 | -C "got an alert message, type: \\[2:120]" \ |
| 5040 | -S "server hello, adding alpn extension" \ |
| 5041 | -C "found alpn extension " \ |
| 5042 | -c "Application Layer Protocol is (none)" \ |
| 5043 | -S "Application Layer Protocol is" |
| 5044 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5045 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5046 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5047 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5048 | 0 \ |
| 5049 | -C "client hello, adding alpn extension" \ |
| 5050 | -S "found alpn extension" \ |
| 5051 | -C "got an alert message, type: \\[2:120]" \ |
| 5052 | -S "server hello, adding alpn extension" \ |
| 5053 | -C "found alpn extension " \ |
| 5054 | -C "Application Layer Protocol is" \ |
| 5055 | -s "Application Layer Protocol is (none)" |
| 5056 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5057 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5058 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5059 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5060 | 0 \ |
| 5061 | -c "client hello, adding alpn extension" \ |
| 5062 | -s "found alpn extension" \ |
| 5063 | -C "got an alert message, type: \\[2:120]" \ |
| 5064 | -s "server hello, adding alpn extension" \ |
| 5065 | -c "found alpn extension" \ |
| 5066 | -c "Application Layer Protocol is abc" \ |
| 5067 | -s "Application Layer Protocol is abc" |
| 5068 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5069 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5070 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5071 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5072 | 0 \ |
| 5073 | -c "client hello, adding alpn extension" \ |
| 5074 | -s "found alpn extension" \ |
| 5075 | -C "got an alert message, type: \\[2:120]" \ |
| 5076 | -s "server hello, adding alpn extension" \ |
| 5077 | -c "found alpn extension" \ |
| 5078 | -c "Application Layer Protocol is abc" \ |
| 5079 | -s "Application Layer Protocol is abc" |
| 5080 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5081 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5082 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5083 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5084 | 0 \ |
| 5085 | -c "client hello, adding alpn extension" \ |
| 5086 | -s "found alpn extension" \ |
| 5087 | -C "got an alert message, type: \\[2:120]" \ |
| 5088 | -s "server hello, adding alpn extension" \ |
| 5089 | -c "found alpn extension" \ |
| 5090 | -c "Application Layer Protocol is 1234" \ |
| 5091 | -s "Application Layer Protocol is 1234" |
| 5092 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5093 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5094 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 5095 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5096 | 1 \ |
| 5097 | -c "client hello, adding alpn extension" \ |
| 5098 | -s "found alpn extension" \ |
| 5099 | -c "got an alert message, type: \\[2:120]" \ |
| 5100 | -S "server hello, adding alpn extension" \ |
| 5101 | -C "found alpn extension" \ |
| 5102 | -C "Application Layer Protocol is 1234" \ |
| 5103 | -S "Application Layer Protocol is 1234" |
| 5104 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 5105 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5106 | # Tests for keyUsage in leaf certificates, part 1: |
| 5107 | # server-side certificate/suite selection |
| 5108 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5109 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5110 | "$P_SRV key_file=data_files/server2.key \ |
| 5111 | crt_file=data_files/server2.ku-ds.crt" \ |
| 5112 | "$P_CLI" \ |
| 5113 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 5114 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5115 | |
| 5116 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5117 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5118 | "$P_SRV key_file=data_files/server2.key \ |
| 5119 | crt_file=data_files/server2.ku-ke.crt" \ |
| 5120 | "$P_CLI" \ |
| 5121 | 0 \ |
| 5122 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 5123 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5124 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5125 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5126 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5127 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5128 | 1 \ |
| 5129 | -C "Ciphersuite is " |
| 5130 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5131 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5132 | "$P_SRV key_file=data_files/server5.key \ |
| 5133 | crt_file=data_files/server5.ku-ds.crt" \ |
| 5134 | "$P_CLI" \ |
| 5135 | 0 \ |
| 5136 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 5137 | |
| 5138 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5139 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5140 | "$P_SRV key_file=data_files/server5.key \ |
| 5141 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5142 | "$P_CLI" \ |
| 5143 | 0 \ |
| 5144 | -c "Ciphersuite is TLS-ECDH-" |
| 5145 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5146 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5147 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5148 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5149 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5150 | 1 \ |
| 5151 | -C "Ciphersuite is " |
| 5152 | |
| 5153 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5154 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5155 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5156 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5157 | "$O_SRV -key data_files/server2.key \ |
| 5158 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5159 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5160 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5161 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5162 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5163 | -C "Processing of the Certificate handshake message failed" \ |
| 5164 | -c "Ciphersuite is TLS-" |
| 5165 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5166 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5167 | "$O_SRV -key data_files/server2.key \ |
| 5168 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5169 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5170 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5171 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5172 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5173 | -C "Processing of the Certificate handshake message failed" \ |
| 5174 | -c "Ciphersuite is TLS-" |
| 5175 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5176 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5177 | "$O_SRV -key data_files/server2.key \ |
| 5178 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5179 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5180 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5181 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5182 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5183 | -C "Processing of the Certificate handshake message failed" \ |
| 5184 | -c "Ciphersuite is TLS-" |
| 5185 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5186 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5187 | "$O_SRV -key data_files/server2.key \ |
| 5188 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5189 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5190 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5191 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5192 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5193 | -c "Processing of the Certificate handshake message failed" \ |
| 5194 | -C "Ciphersuite is TLS-" |
| 5195 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5196 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 5197 | "$O_SRV -key data_files/server2.key \ |
| 5198 | -cert data_files/server2.ku-ke.crt" \ |
| 5199 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5200 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5201 | 0 \ |
| 5202 | -c "bad certificate (usage extensions)" \ |
| 5203 | -C "Processing of the Certificate handshake message failed" \ |
| 5204 | -c "Ciphersuite is TLS-" \ |
| 5205 | -c "! Usage does not match the keyUsage extension" |
| 5206 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5207 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5208 | "$O_SRV -key data_files/server2.key \ |
| 5209 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5210 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5211 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5212 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5213 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5214 | -C "Processing of the Certificate handshake message failed" \ |
| 5215 | -c "Ciphersuite is TLS-" |
| 5216 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5217 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5218 | "$O_SRV -key data_files/server2.key \ |
| 5219 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5220 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5221 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5222 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5223 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5224 | -c "Processing of the Certificate handshake message failed" \ |
| 5225 | -C "Ciphersuite is TLS-" |
| 5226 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5227 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 5228 | "$O_SRV -key data_files/server2.key \ |
| 5229 | -cert data_files/server2.ku-ds.crt" \ |
| 5230 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5231 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5232 | 0 \ |
| 5233 | -c "bad certificate (usage extensions)" \ |
| 5234 | -C "Processing of the Certificate handshake message failed" \ |
| 5235 | -c "Ciphersuite is TLS-" \ |
| 5236 | -c "! Usage does not match the keyUsage extension" |
| 5237 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5238 | # Tests for keyUsage in leaf certificates, part 3: |
| 5239 | # server-side checking of client cert |
| 5240 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5241 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5242 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5243 | "$O_CLI -key data_files/server2.key \ |
| 5244 | -cert data_files/server2.ku-ds.crt" \ |
| 5245 | 0 \ |
| 5246 | -S "bad certificate (usage extensions)" \ |
| 5247 | -S "Processing of the Certificate handshake message failed" |
| 5248 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5249 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5250 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5251 | "$O_CLI -key data_files/server2.key \ |
| 5252 | -cert data_files/server2.ku-ke.crt" \ |
| 5253 | 0 \ |
| 5254 | -s "bad certificate (usage extensions)" \ |
| 5255 | -S "Processing of the Certificate handshake message failed" |
| 5256 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5257 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5258 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5259 | "$O_CLI -key data_files/server2.key \ |
| 5260 | -cert data_files/server2.ku-ke.crt" \ |
| 5261 | 1 \ |
| 5262 | -s "bad certificate (usage extensions)" \ |
| 5263 | -s "Processing of the Certificate handshake message failed" |
| 5264 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5265 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5266 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5267 | "$O_CLI -key data_files/server5.key \ |
| 5268 | -cert data_files/server5.ku-ds.crt" \ |
| 5269 | 0 \ |
| 5270 | -S "bad certificate (usage extensions)" \ |
| 5271 | -S "Processing of the Certificate handshake message failed" |
| 5272 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5273 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5274 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5275 | "$O_CLI -key data_files/server5.key \ |
| 5276 | -cert data_files/server5.ku-ka.crt" \ |
| 5277 | 0 \ |
| 5278 | -s "bad certificate (usage extensions)" \ |
| 5279 | -S "Processing of the Certificate handshake message failed" |
| 5280 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5281 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 5282 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5283 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5284 | "$P_SRV key_file=data_files/server5.key \ |
| 5285 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5286 | "$P_CLI" \ |
| 5287 | 0 |
| 5288 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5289 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5290 | "$P_SRV key_file=data_files/server5.key \ |
| 5291 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5292 | "$P_CLI" \ |
| 5293 | 0 |
| 5294 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5295 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5296 | "$P_SRV key_file=data_files/server5.key \ |
| 5297 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 5298 | "$P_CLI" \ |
| 5299 | 0 |
| 5300 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5301 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5302 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5303 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5304 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5305 | 1 |
| 5306 | |
| 5307 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 5308 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5309 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5310 | "$O_SRV -key data_files/server5.key \ |
| 5311 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5312 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5313 | 0 \ |
| 5314 | -C "bad certificate (usage extensions)" \ |
| 5315 | -C "Processing of the Certificate handshake message failed" \ |
| 5316 | -c "Ciphersuite is TLS-" |
| 5317 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5318 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5319 | "$O_SRV -key data_files/server5.key \ |
| 5320 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5321 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5322 | 0 \ |
| 5323 | -C "bad certificate (usage extensions)" \ |
| 5324 | -C "Processing of the Certificate handshake message failed" \ |
| 5325 | -c "Ciphersuite is TLS-" |
| 5326 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5327 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5328 | "$O_SRV -key data_files/server5.key \ |
| 5329 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5330 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5331 | 0 \ |
| 5332 | -C "bad certificate (usage extensions)" \ |
| 5333 | -C "Processing of the Certificate handshake message failed" \ |
| 5334 | -c "Ciphersuite is TLS-" |
| 5335 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5336 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5337 | "$O_SRV -key data_files/server5.key \ |
| 5338 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5339 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5340 | 1 \ |
| 5341 | -c "bad certificate (usage extensions)" \ |
| 5342 | -c "Processing of the Certificate handshake message failed" \ |
| 5343 | -C "Ciphersuite is TLS-" |
| 5344 | |
| 5345 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 5346 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5347 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5348 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5349 | "$O_CLI -key data_files/server5.key \ |
| 5350 | -cert data_files/server5.eku-cli.crt" \ |
| 5351 | 0 \ |
| 5352 | -S "bad certificate (usage extensions)" \ |
| 5353 | -S "Processing of the Certificate handshake message failed" |
| 5354 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5355 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5356 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5357 | "$O_CLI -key data_files/server5.key \ |
| 5358 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 5359 | 0 \ |
| 5360 | -S "bad certificate (usage extensions)" \ |
| 5361 | -S "Processing of the Certificate handshake message failed" |
| 5362 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5363 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5364 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5365 | "$O_CLI -key data_files/server5.key \ |
| 5366 | -cert data_files/server5.eku-cs_any.crt" \ |
| 5367 | 0 \ |
| 5368 | -S "bad certificate (usage extensions)" \ |
| 5369 | -S "Processing of the Certificate handshake message failed" |
| 5370 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5371 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5372 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5373 | "$O_CLI -key data_files/server5.key \ |
| 5374 | -cert data_files/server5.eku-cs.crt" \ |
| 5375 | 0 \ |
| 5376 | -s "bad certificate (usage extensions)" \ |
| 5377 | -S "Processing of the Certificate handshake message failed" |
| 5378 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5379 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5380 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5381 | "$O_CLI -key data_files/server5.key \ |
| 5382 | -cert data_files/server5.eku-cs.crt" \ |
| 5383 | 1 \ |
| 5384 | -s "bad certificate (usage extensions)" \ |
| 5385 | -s "Processing of the Certificate handshake message failed" |
| 5386 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5387 | # Tests for DHM parameters loading |
| 5388 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5389 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5390 | "$P_SRV" \ |
| 5391 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5392 | debug_level=3" \ |
| 5393 | 0 \ |
| 5394 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 5395 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5396 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5397 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5398 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5399 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5400 | debug_level=3" \ |
| 5401 | 0 \ |
| 5402 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 5403 | -c "value of 'DHM: G ' (2 bits)" |
| 5404 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5405 | # Tests for DHM client-side size checking |
| 5406 | |
| 5407 | run_test "DHM size: server default, client default, OK" \ |
| 5408 | "$P_SRV" \ |
| 5409 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5410 | debug_level=1" \ |
| 5411 | 0 \ |
| 5412 | -C "DHM prime too short:" |
| 5413 | |
| 5414 | run_test "DHM size: server default, client 2048, OK" \ |
| 5415 | "$P_SRV" \ |
| 5416 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5417 | debug_level=1 dhmlen=2048" \ |
| 5418 | 0 \ |
| 5419 | -C "DHM prime too short:" |
| 5420 | |
| 5421 | run_test "DHM size: server 1024, client default, OK" \ |
| 5422 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5423 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5424 | debug_level=1" \ |
| 5425 | 0 \ |
| 5426 | -C "DHM prime too short:" |
| 5427 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5428 | run_test "DHM size: server 999, client 999, OK" \ |
| 5429 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5430 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5431 | debug_level=1 dhmlen=999" \ |
| 5432 | 0 \ |
| 5433 | -C "DHM prime too short:" |
| 5434 | |
| 5435 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 5436 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5437 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5438 | debug_level=1 dhmlen=1000" \ |
| 5439 | 0 \ |
| 5440 | -C "DHM prime too short:" |
| 5441 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5442 | run_test "DHM size: server 1000, client default, rejected" \ |
| 5443 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5444 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5445 | debug_level=1" \ |
| 5446 | 1 \ |
| 5447 | -c "DHM prime too short:" |
| 5448 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5449 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 5450 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5451 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5452 | debug_level=1 dhmlen=1001" \ |
| 5453 | 1 \ |
| 5454 | -c "DHM prime too short:" |
| 5455 | |
| 5456 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 5457 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5458 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5459 | debug_level=1 dhmlen=1000" \ |
| 5460 | 1 \ |
| 5461 | -c "DHM prime too short:" |
| 5462 | |
| 5463 | run_test "DHM size: server 998, client 999, rejected" \ |
| 5464 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 5465 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5466 | debug_level=1 dhmlen=999" \ |
| 5467 | 1 \ |
| 5468 | -c "DHM prime too short:" |
| 5469 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5470 | run_test "DHM size: server default, client 2049, rejected" \ |
| 5471 | "$P_SRV" \ |
| 5472 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5473 | debug_level=1 dhmlen=2049" \ |
| 5474 | 1 \ |
| 5475 | -c "DHM prime too short:" |
| 5476 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5477 | # Tests for PSK callback |
| 5478 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5479 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5480 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 5481 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5482 | psk_identity=foo psk=abc123" \ |
| 5483 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5484 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5485 | -S "SSL - Unknown identity received" \ |
| 5486 | -S "SSL - Verification of the message MAC failed" |
| 5487 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5488 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5489 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 5490 | "$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] | 5491 | "$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] | 5492 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5493 | 0 \ |
| 5494 | -c "skip PMS generation for opaque PSK"\ |
| 5495 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5496 | -C "session hash for extended master secret"\ |
| 5497 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5498 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5499 | -S "SSL - Unknown identity received" \ |
| 5500 | -S "SSL - Verification of the message MAC failed" |
| 5501 | |
| 5502 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5503 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 5504 | "$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] | 5505 | "$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] | 5506 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5507 | 0 \ |
| 5508 | -c "skip PMS generation for opaque PSK"\ |
| 5509 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5510 | -C "session hash for extended master secret"\ |
| 5511 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5512 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5513 | -S "SSL - Unknown identity received" \ |
| 5514 | -S "SSL - Verification of the message MAC failed" |
| 5515 | |
| 5516 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5517 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 5518 | "$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] | 5519 | "$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] | 5520 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5521 | 0 \ |
| 5522 | -c "skip PMS generation for opaque PSK"\ |
| 5523 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5524 | -c "session hash for extended master secret"\ |
| 5525 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5526 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5527 | -S "SSL - Unknown identity received" \ |
| 5528 | -S "SSL - Verification of the message MAC failed" |
| 5529 | |
| 5530 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5531 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 5532 | "$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] | 5533 | "$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] | 5534 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5535 | 0 \ |
| 5536 | -c "skip PMS generation for opaque PSK"\ |
| 5537 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5538 | -c "session hash for extended master secret"\ |
| 5539 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5540 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5541 | -S "SSL - Unknown identity received" \ |
| 5542 | -S "SSL - Verification of the message MAC failed" |
| 5543 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5544 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5545 | 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] | 5546 | "$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" \ |
| 5547 | "$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] | 5548 | psk_identity=foo psk=abc123" \ |
| 5549 | 0 \ |
| 5550 | -C "skip PMS generation for opaque PSK"\ |
| 5551 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5552 | -C "session hash for extended master secret"\ |
| 5553 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5554 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5555 | -S "SSL - Unknown identity received" \ |
| 5556 | -S "SSL - Verification of the message MAC failed" |
| 5557 | |
| 5558 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5559 | 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] | 5560 | "$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" \ |
| 5561 | "$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] | 5562 | psk_identity=foo psk=abc123" \ |
| 5563 | 0 \ |
| 5564 | -C "skip PMS generation for opaque PSK"\ |
| 5565 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5566 | -C "session hash for extended master secret"\ |
| 5567 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5568 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5569 | -S "SSL - Unknown identity received" \ |
| 5570 | -S "SSL - Verification of the message MAC failed" |
| 5571 | |
| 5572 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5573 | 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] | 5574 | "$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] | 5575 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5576 | "$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] | 5577 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5578 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5579 | -c "session hash for extended master secret"\ |
| 5580 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5581 | -C "skip PMS generation for opaque PSK"\ |
| 5582 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5583 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5584 | -S "SSL - Unknown identity received" \ |
| 5585 | -S "SSL - Verification of the message MAC failed" |
| 5586 | |
| 5587 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5588 | 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] | 5589 | "$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] | 5590 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5591 | "$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] | 5592 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5593 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5594 | -c "session hash for extended master secret"\ |
| 5595 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5596 | -C "skip PMS generation for opaque PSK"\ |
| 5597 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5598 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5599 | -S "SSL - Unknown identity received" \ |
| 5600 | -S "SSL - Verification of the message MAC failed" |
| 5601 | |
| 5602 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5603 | 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] | 5604 | "$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" \ |
| 5605 | "$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] | 5606 | psk_identity=def psk=beef" \ |
| 5607 | 0 \ |
| 5608 | -C "skip PMS generation for opaque PSK"\ |
| 5609 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5610 | -C "session hash for extended master secret"\ |
| 5611 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5612 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5613 | -S "SSL - Unknown identity received" \ |
| 5614 | -S "SSL - Verification of the message MAC failed" |
| 5615 | |
| 5616 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5617 | 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] | 5618 | "$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" \ |
| 5619 | "$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] | 5620 | psk_identity=def psk=beef" \ |
| 5621 | 0 \ |
| 5622 | -C "skip PMS generation for opaque PSK"\ |
| 5623 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5624 | -C "session hash for extended master secret"\ |
| 5625 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5626 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5627 | -S "SSL - Unknown identity received" \ |
| 5628 | -S "SSL - Verification of the message MAC failed" |
| 5629 | |
| 5630 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5631 | 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] | 5632 | "$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] | 5633 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5634 | "$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] | 5635 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5636 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5637 | -c "session hash for extended master secret"\ |
| 5638 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5639 | -C "skip PMS generation for opaque PSK"\ |
| 5640 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5641 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5642 | -S "SSL - Unknown identity received" \ |
| 5643 | -S "SSL - Verification of the message MAC failed" |
| 5644 | |
| 5645 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5646 | 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] | 5647 | "$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] | 5648 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5649 | "$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] | 5650 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5651 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5652 | -c "session hash for extended master secret"\ |
| 5653 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5654 | -C "skip PMS generation for opaque PSK"\ |
| 5655 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5656 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5657 | -S "SSL - Unknown identity received" \ |
| 5658 | -S "SSL - Verification of the message MAC failed" |
| 5659 | |
| 5660 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5661 | 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] | 5662 | "$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" \ |
| 5663 | "$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] | 5664 | psk_identity=def psk=beef" \ |
| 5665 | 0 \ |
| 5666 | -C "skip PMS generation for opaque PSK"\ |
| 5667 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5668 | -C "session hash for extended master secret"\ |
| 5669 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5670 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5671 | -S "SSL - Unknown identity received" \ |
| 5672 | -S "SSL - Verification of the message MAC failed" |
| 5673 | |
| 5674 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5675 | 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] | 5676 | "$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" \ |
| 5677 | "$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] | 5678 | psk_identity=def psk=beef" \ |
| 5679 | 0 \ |
| 5680 | -C "skip PMS generation for opaque PSK"\ |
| 5681 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5682 | -C "session hash for extended master secret"\ |
| 5683 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5684 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5685 | -S "SSL - Unknown identity received" \ |
| 5686 | -S "SSL - Verification of the message MAC failed" |
| 5687 | |
| 5688 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5689 | 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] | 5690 | "$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" \ |
| 5691 | "$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] | 5692 | psk_identity=def psk=beef" \ |
| 5693 | 0 \ |
| 5694 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5695 | -C "session hash for extended master secret"\ |
| 5696 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5697 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5698 | -S "SSL - Unknown identity received" \ |
| 5699 | -S "SSL - Verification of the message MAC failed" |
| 5700 | |
| 5701 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5702 | 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] | 5703 | "$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" \ |
| 5704 | "$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] | 5705 | psk_identity=def psk=beef" \ |
| 5706 | 0 \ |
| 5707 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5708 | -C "session hash for extended master secret"\ |
| 5709 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5710 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5711 | -S "SSL - Unknown identity received" \ |
| 5712 | -S "SSL - Verification of the message MAC failed" |
| 5713 | |
| 5714 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5715 | 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] | 5716 | "$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" \ |
| 5717 | "$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] | 5718 | psk_identity=def psk=beef" \ |
| 5719 | 1 \ |
| 5720 | -s "SSL - Verification of the message MAC failed" |
| 5721 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5722 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5723 | "$P_SRV" \ |
| 5724 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5725 | psk_identity=foo psk=abc123" \ |
| 5726 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 5727 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5728 | -S "SSL - Unknown identity received" \ |
| 5729 | -S "SSL - Verification of the message MAC failed" |
| 5730 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5731 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5732 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 5733 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5734 | psk_identity=foo psk=abc123" \ |
| 5735 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5736 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5737 | -s "SSL - Unknown identity received" \ |
| 5738 | -S "SSL - Verification of the message MAC failed" |
| 5739 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5740 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5741 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5742 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5743 | psk_identity=abc psk=dead" \ |
| 5744 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5745 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5746 | -S "SSL - Unknown identity received" \ |
| 5747 | -S "SSL - Verification of the message MAC failed" |
| 5748 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5749 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5750 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5751 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5752 | psk_identity=def psk=beef" \ |
| 5753 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5754 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5755 | -S "SSL - Unknown identity received" \ |
| 5756 | -S "SSL - Verification of the message MAC failed" |
| 5757 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5758 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5759 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5760 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5761 | psk_identity=ghi psk=beef" \ |
| 5762 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5763 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5764 | -s "SSL - Unknown identity received" \ |
| 5765 | -S "SSL - Verification of the message MAC failed" |
| 5766 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5767 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5768 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5769 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5770 | psk_identity=abc psk=beef" \ |
| 5771 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5772 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5773 | -S "SSL - Unknown identity received" \ |
| 5774 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5775 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5776 | # Tests for EC J-PAKE |
| 5777 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5778 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5779 | run_test "ECJPAKE: client not configured" \ |
| 5780 | "$P_SRV debug_level=3" \ |
| 5781 | "$P_CLI debug_level=3" \ |
| 5782 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5783 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5784 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5785 | -S "found ecjpake kkpp extension" \ |
| 5786 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5787 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5788 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5789 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 5790 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5791 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5792 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5793 | run_test "ECJPAKE: server not configured" \ |
| 5794 | "$P_SRV debug_level=3" \ |
| 5795 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5796 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5797 | 1 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5798 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5799 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5800 | -s "found ecjpake kkpp extension" \ |
| 5801 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5802 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5803 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5804 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 5805 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5806 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5807 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5808 | run_test "ECJPAKE: working, TLS" \ |
| 5809 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5810 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5811 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 5812 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5813 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5814 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5815 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5816 | -s "found ecjpake kkpp extension" \ |
| 5817 | -S "skip ecjpake kkpp extension" \ |
| 5818 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5819 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5820 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 5821 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5822 | -S "SSL - Verification of the message MAC failed" |
| 5823 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5824 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5825 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5826 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 5827 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5828 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 5829 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5830 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5831 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5832 | -s "SSL - Verification of the message MAC failed" |
| 5833 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5834 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5835 | run_test "ECJPAKE: working, DTLS" \ |
| 5836 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5837 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5838 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5839 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5840 | -c "re-using cached ecjpake parameters" \ |
| 5841 | -S "SSL - Verification of the message MAC failed" |
| 5842 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5843 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5844 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 5845 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 5846 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5847 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5848 | 0 \ |
| 5849 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5850 | -S "SSL - Verification of the message MAC failed" |
| 5851 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5852 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5853 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5854 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 5855 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5856 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 5857 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5858 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5859 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5860 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5861 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5862 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5863 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5864 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 5865 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 5866 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 5867 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5868 | 0 |
| 5869 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 5870 | # Test for ClientHello without extensions |
| 5871 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 5872 | requires_gnutls |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 5873 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 5874 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5875 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 5876 | 0 \ |
| 5877 | -s "dumping 'client hello extensions' (0 bytes)" |
| 5878 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5879 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5880 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5881 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5882 | "$P_SRV" \ |
| 5883 | "$P_CLI request_size=100" \ |
| 5884 | 0 \ |
| 5885 | -s "Read from client: 100 bytes read$" |
| 5886 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5887 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5888 | "$P_SRV" \ |
| 5889 | "$P_CLI request_size=500" \ |
| 5890 | 0 \ |
| 5891 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5892 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5893 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5894 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5895 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5896 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5897 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5898 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5899 | 0 \ |
| 5900 | -s "Read from client: 1 bytes read" |
| 5901 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5902 | 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] | 5903 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5904 | "$P_CLI request_size=1 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5905 | 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] | 5906 | 0 \ |
| 5907 | -s "Read from client: 1 bytes read" |
| 5908 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5909 | 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] | 5910 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5911 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5912 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5913 | 0 \ |
| 5914 | -s "Read from client: 1 bytes read" |
| 5915 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5916 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5917 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5918 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5919 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5920 | 0 \ |
| 5921 | -s "Read from client: 1 bytes read" |
| 5922 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5923 | 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] | 5924 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5925 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5926 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5927 | 0 \ |
| 5928 | -s "Read from client: 1 bytes read" |
| 5929 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5930 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5931 | |
| 5932 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5933 | run_test "Small client packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5934 | "$P_SRV dtls=1 force_version=dtls12" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5935 | "$P_CLI dtls=1 request_size=1 \ |
| 5936 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5937 | 0 \ |
| 5938 | -s "Read from client: 1 bytes read" |
| 5939 | |
| 5940 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5941 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5942 | "$P_SRV dtls=1 force_version=dtls12 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5943 | "$P_CLI dtls=1 request_size=1 \ |
| 5944 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5945 | 0 \ |
| 5946 | -s "Read from client: 1 bytes read" |
| 5947 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5948 | # Tests for small server packets |
| 5949 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5950 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 5951 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5952 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5953 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5954 | 0 \ |
| 5955 | -c "Read from server: 1 bytes read" |
| 5956 | |
| 5957 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 5958 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5959 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5960 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 5961 | 0 \ |
| 5962 | -c "Read from server: 1 bytes read" |
| 5963 | |
| 5964 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 5965 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5966 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5967 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 5968 | 0 \ |
| 5969 | -c "Read from server: 1 bytes read" |
| 5970 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5971 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 5972 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5973 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5974 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5975 | 0 \ |
| 5976 | -c "Read from server: 1 bytes read" |
| 5977 | |
| 5978 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 5979 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5980 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5981 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5982 | 0 \ |
| 5983 | -c "Read from server: 1 bytes read" |
| 5984 | |
| 5985 | # Tests for small server packets in DTLS |
| 5986 | |
| 5987 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5988 | run_test "Small server packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5989 | "$P_SRV dtls=1 response_size=1 force_version=dtls12" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5990 | "$P_CLI dtls=1 \ |
| 5991 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5992 | 0 \ |
| 5993 | -c "Read from server: 1 bytes read" |
| 5994 | |
| 5995 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5996 | run_test "Small server packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5997 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5998 | "$P_CLI dtls=1 \ |
| 5999 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6000 | 0 \ |
| 6001 | -c "Read from server: 1 bytes read" |
| 6002 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6003 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6004 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6005 | # How many fragments do we expect to write $1 bytes? |
| 6006 | fragments_for_write() { |
| 6007 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 6008 | } |
| 6009 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6010 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6011 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6012 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6013 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6014 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6015 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6016 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6017 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6018 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6019 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6020 | "$P_CLI request_size=16384 force_version=tls12 etm=0 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6021 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6022 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6023 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6024 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6025 | 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] | 6026 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6027 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6028 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6029 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6030 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6031 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6032 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6033 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6034 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6035 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6036 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6037 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6038 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6039 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6040 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6041 | 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] | 6042 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6043 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6044 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6045 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6046 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6047 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6048 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6049 | # 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] | 6050 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 6051 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6052 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6053 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6054 | 0 \ |
| 6055 | -c "Read from server: 16384 bytes read" |
| 6056 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6057 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6058 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6059 | "$P_CLI force_version=tls12 etm=0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6060 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6061 | 0 \ |
| 6062 | -s "16384 bytes written in 1 fragments" \ |
| 6063 | -c "Read from server: 16384 bytes read" |
| 6064 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6065 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6066 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6067 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6068 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6069 | 0 \ |
| 6070 | -c "Read from server: 16384 bytes read" |
| 6071 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6072 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 6073 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6074 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6075 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6076 | 0 \ |
| 6077 | -s "16384 bytes written in 1 fragments" \ |
| 6078 | -c "Read from server: 16384 bytes read" |
| 6079 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6080 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 6081 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6082 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6083 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6084 | 0 \ |
| 6085 | -c "Read from server: 16384 bytes read" |
| 6086 | |
| 6087 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 6088 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6089 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6090 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6091 | 0 \ |
| 6092 | -c "Read from server: 16384 bytes read" |
| 6093 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6094 | # Tests for restartable ECC |
| 6095 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6096 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 6097 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6098 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6099 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6100 | run_test "EC restart: TLS, default" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6101 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6102 | "$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] | 6103 | 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] | 6104 | debug_level=1" \ |
| 6105 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6106 | -C "x509_verify_cert.*4b00" \ |
| 6107 | -C "mbedtls_pk_verify.*4b00" \ |
| 6108 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6109 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6110 | |
| 6111 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6112 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6113 | run_test "EC restart: TLS, max_ops=0" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6114 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6115 | "$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] | 6116 | 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] | 6117 | debug_level=1 ec_max_ops=0" \ |
| 6118 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6119 | -C "x509_verify_cert.*4b00" \ |
| 6120 | -C "mbedtls_pk_verify.*4b00" \ |
| 6121 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6122 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6123 | |
| 6124 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6125 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6126 | run_test "EC restart: TLS, max_ops=65535" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6127 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6128 | "$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] | 6129 | 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] | 6130 | debug_level=1 ec_max_ops=65535" \ |
| 6131 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6132 | -C "x509_verify_cert.*4b00" \ |
| 6133 | -C "mbedtls_pk_verify.*4b00" \ |
| 6134 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6135 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6136 | |
| 6137 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6138 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6139 | run_test "EC restart: TLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6140 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6141 | "$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] | 6142 | 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] | 6143 | debug_level=1 ec_max_ops=1000" \ |
| 6144 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6145 | -c "x509_verify_cert.*4b00" \ |
| 6146 | -c "mbedtls_pk_verify.*4b00" \ |
| 6147 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6148 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6149 | |
| 6150 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6151 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6152 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6153 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6154 | crt_file=data_files/server5-badsign.crt \ |
| 6155 | key_file=data_files/server5.key" \ |
| 6156 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6157 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6158 | debug_level=1 ec_max_ops=1000" \ |
| 6159 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6160 | -c "x509_verify_cert.*4b00" \ |
| 6161 | -C "mbedtls_pk_verify.*4b00" \ |
| 6162 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6163 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6164 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6165 | -c "! mbedtls_ssl_handshake returned" \ |
| 6166 | -c "X509 - Certificate verification failed" |
| 6167 | |
| 6168 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6169 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6170 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6171 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6172 | crt_file=data_files/server5-badsign.crt \ |
| 6173 | key_file=data_files/server5.key" \ |
| 6174 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6175 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6176 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 6177 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6178 | -c "x509_verify_cert.*4b00" \ |
| 6179 | -c "mbedtls_pk_verify.*4b00" \ |
| 6180 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6181 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6182 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6183 | -C "! mbedtls_ssl_handshake returned" \ |
| 6184 | -C "X509 - Certificate verification failed" |
| 6185 | |
| 6186 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6187 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6188 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6189 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6190 | crt_file=data_files/server5-badsign.crt \ |
| 6191 | key_file=data_files/server5.key" \ |
| 6192 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6193 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6194 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 6195 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6196 | -C "x509_verify_cert.*4b00" \ |
| 6197 | -c "mbedtls_pk_verify.*4b00" \ |
| 6198 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6199 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6200 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6201 | -C "! mbedtls_ssl_handshake returned" \ |
| 6202 | -C "X509 - Certificate verification failed" |
| 6203 | |
| 6204 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6205 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6206 | run_test "EC restart: DTLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6207 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6208 | "$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] | 6209 | 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] | 6210 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 6211 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6212 | -c "x509_verify_cert.*4b00" \ |
| 6213 | -c "mbedtls_pk_verify.*4b00" \ |
| 6214 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6215 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6216 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6217 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6218 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6219 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6220 | "$P_SRV curves=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6221 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6222 | debug_level=1 ec_max_ops=1000" \ |
| 6223 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6224 | -c "x509_verify_cert.*4b00" \ |
| 6225 | -c "mbedtls_pk_verify.*4b00" \ |
| 6226 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6227 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6228 | |
| 6229 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6230 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6231 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6232 | "$P_SRV curves=secp256r1 psk=abc123" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6233 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 6234 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 6235 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6236 | -C "x509_verify_cert.*4b00" \ |
| 6237 | -C "mbedtls_pk_verify.*4b00" \ |
| 6238 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6239 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6240 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6241 | # Tests of asynchronous private key support in SSL |
| 6242 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6243 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6244 | run_test "SSL async private: sign, delay=0" \ |
| 6245 | "$P_SRV \ |
| 6246 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6247 | "$P_CLI" \ |
| 6248 | 0 \ |
| 6249 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6250 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6251 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6252 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6253 | run_test "SSL async private: sign, delay=1" \ |
| 6254 | "$P_SRV \ |
| 6255 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6256 | "$P_CLI" \ |
| 6257 | 0 \ |
| 6258 | -s "Async sign callback: using key slot " \ |
| 6259 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6260 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6261 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 6262 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6263 | run_test "SSL async private: sign, delay=2" \ |
| 6264 | "$P_SRV \ |
| 6265 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 6266 | "$P_CLI" \ |
| 6267 | 0 \ |
| 6268 | -s "Async sign callback: using key slot " \ |
| 6269 | -U "Async sign callback: using key slot " \ |
| 6270 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 6271 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6272 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6273 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6274 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6275 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 6276 | run_test "SSL async private: sign, SNI" \ |
| 6277 | "$P_SRV debug_level=3 \ |
| 6278 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 6279 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6280 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6281 | "$P_CLI server_name=polarssl.example" \ |
| 6282 | 0 \ |
| 6283 | -s "Async sign callback: using key slot " \ |
| 6284 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6285 | -s "parse ServerName extension" \ |
| 6286 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6287 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6288 | |
| 6289 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6290 | run_test "SSL async private: decrypt, delay=0" \ |
| 6291 | "$P_SRV \ |
| 6292 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6293 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6294 | 0 \ |
| 6295 | -s "Async decrypt callback: using key slot " \ |
| 6296 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6297 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6298 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6299 | run_test "SSL async private: decrypt, delay=1" \ |
| 6300 | "$P_SRV \ |
| 6301 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6302 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6303 | 0 \ |
| 6304 | -s "Async decrypt callback: using key slot " \ |
| 6305 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6306 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6307 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6308 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6309 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 6310 | "$P_SRV psk=abc123 \ |
| 6311 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6312 | "$P_CLI psk=abc123 \ |
| 6313 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6314 | 0 \ |
| 6315 | -s "Async decrypt callback: using key slot " \ |
| 6316 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6317 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6318 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6319 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 6320 | "$P_SRV psk=abc123 \ |
| 6321 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6322 | "$P_CLI psk=abc123 \ |
| 6323 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6324 | 0 \ |
| 6325 | -s "Async decrypt callback: using key slot " \ |
| 6326 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6327 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6328 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6329 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6330 | run_test "SSL async private: sign callback not present" \ |
| 6331 | "$P_SRV \ |
| 6332 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6333 | "$P_CLI; [ \$? -eq 1 ] && |
| 6334 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6335 | 0 \ |
| 6336 | -S "Async sign callback" \ |
| 6337 | -s "! mbedtls_ssl_handshake returned" \ |
| 6338 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 6339 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 6340 | -s "Successful connection" |
| 6341 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6342 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6343 | run_test "SSL async private: decrypt callback not present" \ |
| 6344 | "$P_SRV debug_level=1 \ |
| 6345 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 6346 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 6347 | [ \$? -eq 1 ] && $P_CLI" \ |
| 6348 | 0 \ |
| 6349 | -S "Async decrypt callback" \ |
| 6350 | -s "! mbedtls_ssl_handshake returned" \ |
| 6351 | -s "got no RSA private key" \ |
| 6352 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6353 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6354 | |
| 6355 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6356 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6357 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6358 | "$P_SRV \ |
| 6359 | async_operations=s async_private_delay1=1 \ |
| 6360 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6361 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6362 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6363 | 0 \ |
| 6364 | -s "Async sign callback: using key slot 0," \ |
| 6365 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6366 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6367 | |
| 6368 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6369 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6370 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6371 | "$P_SRV \ |
| 6372 | async_operations=s async_private_delay2=1 \ |
| 6373 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6374 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6375 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6376 | 0 \ |
| 6377 | -s "Async sign callback: using key slot 0," \ |
| 6378 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6379 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6380 | |
| 6381 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6382 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 6383 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6384 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 6385 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6386 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6387 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6388 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6389 | 0 \ |
| 6390 | -s "Async sign callback: using key slot 1," \ |
| 6391 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6392 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6393 | |
| 6394 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6395 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6396 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6397 | "$P_SRV \ |
| 6398 | async_operations=s async_private_delay1=1 \ |
| 6399 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6400 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6401 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6402 | 0 \ |
| 6403 | -s "Async sign callback: no key matches this certificate." |
| 6404 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6405 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6406 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6407 | "$P_SRV \ |
| 6408 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6409 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6410 | "$P_CLI" \ |
| 6411 | 1 \ |
| 6412 | -s "Async sign callback: injected error" \ |
| 6413 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6414 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6415 | -s "! mbedtls_ssl_handshake returned" |
| 6416 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6417 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6418 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6419 | "$P_SRV \ |
| 6420 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6421 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6422 | "$P_CLI" \ |
| 6423 | 1 \ |
| 6424 | -s "Async sign callback: using key slot " \ |
| 6425 | -S "Async resume" \ |
| 6426 | -s "Async cancel" |
| 6427 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6428 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6429 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6430 | "$P_SRV \ |
| 6431 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6432 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6433 | "$P_CLI" \ |
| 6434 | 1 \ |
| 6435 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6436 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6437 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6438 | -s "! mbedtls_ssl_handshake returned" |
| 6439 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6440 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6441 | run_test "SSL async private: decrypt, error in start" \ |
| 6442 | "$P_SRV \ |
| 6443 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6444 | async_private_error=1" \ |
| 6445 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6446 | 1 \ |
| 6447 | -s "Async decrypt callback: injected error" \ |
| 6448 | -S "Async resume" \ |
| 6449 | -S "Async cancel" \ |
| 6450 | -s "! mbedtls_ssl_handshake returned" |
| 6451 | |
| 6452 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6453 | run_test "SSL async private: decrypt, cancel after start" \ |
| 6454 | "$P_SRV \ |
| 6455 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6456 | async_private_error=2" \ |
| 6457 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6458 | 1 \ |
| 6459 | -s "Async decrypt callback: using key slot " \ |
| 6460 | -S "Async resume" \ |
| 6461 | -s "Async cancel" |
| 6462 | |
| 6463 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6464 | run_test "SSL async private: decrypt, error in resume" \ |
| 6465 | "$P_SRV \ |
| 6466 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6467 | async_private_error=3" \ |
| 6468 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6469 | 1 \ |
| 6470 | -s "Async decrypt callback: using key slot " \ |
| 6471 | -s "Async resume callback: decrypt done but injected error" \ |
| 6472 | -S "Async cancel" \ |
| 6473 | -s "! mbedtls_ssl_handshake returned" |
| 6474 | |
| 6475 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6476 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6477 | "$P_SRV \ |
| 6478 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6479 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6480 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6481 | 0 \ |
| 6482 | -s "Async cancel" \ |
| 6483 | -s "! mbedtls_ssl_handshake returned" \ |
| 6484 | -s "Async resume" \ |
| 6485 | -s "Successful connection" |
| 6486 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6487 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6488 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6489 | "$P_SRV \ |
| 6490 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6491 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6492 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6493 | 0 \ |
| 6494 | -s "! mbedtls_ssl_handshake returned" \ |
| 6495 | -s "Async resume" \ |
| 6496 | -s "Successful connection" |
| 6497 | |
| 6498 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6499 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6500 | 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] | 6501 | "$P_SRV \ |
| 6502 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 6503 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6504 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6505 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6506 | [ \$? -eq 1 ] && |
| 6507 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6508 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 6509 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6510 | -S "Async resume" \ |
| 6511 | -s "Async cancel" \ |
| 6512 | -s "! mbedtls_ssl_handshake returned" \ |
| 6513 | -s "Async sign callback: no key matches this certificate." \ |
| 6514 | -s "Successful connection" |
| 6515 | |
| 6516 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6517 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6518 | 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] | 6519 | "$P_SRV \ |
| 6520 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 6521 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6522 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6523 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6524 | [ \$? -eq 1 ] && |
| 6525 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6526 | 0 \ |
| 6527 | -s "Async resume" \ |
| 6528 | -s "! mbedtls_ssl_handshake returned" \ |
| 6529 | -s "Async sign callback: no key matches this certificate." \ |
| 6530 | -s "Successful connection" |
| 6531 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6532 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6533 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6534 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6535 | "$P_SRV \ |
| 6536 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6537 | exchanges=2 renegotiation=1" \ |
| 6538 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6539 | 0 \ |
| 6540 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6541 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6542 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6543 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6544 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6545 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6546 | "$P_SRV \ |
| 6547 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6548 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6549 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 6550 | 0 \ |
| 6551 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6552 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6553 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6554 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6555 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6556 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6557 | "$P_SRV \ |
| 6558 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6559 | exchanges=2 renegotiation=1" \ |
| 6560 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 6561 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6562 | 0 \ |
| 6563 | -s "Async decrypt callback: using key slot " \ |
| 6564 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6565 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6566 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6567 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6568 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6569 | "$P_SRV \ |
| 6570 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6571 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6572 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 6573 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6574 | 0 \ |
| 6575 | -s "Async decrypt callback: using key slot " \ |
| 6576 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6577 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6578 | # Tests for ECC extensions (rfc 4492) |
| 6579 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6580 | requires_config_enabled MBEDTLS_AES_C |
| 6581 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6582 | requires_config_enabled MBEDTLS_SHA256_C |
| 6583 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6584 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 6585 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6586 | "$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] | 6587 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame^] | 6588 | -C "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6589 | -C "client hello, adding supported_point_formats extension" \ |
| 6590 | -S "found supported elliptic curves extension" \ |
| 6591 | -S "found supported point formats extension" |
| 6592 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6593 | requires_config_enabled MBEDTLS_AES_C |
| 6594 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6595 | requires_config_enabled MBEDTLS_SHA256_C |
| 6596 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6597 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6598 | "$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] | 6599 | "$P_CLI debug_level=3" \ |
| 6600 | 0 \ |
| 6601 | -C "found supported_point_formats extension" \ |
| 6602 | -S "server hello, supported_point_formats extension" |
| 6603 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6604 | requires_config_enabled MBEDTLS_AES_C |
| 6605 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6606 | requires_config_enabled MBEDTLS_SHA256_C |
| 6607 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6608 | run_test "Force an ECC ciphersuite in the client side" \ |
| 6609 | "$P_SRV debug_level=3" \ |
| 6610 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6611 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame^] | 6612 | -c "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6613 | -c "client hello, adding supported_point_formats extension" \ |
| 6614 | -s "found supported elliptic curves extension" \ |
| 6615 | -s "found supported point formats extension" |
| 6616 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6617 | requires_config_enabled MBEDTLS_AES_C |
| 6618 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6619 | requires_config_enabled MBEDTLS_SHA256_C |
| 6620 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6621 | run_test "Force an ECC ciphersuite in the server side" \ |
| 6622 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6623 | "$P_CLI debug_level=3" \ |
| 6624 | 0 \ |
| 6625 | -c "found supported_point_formats extension" \ |
| 6626 | -s "server hello, supported_point_formats extension" |
| 6627 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6628 | # Tests for DTLS HelloVerifyRequest |
| 6629 | |
| 6630 | run_test "DTLS cookie: enabled" \ |
| 6631 | "$P_SRV dtls=1 debug_level=2" \ |
| 6632 | "$P_CLI dtls=1 debug_level=2" \ |
| 6633 | 0 \ |
| 6634 | -s "cookie verification failed" \ |
| 6635 | -s "cookie verification passed" \ |
| 6636 | -S "cookie verification skipped" \ |
| 6637 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6638 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6639 | -S "SSL - The requested feature is not available" |
| 6640 | |
| 6641 | run_test "DTLS cookie: disabled" \ |
| 6642 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 6643 | "$P_CLI dtls=1 debug_level=2" \ |
| 6644 | 0 \ |
| 6645 | -S "cookie verification failed" \ |
| 6646 | -S "cookie verification passed" \ |
| 6647 | -s "cookie verification skipped" \ |
| 6648 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6649 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6650 | -S "SSL - The requested feature is not available" |
| 6651 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6652 | run_test "DTLS cookie: default (failing)" \ |
| 6653 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 6654 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 6655 | 1 \ |
| 6656 | -s "cookie verification failed" \ |
| 6657 | -S "cookie verification passed" \ |
| 6658 | -S "cookie verification skipped" \ |
| 6659 | -C "received hello verify request" \ |
| 6660 | -S "hello verification requested" \ |
| 6661 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6662 | |
| 6663 | requires_ipv6 |
| 6664 | run_test "DTLS cookie: enabled, IPv6" \ |
| 6665 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 6666 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 6667 | 0 \ |
| 6668 | -s "cookie verification failed" \ |
| 6669 | -s "cookie verification passed" \ |
| 6670 | -S "cookie verification skipped" \ |
| 6671 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6672 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6673 | -S "SSL - The requested feature is not available" |
| 6674 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6675 | run_test "DTLS cookie: enabled, nbio" \ |
| 6676 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 6677 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6678 | 0 \ |
| 6679 | -s "cookie verification failed" \ |
| 6680 | -s "cookie verification passed" \ |
| 6681 | -S "cookie verification skipped" \ |
| 6682 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6683 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6684 | -S "SSL - The requested feature is not available" |
| 6685 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6686 | # Tests for client reconnecting from the same port with DTLS |
| 6687 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6688 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6689 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 6690 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 6691 | "$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] | 6692 | 0 \ |
| 6693 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6694 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6695 | -S "Client initiated reconnection from same port" |
| 6696 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6697 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6698 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 6699 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 6700 | "$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] | 6701 | 0 \ |
| 6702 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6703 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6704 | -s "Client initiated reconnection from same port" |
| 6705 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6706 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 6707 | 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] | 6708 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 6709 | "$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] | 6710 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6711 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6712 | -s "Client initiated reconnection from same port" |
| 6713 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6714 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 6715 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 6716 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 6717 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 6718 | 0 \ |
| 6719 | -S "The operation timed out" \ |
| 6720 | -s "Client initiated reconnection from same port" |
| 6721 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6722 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 6723 | "$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] | 6724 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 6725 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6726 | -s "The operation timed out" \ |
| 6727 | -S "Client initiated reconnection from same port" |
| 6728 | |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 6729 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 6730 | -p "$P_PXY inject_clihlo=1" \ |
| 6731 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 6732 | "$P_CLI dtls=1 exchanges=2" \ |
| 6733 | 0 \ |
| 6734 | -s "possible client reconnect from the same port" \ |
| 6735 | -S "Client initiated reconnection from same port" |
| 6736 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6737 | # Tests for various cases of client authentication with DTLS |
| 6738 | # (focused on handshake flows and message parsing) |
| 6739 | |
| 6740 | run_test "DTLS client auth: required" \ |
| 6741 | "$P_SRV dtls=1 auth_mode=required" \ |
| 6742 | "$P_CLI dtls=1" \ |
| 6743 | 0 \ |
| 6744 | -s "Verifying peer X.509 certificate... ok" |
| 6745 | |
| 6746 | run_test "DTLS client auth: optional, client has no cert" \ |
| 6747 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 6748 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 6749 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6750 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6751 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6752 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6753 | "$P_SRV dtls=1 auth_mode=none" \ |
| 6754 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 6755 | 0 \ |
| 6756 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6757 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6758 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 6759 | run_test "DTLS wrong PSK: badmac alert" \ |
| 6760 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 6761 | "$P_CLI dtls=1 psk=abc124" \ |
| 6762 | 1 \ |
| 6763 | -s "SSL - Verification of the message MAC failed" \ |
| 6764 | -c "SSL - A fatal alert message was received from our peer" |
| 6765 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 6766 | # Tests for receiving fragmented handshake messages with DTLS |
| 6767 | |
| 6768 | requires_gnutls |
| 6769 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 6770 | "$G_SRV -u --mtu 2048 -a" \ |
| 6771 | "$P_CLI dtls=1 debug_level=2" \ |
| 6772 | 0 \ |
| 6773 | -C "found fragmented DTLS handshake message" \ |
| 6774 | -C "error" |
| 6775 | |
| 6776 | requires_gnutls |
| 6777 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 6778 | "$G_SRV -u --mtu 512" \ |
| 6779 | "$P_CLI dtls=1 debug_level=2" \ |
| 6780 | 0 \ |
| 6781 | -c "found fragmented DTLS handshake message" \ |
| 6782 | -C "error" |
| 6783 | |
| 6784 | requires_gnutls |
| 6785 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 6786 | "$G_SRV -u --mtu 128" \ |
| 6787 | "$P_CLI dtls=1 debug_level=2" \ |
| 6788 | 0 \ |
| 6789 | -c "found fragmented DTLS handshake message" \ |
| 6790 | -C "error" |
| 6791 | |
| 6792 | requires_gnutls |
| 6793 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 6794 | "$G_SRV -u --mtu 128" \ |
| 6795 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6796 | 0 \ |
| 6797 | -c "found fragmented DTLS handshake message" \ |
| 6798 | -C "error" |
| 6799 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6800 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6801 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6802 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 6803 | "$G_SRV -u --mtu 256" \ |
| 6804 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6805 | 0 \ |
| 6806 | -c "found fragmented DTLS handshake message" \ |
| 6807 | -c "client hello, adding renegotiation extension" \ |
| 6808 | -c "found renegotiation extension" \ |
| 6809 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6810 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6811 | -C "error" \ |
| 6812 | -s "Extra-header:" |
| 6813 | |
| 6814 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6815 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6816 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 6817 | "$G_SRV -u --mtu 256" \ |
| 6818 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6819 | 0 \ |
| 6820 | -c "found fragmented DTLS handshake message" \ |
| 6821 | -c "client hello, adding renegotiation extension" \ |
| 6822 | -c "found renegotiation extension" \ |
| 6823 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6824 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6825 | -C "error" \ |
| 6826 | -s "Extra-header:" |
| 6827 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 6828 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 6829 | "$O_SRV -dtls -mtu 2048" \ |
| 6830 | "$P_CLI dtls=1 debug_level=2" \ |
| 6831 | 0 \ |
| 6832 | -C "found fragmented DTLS handshake message" \ |
| 6833 | -C "error" |
| 6834 | |
| 6835 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 6836 | "$O_SRV -dtls -mtu 768" \ |
| 6837 | "$P_CLI dtls=1 debug_level=2" \ |
| 6838 | 0 \ |
| 6839 | -c "found fragmented DTLS handshake message" \ |
| 6840 | -C "error" |
| 6841 | |
| 6842 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 6843 | "$O_SRV -dtls -mtu 256" \ |
| 6844 | "$P_CLI dtls=1 debug_level=2" \ |
| 6845 | 0 \ |
| 6846 | -c "found fragmented DTLS handshake message" \ |
| 6847 | -C "error" |
| 6848 | |
| 6849 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 6850 | "$O_SRV -dtls -mtu 256" \ |
| 6851 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6852 | 0 \ |
| 6853 | -c "found fragmented DTLS handshake message" \ |
| 6854 | -C "error" |
| 6855 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6856 | # Tests for sending fragmented handshake messages with DTLS |
| 6857 | # |
| 6858 | # Use client auth when we need the client to send large messages, |
| 6859 | # and use large cert chains on both sides too (the long chains we have all use |
| 6860 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 6861 | # Sizes reached (UDP payload): |
| 6862 | # - 2037B for server certificate |
| 6863 | # - 1542B for client certificate |
| 6864 | # - 1013B for newsessionticket |
| 6865 | # - all others below 512B |
| 6866 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 6867 | |
| 6868 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6869 | requires_config_enabled MBEDTLS_RSA_C |
| 6870 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6871 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6872 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6873 | run_test "DTLS fragmenting: none (for reference)" \ |
| 6874 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6875 | crt_file=data_files/server7_int-ca.crt \ |
| 6876 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6877 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6878 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6879 | "$P_CLI dtls=1 debug_level=2 \ |
| 6880 | crt_file=data_files/server8_int-ca2.crt \ |
| 6881 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6882 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6883 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6884 | 0 \ |
| 6885 | -S "found fragmented DTLS handshake message" \ |
| 6886 | -C "found fragmented DTLS handshake message" \ |
| 6887 | -C "error" |
| 6888 | |
| 6889 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6890 | requires_config_enabled MBEDTLS_RSA_C |
| 6891 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6892 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6893 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6894 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6895 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6896 | crt_file=data_files/server7_int-ca.crt \ |
| 6897 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6898 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6899 | max_frag_len=1024" \ |
| 6900 | "$P_CLI dtls=1 debug_level=2 \ |
| 6901 | crt_file=data_files/server8_int-ca2.crt \ |
| 6902 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6903 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6904 | max_frag_len=2048" \ |
| 6905 | 0 \ |
| 6906 | -S "found fragmented DTLS handshake message" \ |
| 6907 | -c "found fragmented DTLS handshake message" \ |
| 6908 | -C "error" |
| 6909 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6910 | # With the MFL extension, the server has no way of forcing |
| 6911 | # the client to not exceed a certain MTU; hence, the following |
| 6912 | # test can't be replicated with an MTU proxy such as the one |
| 6913 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6914 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6915 | requires_config_enabled MBEDTLS_RSA_C |
| 6916 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6917 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6918 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6919 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6920 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6921 | crt_file=data_files/server7_int-ca.crt \ |
| 6922 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6923 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6924 | max_frag_len=512" \ |
| 6925 | "$P_CLI dtls=1 debug_level=2 \ |
| 6926 | crt_file=data_files/server8_int-ca2.crt \ |
| 6927 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6928 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6929 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6930 | 0 \ |
| 6931 | -S "found fragmented DTLS handshake message" \ |
| 6932 | -c "found fragmented DTLS handshake message" \ |
| 6933 | -C "error" |
| 6934 | |
| 6935 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6936 | requires_config_enabled MBEDTLS_RSA_C |
| 6937 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6938 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6939 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6940 | 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] | 6941 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6942 | crt_file=data_files/server7_int-ca.crt \ |
| 6943 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6944 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6945 | max_frag_len=2048" \ |
| 6946 | "$P_CLI dtls=1 debug_level=2 \ |
| 6947 | crt_file=data_files/server8_int-ca2.crt \ |
| 6948 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6949 | hs_timeout=2500-60000 \ |
| 6950 | max_frag_len=1024" \ |
| 6951 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6952 | -S "found fragmented DTLS handshake message" \ |
| 6953 | -c "found fragmented DTLS handshake message" \ |
| 6954 | -C "error" |
| 6955 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6956 | # While not required by the standard defining the MFL extension |
| 6957 | # (according to which it only applies to records, not to datagrams), |
| 6958 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6959 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6960 | # to the peer. |
| 6961 | # The next test checks that no datagrams significantly larger than the |
| 6962 | # negotiated MFL are sent. |
| 6963 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6964 | requires_config_enabled MBEDTLS_RSA_C |
| 6965 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6966 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6967 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6968 | 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] | 6969 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6970 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6971 | crt_file=data_files/server7_int-ca.crt \ |
| 6972 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6973 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6974 | max_frag_len=2048" \ |
| 6975 | "$P_CLI dtls=1 debug_level=2 \ |
| 6976 | crt_file=data_files/server8_int-ca2.crt \ |
| 6977 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6978 | hs_timeout=2500-60000 \ |
| 6979 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6980 | 0 \ |
| 6981 | -S "found fragmented DTLS handshake message" \ |
| 6982 | -c "found fragmented DTLS handshake message" \ |
| 6983 | -C "error" |
| 6984 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6985 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6986 | requires_config_enabled MBEDTLS_RSA_C |
| 6987 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6988 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6989 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6990 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6991 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6992 | crt_file=data_files/server7_int-ca.crt \ |
| 6993 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6994 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6995 | max_frag_len=2048" \ |
| 6996 | "$P_CLI dtls=1 debug_level=2 \ |
| 6997 | crt_file=data_files/server8_int-ca2.crt \ |
| 6998 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6999 | hs_timeout=2500-60000 \ |
| 7000 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7001 | 0 \ |
| 7002 | -s "found fragmented DTLS handshake message" \ |
| 7003 | -c "found fragmented DTLS handshake message" \ |
| 7004 | -C "error" |
| 7005 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7006 | # While not required by the standard defining the MFL extension |
| 7007 | # (according to which it only applies to records, not to datagrams), |
| 7008 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7009 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7010 | # to the peer. |
| 7011 | # The next test checks that no datagrams significantly larger than the |
| 7012 | # negotiated MFL are sent. |
| 7013 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7014 | requires_config_enabled MBEDTLS_RSA_C |
| 7015 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7016 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7017 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7018 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 7019 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7020 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7021 | crt_file=data_files/server7_int-ca.crt \ |
| 7022 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7023 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7024 | max_frag_len=2048" \ |
| 7025 | "$P_CLI dtls=1 debug_level=2 \ |
| 7026 | crt_file=data_files/server8_int-ca2.crt \ |
| 7027 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7028 | hs_timeout=2500-60000 \ |
| 7029 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7030 | 0 \ |
| 7031 | -s "found fragmented DTLS handshake message" \ |
| 7032 | -c "found fragmented DTLS handshake message" \ |
| 7033 | -C "error" |
| 7034 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7035 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7036 | requires_config_enabled MBEDTLS_RSA_C |
| 7037 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7038 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7039 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 7040 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7041 | crt_file=data_files/server7_int-ca.crt \ |
| 7042 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7043 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7044 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7045 | "$P_CLI dtls=1 debug_level=2 \ |
| 7046 | crt_file=data_files/server8_int-ca2.crt \ |
| 7047 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7048 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7049 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7050 | 0 \ |
| 7051 | -S "found fragmented DTLS handshake message" \ |
| 7052 | -C "found fragmented DTLS handshake message" \ |
| 7053 | -C "error" |
| 7054 | |
| 7055 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7056 | requires_config_enabled MBEDTLS_RSA_C |
| 7057 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7058 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7059 | run_test "DTLS fragmenting: client (MTU)" \ |
| 7060 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7061 | crt_file=data_files/server7_int-ca.crt \ |
| 7062 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7063 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7064 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7065 | "$P_CLI dtls=1 debug_level=2 \ |
| 7066 | crt_file=data_files/server8_int-ca2.crt \ |
| 7067 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7068 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7069 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7070 | 0 \ |
| 7071 | -s "found fragmented DTLS handshake message" \ |
| 7072 | -C "found fragmented DTLS handshake message" \ |
| 7073 | -C "error" |
| 7074 | |
| 7075 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7076 | requires_config_enabled MBEDTLS_RSA_C |
| 7077 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7078 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7079 | run_test "DTLS fragmenting: server (MTU)" \ |
| 7080 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7081 | crt_file=data_files/server7_int-ca.crt \ |
| 7082 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7083 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7084 | mtu=512" \ |
| 7085 | "$P_CLI dtls=1 debug_level=2 \ |
| 7086 | crt_file=data_files/server8_int-ca2.crt \ |
| 7087 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7088 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7089 | mtu=2048" \ |
| 7090 | 0 \ |
| 7091 | -S "found fragmented DTLS handshake message" \ |
| 7092 | -c "found fragmented DTLS handshake message" \ |
| 7093 | -C "error" |
| 7094 | |
| 7095 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7096 | requires_config_enabled MBEDTLS_RSA_C |
| 7097 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7098 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7099 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7100 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7101 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7102 | crt_file=data_files/server7_int-ca.crt \ |
| 7103 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7104 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 7105 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7106 | "$P_CLI dtls=1 debug_level=2 \ |
| 7107 | crt_file=data_files/server8_int-ca2.crt \ |
| 7108 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7109 | hs_timeout=2500-60000 \ |
| 7110 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7111 | 0 \ |
| 7112 | -s "found fragmented DTLS handshake message" \ |
| 7113 | -c "found fragmented DTLS handshake message" \ |
| 7114 | -C "error" |
| 7115 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7116 | # 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] | 7117 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7118 | requires_config_enabled MBEDTLS_RSA_C |
| 7119 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7120 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7121 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7122 | requires_config_enabled MBEDTLS_AES_C |
| 7123 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7124 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7125 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 7126 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7127 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7128 | crt_file=data_files/server7_int-ca.crt \ |
| 7129 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7130 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7131 | mtu=512" \ |
| 7132 | "$P_CLI dtls=1 debug_level=2 \ |
| 7133 | crt_file=data_files/server8_int-ca2.crt \ |
| 7134 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7135 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7136 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7137 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7138 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7139 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7140 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7141 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7142 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7143 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7144 | # 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] | 7145 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 7146 | # retransmissions, but in some cases (like both the server and client using |
| 7147 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 7148 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 7149 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7150 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7151 | requires_config_enabled MBEDTLS_RSA_C |
| 7152 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7153 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7154 | requires_config_enabled MBEDTLS_AES_C |
| 7155 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7156 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7157 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7158 | -p "$P_PXY mtu=508" \ |
| 7159 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7160 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7161 | key_file=data_files/server7.key \ |
| 7162 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7163 | "$P_CLI dtls=1 debug_level=2 \ |
| 7164 | crt_file=data_files/server8_int-ca2.crt \ |
| 7165 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7166 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7167 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7168 | 0 \ |
| 7169 | -s "found fragmented DTLS handshake message" \ |
| 7170 | -c "found fragmented DTLS handshake message" \ |
| 7171 | -C "error" |
| 7172 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7173 | # 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] | 7174 | only_with_valgrind |
| 7175 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7176 | requires_config_enabled MBEDTLS_RSA_C |
| 7177 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7178 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7179 | requires_config_enabled MBEDTLS_AES_C |
| 7180 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7181 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7182 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7183 | -p "$P_PXY mtu=508" \ |
| 7184 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7185 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7186 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7187 | hs_timeout=250-10000" \ |
| 7188 | "$P_CLI dtls=1 debug_level=2 \ |
| 7189 | crt_file=data_files/server8_int-ca2.crt \ |
| 7190 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7191 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7192 | hs_timeout=250-10000" \ |
| 7193 | 0 \ |
| 7194 | -s "found fragmented DTLS handshake message" \ |
| 7195 | -c "found fragmented DTLS handshake message" \ |
| 7196 | -C "error" |
| 7197 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7198 | # 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] | 7199 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7200 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7201 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7202 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7203 | requires_config_enabled MBEDTLS_RSA_C |
| 7204 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7205 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7206 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7207 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7208 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7209 | crt_file=data_files/server7_int-ca.crt \ |
| 7210 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7211 | hs_timeout=10000-60000 \ |
| 7212 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7213 | "$P_CLI dtls=1 debug_level=2 \ |
| 7214 | crt_file=data_files/server8_int-ca2.crt \ |
| 7215 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7216 | hs_timeout=10000-60000 \ |
| 7217 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7218 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7219 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7220 | -s "found fragmented DTLS handshake message" \ |
| 7221 | -c "found fragmented DTLS handshake message" \ |
| 7222 | -C "error" |
| 7223 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7224 | # 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] | 7225 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 7226 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7227 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7228 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7229 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7230 | requires_config_enabled MBEDTLS_RSA_C |
| 7231 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7232 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7233 | requires_config_enabled MBEDTLS_AES_C |
| 7234 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7235 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7236 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7237 | -p "$P_PXY mtu=512" \ |
| 7238 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7239 | crt_file=data_files/server7_int-ca.crt \ |
| 7240 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7241 | hs_timeout=10000-60000 \ |
| 7242 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7243 | "$P_CLI dtls=1 debug_level=2 \ |
| 7244 | crt_file=data_files/server8_int-ca2.crt \ |
| 7245 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7246 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7247 | hs_timeout=10000-60000 \ |
| 7248 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7249 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7250 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7251 | -s "found fragmented DTLS handshake message" \ |
| 7252 | -c "found fragmented DTLS handshake message" \ |
| 7253 | -C "error" |
| 7254 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7255 | not_with_valgrind # spurious autoreduction due to timeout |
| 7256 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7257 | requires_config_enabled MBEDTLS_RSA_C |
| 7258 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7259 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7260 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7261 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7262 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7263 | crt_file=data_files/server7_int-ca.crt \ |
| 7264 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7265 | hs_timeout=10000-60000 \ |
| 7266 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7267 | "$P_CLI dtls=1 debug_level=2 \ |
| 7268 | crt_file=data_files/server8_int-ca2.crt \ |
| 7269 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7270 | hs_timeout=10000-60000 \ |
| 7271 | mtu=1024 nbio=2" \ |
| 7272 | 0 \ |
| 7273 | -S "autoreduction" \ |
| 7274 | -s "found fragmented DTLS handshake message" \ |
| 7275 | -c "found fragmented DTLS handshake message" \ |
| 7276 | -C "error" |
| 7277 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7278 | # 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] | 7279 | not_with_valgrind # spurious autoreduction due to timeout |
| 7280 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7281 | requires_config_enabled MBEDTLS_RSA_C |
| 7282 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7283 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7284 | requires_config_enabled MBEDTLS_AES_C |
| 7285 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7286 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7287 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 7288 | -p "$P_PXY mtu=512" \ |
| 7289 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7290 | crt_file=data_files/server7_int-ca.crt \ |
| 7291 | key_file=data_files/server7.key \ |
| 7292 | hs_timeout=10000-60000 \ |
| 7293 | mtu=512 nbio=2" \ |
| 7294 | "$P_CLI dtls=1 debug_level=2 \ |
| 7295 | crt_file=data_files/server8_int-ca2.crt \ |
| 7296 | key_file=data_files/server8.key \ |
| 7297 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7298 | hs_timeout=10000-60000 \ |
| 7299 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7300 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7301 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7302 | -s "found fragmented DTLS handshake message" \ |
| 7303 | -c "found fragmented DTLS handshake message" \ |
| 7304 | -C "error" |
| 7305 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7306 | # 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] | 7307 | # This ensures things still work after session_reset(). |
| 7308 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7309 | # Since we don't support reading fragmented ClientHello yet, |
| 7310 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 7311 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7312 | # An autoreduction on the client-side might happen if the server is |
| 7313 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 7314 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7315 | # resumed listening, which would result in a spurious autoreduction. |
| 7316 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7317 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7318 | requires_config_enabled MBEDTLS_RSA_C |
| 7319 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7320 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7321 | requires_config_enabled MBEDTLS_AES_C |
| 7322 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7323 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7324 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 7325 | -p "$P_PXY mtu=1450" \ |
| 7326 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7327 | crt_file=data_files/server7_int-ca.crt \ |
| 7328 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7329 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7330 | mtu=1450" \ |
| 7331 | "$P_CLI dtls=1 debug_level=2 \ |
| 7332 | crt_file=data_files/server8_int-ca2.crt \ |
| 7333 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7334 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7335 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 7336 | 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] | 7337 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7338 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7339 | -s "found fragmented DTLS handshake message" \ |
| 7340 | -c "found fragmented DTLS handshake message" \ |
| 7341 | -C "error" |
| 7342 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7343 | # An autoreduction on the client-side might happen if the server is |
| 7344 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7345 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7346 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7347 | requires_config_enabled MBEDTLS_RSA_C |
| 7348 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7349 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7350 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7351 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7352 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7353 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7354 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 7355 | -p "$P_PXY mtu=512" \ |
| 7356 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7357 | crt_file=data_files/server7_int-ca.crt \ |
| 7358 | key_file=data_files/server7.key \ |
| 7359 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7360 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7361 | mtu=512" \ |
| 7362 | "$P_CLI dtls=1 debug_level=2 \ |
| 7363 | crt_file=data_files/server8_int-ca2.crt \ |
| 7364 | key_file=data_files/server8.key \ |
| 7365 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7366 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7367 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7368 | mtu=512" \ |
| 7369 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7370 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7371 | -s "found fragmented DTLS handshake message" \ |
| 7372 | -c "found fragmented DTLS handshake message" \ |
| 7373 | -C "error" |
| 7374 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7375 | # An autoreduction on the client-side might happen if the server is |
| 7376 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7377 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7378 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7379 | requires_config_enabled MBEDTLS_RSA_C |
| 7380 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7381 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7382 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7383 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7384 | requires_config_enabled MBEDTLS_AES_C |
| 7385 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7386 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7387 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 7388 | -p "$P_PXY mtu=512" \ |
| 7389 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7390 | crt_file=data_files/server7_int-ca.crt \ |
| 7391 | key_file=data_files/server7.key \ |
| 7392 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7393 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7394 | mtu=512" \ |
| 7395 | "$P_CLI dtls=1 debug_level=2 \ |
| 7396 | crt_file=data_files/server8_int-ca2.crt \ |
| 7397 | key_file=data_files/server8.key \ |
| 7398 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7399 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7400 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7401 | mtu=512" \ |
| 7402 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7403 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7404 | -s "found fragmented DTLS handshake message" \ |
| 7405 | -c "found fragmented DTLS handshake message" \ |
| 7406 | -C "error" |
| 7407 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7408 | # An autoreduction on the client-side might happen if the server is |
| 7409 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7410 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7411 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7412 | requires_config_enabled MBEDTLS_RSA_C |
| 7413 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7414 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7415 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7416 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7417 | requires_config_enabled MBEDTLS_AES_C |
| 7418 | requires_config_enabled MBEDTLS_CCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7419 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7420 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7421 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7422 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7423 | crt_file=data_files/server7_int-ca.crt \ |
| 7424 | key_file=data_files/server7.key \ |
| 7425 | exchanges=2 renegotiation=1 \ |
| 7426 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7427 | hs_timeout=10000-60000 \ |
| 7428 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7429 | "$P_CLI dtls=1 debug_level=2 \ |
| 7430 | crt_file=data_files/server8_int-ca2.crt \ |
| 7431 | key_file=data_files/server8.key \ |
| 7432 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7433 | hs_timeout=10000-60000 \ |
| 7434 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7435 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7436 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7437 | -s "found fragmented DTLS handshake message" \ |
| 7438 | -c "found fragmented DTLS handshake message" \ |
| 7439 | -C "error" |
| 7440 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7441 | # An autoreduction on the client-side might happen if the server is |
| 7442 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7443 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7444 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7445 | requires_config_enabled MBEDTLS_RSA_C |
| 7446 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7447 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7448 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7449 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7450 | requires_config_enabled MBEDTLS_AES_C |
| 7451 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7452 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7453 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7454 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7455 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7456 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7457 | crt_file=data_files/server7_int-ca.crt \ |
| 7458 | key_file=data_files/server7.key \ |
| 7459 | exchanges=2 renegotiation=1 \ |
| 7460 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7461 | hs_timeout=10000-60000 \ |
| 7462 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7463 | "$P_CLI dtls=1 debug_level=2 \ |
| 7464 | crt_file=data_files/server8_int-ca2.crt \ |
| 7465 | key_file=data_files/server8.key \ |
| 7466 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7467 | hs_timeout=10000-60000 \ |
| 7468 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7469 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7470 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7471 | -s "found fragmented DTLS handshake message" \ |
| 7472 | -c "found fragmented DTLS handshake message" \ |
| 7473 | -C "error" |
| 7474 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7475 | # An autoreduction on the client-side might happen if the server is |
| 7476 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7477 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7478 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7479 | requires_config_enabled MBEDTLS_RSA_C |
| 7480 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7481 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7482 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7483 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7484 | requires_config_enabled MBEDTLS_AES_C |
| 7485 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7486 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7487 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7488 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7489 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7490 | crt_file=data_files/server7_int-ca.crt \ |
| 7491 | key_file=data_files/server7.key \ |
| 7492 | exchanges=2 renegotiation=1 \ |
| 7493 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7494 | hs_timeout=10000-60000 \ |
| 7495 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7496 | "$P_CLI dtls=1 debug_level=2 \ |
| 7497 | crt_file=data_files/server8_int-ca2.crt \ |
| 7498 | key_file=data_files/server8.key \ |
| 7499 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7500 | hs_timeout=10000-60000 \ |
| 7501 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7502 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7503 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7504 | -s "found fragmented DTLS handshake message" \ |
| 7505 | -c "found fragmented DTLS handshake message" \ |
| 7506 | -C "error" |
| 7507 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7508 | # 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] | 7509 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7510 | requires_config_enabled MBEDTLS_RSA_C |
| 7511 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7512 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7513 | requires_config_enabled MBEDTLS_AES_C |
| 7514 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7515 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7516 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7517 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 7518 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7519 | "$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] | 7520 | crt_file=data_files/server7_int-ca.crt \ |
| 7521 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7522 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7523 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7524 | crt_file=data_files/server8_int-ca2.crt \ |
| 7525 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7526 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7527 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7528 | 0 \ |
| 7529 | -s "found fragmented DTLS handshake message" \ |
| 7530 | -c "found fragmented DTLS handshake message" \ |
| 7531 | -C "error" |
| 7532 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7533 | # 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] | 7534 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7535 | requires_config_enabled MBEDTLS_RSA_C |
| 7536 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7537 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7538 | requires_config_enabled MBEDTLS_AES_C |
| 7539 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7540 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7541 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7542 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 7543 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 7544 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7545 | crt_file=data_files/server7_int-ca.crt \ |
| 7546 | key_file=data_files/server7.key \ |
| 7547 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7548 | "$P_CLI dtls=1 debug_level=2 \ |
| 7549 | crt_file=data_files/server8_int-ca2.crt \ |
| 7550 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7551 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7552 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7553 | 0 \ |
| 7554 | -s "found fragmented DTLS handshake message" \ |
| 7555 | -c "found fragmented DTLS handshake message" \ |
| 7556 | -C "error" |
| 7557 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7558 | # interop tests for DTLS fragmentating with reliable connection |
| 7559 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7560 | # here and below we just want to test that the we fragment in a way that |
| 7561 | # pleases other implementations, so we don't need the peer to fragment |
| 7562 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7563 | requires_config_enabled MBEDTLS_RSA_C |
| 7564 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7565 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7566 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7567 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7568 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 7569 | "$G_SRV -u" \ |
| 7570 | "$P_CLI dtls=1 debug_level=2 \ |
| 7571 | crt_file=data_files/server8_int-ca2.crt \ |
| 7572 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7573 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7574 | 0 \ |
| 7575 | -c "fragmenting handshake message" \ |
| 7576 | -C "error" |
| 7577 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 7578 | # We use --insecure for the GnuTLS client because it expects |
| 7579 | # the hostname / IP it connects to to be the name used in the |
| 7580 | # certificate obtained from the server. Here, however, it |
| 7581 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 7582 | # as the server name in the certificate. This will make the |
| 7583 | # certifiate validation fail, but passing --insecure makes |
| 7584 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7585 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7586 | requires_config_enabled MBEDTLS_RSA_C |
| 7587 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7588 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7589 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 7590 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7591 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7592 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7593 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7594 | crt_file=data_files/server7_int-ca.crt \ |
| 7595 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7596 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7597 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7598 | 0 \ |
| 7599 | -s "fragmenting handshake message" |
| 7600 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7601 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7602 | requires_config_enabled MBEDTLS_RSA_C |
| 7603 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7604 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7605 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7606 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 7607 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7608 | "$P_CLI dtls=1 debug_level=2 \ |
| 7609 | crt_file=data_files/server8_int-ca2.crt \ |
| 7610 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7611 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7612 | 0 \ |
| 7613 | -c "fragmenting handshake message" \ |
| 7614 | -C "error" |
| 7615 | |
| 7616 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7617 | requires_config_enabled MBEDTLS_RSA_C |
| 7618 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7619 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7620 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7621 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 7622 | "$P_SRV dtls=1 debug_level=2 \ |
| 7623 | crt_file=data_files/server7_int-ca.crt \ |
| 7624 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7625 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7626 | "$O_CLI -dtls1_2" \ |
| 7627 | 0 \ |
| 7628 | -s "fragmenting handshake message" |
| 7629 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7630 | # interop tests for DTLS fragmentating with unreliable connection |
| 7631 | # |
| 7632 | # again we just want to test that the we fragment in a way that |
| 7633 | # pleases other implementations, so we don't need the peer to fragment |
| 7634 | requires_gnutls_next |
| 7635 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7636 | requires_config_enabled MBEDTLS_RSA_C |
| 7637 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7638 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7639 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7640 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7641 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 7642 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7643 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7644 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7645 | crt_file=data_files/server8_int-ca2.crt \ |
| 7646 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7647 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7648 | 0 \ |
| 7649 | -c "fragmenting handshake message" \ |
| 7650 | -C "error" |
| 7651 | |
| 7652 | requires_gnutls_next |
| 7653 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7654 | requires_config_enabled MBEDTLS_RSA_C |
| 7655 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7656 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7657 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7658 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7659 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 7660 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7661 | "$P_SRV dtls=1 debug_level=2 \ |
| 7662 | crt_file=data_files/server7_int-ca.crt \ |
| 7663 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7664 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 7665 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7666 | 0 \ |
| 7667 | -s "fragmenting handshake message" |
| 7668 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7669 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 7670 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7671 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7672 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 7673 | ## (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] | 7674 | skip_next_test |
| 7675 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7676 | requires_config_enabled MBEDTLS_RSA_C |
| 7677 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7678 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7679 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7680 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7681 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 7682 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7683 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7684 | "$P_CLI dtls=1 debug_level=2 \ |
| 7685 | crt_file=data_files/server8_int-ca2.crt \ |
| 7686 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7687 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7688 | 0 \ |
| 7689 | -c "fragmenting handshake message" \ |
| 7690 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7691 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7692 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7693 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7694 | requires_config_enabled MBEDTLS_RSA_C |
| 7695 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7696 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7697 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7698 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7699 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 7700 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7701 | "$P_SRV dtls=1 debug_level=2 \ |
| 7702 | crt_file=data_files/server7_int-ca.crt \ |
| 7703 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7704 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7705 | "$O_CLI -dtls1_2" \ |
| 7706 | 0 \ |
| 7707 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7708 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7709 | # Tests for DTLS-SRTP (RFC 5764) |
| 7710 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7711 | run_test "DTLS-SRTP all profiles supported" \ |
| 7712 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7713 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7714 | 0 \ |
| 7715 | -s "found use_srtp extension" \ |
| 7716 | -s "found srtp profile" \ |
| 7717 | -s "selected srtp profile" \ |
| 7718 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7719 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7720 | -c "client hello, adding use_srtp extension" \ |
| 7721 | -c "found use_srtp extension" \ |
| 7722 | -c "found srtp profile" \ |
| 7723 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7724 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7725 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7726 | -C "error" |
| 7727 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7728 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7729 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7730 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 7731 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7732 | "$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] | 7733 | 0 \ |
| 7734 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7735 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 7736 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7737 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7738 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7739 | -c "client hello, adding use_srtp extension" \ |
| 7740 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7741 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7742 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7743 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7744 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7745 | -C "error" |
| 7746 | |
| 7747 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7748 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7749 | "$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] | 7750 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7751 | 0 \ |
| 7752 | -s "found use_srtp extension" \ |
| 7753 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7754 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7755 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7756 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7757 | -c "client hello, adding use_srtp extension" \ |
| 7758 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7759 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7760 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7761 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7762 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7763 | -C "error" |
| 7764 | |
| 7765 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7766 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 7767 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7768 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7769 | 0 \ |
| 7770 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7771 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7772 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7773 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7774 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7775 | -c "client hello, adding use_srtp extension" \ |
| 7776 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7777 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7778 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7779 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7780 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7781 | -C "error" |
| 7782 | |
| 7783 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7784 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 7785 | "$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] | 7786 | "$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] | 7787 | 0 \ |
| 7788 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7789 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7790 | -S "selected srtp profile" \ |
| 7791 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7792 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7793 | -c "client hello, adding use_srtp extension" \ |
| 7794 | -C "found use_srtp extension" \ |
| 7795 | -C "found srtp profile" \ |
| 7796 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7797 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7798 | -C "error" |
| 7799 | |
| 7800 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7801 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 7802 | "$P_SRV dtls=1 debug_level=3" \ |
| 7803 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7804 | 0 \ |
| 7805 | -s "found use_srtp extension" \ |
| 7806 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7807 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7808 | -c "client hello, adding use_srtp extension" \ |
| 7809 | -C "found use_srtp extension" \ |
| 7810 | -C "found srtp profile" \ |
| 7811 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7812 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7813 | -C "error" |
| 7814 | |
| 7815 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7816 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 7817 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 7818 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7819 | 0 \ |
| 7820 | -s "found use_srtp extension" \ |
| 7821 | -s "found srtp profile" \ |
| 7822 | -s "selected srtp profile" \ |
| 7823 | -s "server hello, adding use_srtp extension" \ |
| 7824 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7825 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7826 | -c "client hello, adding use_srtp extension" \ |
| 7827 | -c "found use_srtp extension" \ |
| 7828 | -c "found srtp profile" \ |
| 7829 | -c "selected srtp profile" \ |
| 7830 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7831 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7832 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7833 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 7834 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7835 | -C "error" |
| 7836 | |
| 7837 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7838 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 7839 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7840 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7841 | 0 \ |
| 7842 | -s "found use_srtp extension" \ |
| 7843 | -s "found srtp profile" \ |
| 7844 | -s "selected srtp profile" \ |
| 7845 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7846 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 7847 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7848 | -S "dumping 'using mki' (8 bytes)" \ |
| 7849 | -c "client hello, adding use_srtp extension" \ |
| 7850 | -c "found use_srtp extension" \ |
| 7851 | -c "found srtp profile" \ |
| 7852 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7853 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 7854 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7855 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7856 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7857 | -C "dumping 'received mki' (8 bytes)" \ |
| 7858 | -C "error" |
| 7859 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7860 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 7861 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 7862 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7863 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7864 | 0 \ |
| 7865 | -s "found use_srtp extension" \ |
| 7866 | -s "found srtp profile" \ |
| 7867 | -s "selected srtp profile" \ |
| 7868 | -s "server hello, adding use_srtp extension" \ |
| 7869 | -s "DTLS-SRTP key material is"\ |
| 7870 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7871 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 7872 | |
| 7873 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7874 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 7875 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7876 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7877 | 0 \ |
| 7878 | -s "found use_srtp extension" \ |
| 7879 | -s "found srtp profile" \ |
| 7880 | -s "selected srtp profile" \ |
| 7881 | -s "server hello, adding use_srtp extension" \ |
| 7882 | -s "DTLS-SRTP key material is"\ |
| 7883 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7884 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7885 | |
| 7886 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7887 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 7888 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7889 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7890 | 0 \ |
| 7891 | -s "found use_srtp extension" \ |
| 7892 | -s "found srtp profile" \ |
| 7893 | -s "selected srtp profile" \ |
| 7894 | -s "server hello, adding use_srtp extension" \ |
| 7895 | -s "DTLS-SRTP key material is"\ |
| 7896 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7897 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7898 | |
| 7899 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7900 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 7901 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7902 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7903 | 0 \ |
| 7904 | -s "found use_srtp extension" \ |
| 7905 | -s "found srtp profile" \ |
| 7906 | -s "selected srtp profile" \ |
| 7907 | -s "server hello, adding use_srtp extension" \ |
| 7908 | -s "DTLS-SRTP key material is"\ |
| 7909 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7910 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7911 | |
| 7912 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7913 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 7914 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7915 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7916 | 0 \ |
| 7917 | -s "found use_srtp extension" \ |
| 7918 | -s "found srtp profile" \ |
| 7919 | -s "selected srtp profile" \ |
| 7920 | -s "server hello, adding use_srtp extension" \ |
| 7921 | -s "DTLS-SRTP key material is"\ |
| 7922 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7923 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7924 | |
| 7925 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7926 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 7927 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 7928 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7929 | 0 \ |
| 7930 | -s "found use_srtp extension" \ |
| 7931 | -s "found srtp profile" \ |
| 7932 | -S "selected srtp profile" \ |
| 7933 | -S "server hello, adding use_srtp extension" \ |
| 7934 | -S "DTLS-SRTP key material is"\ |
| 7935 | -C "SRTP Extension negotiated, profile" |
| 7936 | |
| 7937 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7938 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 7939 | "$P_SRV dtls=1 debug_level=3" \ |
| 7940 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7941 | 0 \ |
| 7942 | -s "found use_srtp extension" \ |
| 7943 | -S "server hello, adding use_srtp extension" \ |
| 7944 | -S "DTLS-SRTP key material is"\ |
| 7945 | -C "SRTP Extension negotiated, profile" |
| 7946 | |
| 7947 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7948 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 7949 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7950 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7951 | 0 \ |
| 7952 | -c "client hello, adding use_srtp extension" \ |
| 7953 | -c "found use_srtp extension" \ |
| 7954 | -c "found srtp profile" \ |
| 7955 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 7956 | -c "DTLS-SRTP key material is"\ |
| 7957 | -C "error" |
| 7958 | |
| 7959 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7960 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 7961 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7962 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7963 | 0 \ |
| 7964 | -c "client hello, adding use_srtp extension" \ |
| 7965 | -c "found use_srtp extension" \ |
| 7966 | -c "found srtp profile" \ |
| 7967 | -c "selected srtp profile" \ |
| 7968 | -c "DTLS-SRTP key material is"\ |
| 7969 | -C "error" |
| 7970 | |
| 7971 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7972 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 7973 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7974 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7975 | 0 \ |
| 7976 | -c "client hello, adding use_srtp extension" \ |
| 7977 | -c "found use_srtp extension" \ |
| 7978 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7979 | -c "selected srtp profile" \ |
| 7980 | -c "DTLS-SRTP key material is"\ |
| 7981 | -C "error" |
| 7982 | |
| 7983 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7984 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 7985 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7986 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7987 | 0 \ |
| 7988 | -c "client hello, adding use_srtp extension" \ |
| 7989 | -c "found use_srtp extension" \ |
| 7990 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7991 | -c "selected srtp profile" \ |
| 7992 | -c "DTLS-SRTP key material is"\ |
| 7993 | -C "error" |
| 7994 | |
| 7995 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7996 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 7997 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7998 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7999 | 0 \ |
| 8000 | -c "client hello, adding use_srtp extension" \ |
| 8001 | -c "found use_srtp extension" \ |
| 8002 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8003 | -c "selected srtp profile" \ |
| 8004 | -c "DTLS-SRTP key material is"\ |
| 8005 | -C "error" |
| 8006 | |
| 8007 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8008 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 8009 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8010 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 8011 | 0 \ |
| 8012 | -c "client hello, adding use_srtp extension" \ |
| 8013 | -C "found use_srtp extension" \ |
| 8014 | -C "found srtp profile" \ |
| 8015 | -C "selected srtp profile" \ |
| 8016 | -C "DTLS-SRTP key material is"\ |
| 8017 | -C "error" |
| 8018 | |
| 8019 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8020 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 8021 | "$O_SRV -dtls" \ |
| 8022 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8023 | 0 \ |
| 8024 | -c "client hello, adding use_srtp extension" \ |
| 8025 | -C "found use_srtp extension" \ |
| 8026 | -C "found srtp profile" \ |
| 8027 | -C "selected srtp profile" \ |
| 8028 | -C "DTLS-SRTP key material is"\ |
| 8029 | -C "error" |
| 8030 | |
| 8031 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8032 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 8033 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8034 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8035 | 0 \ |
| 8036 | -c "client hello, adding use_srtp extension" \ |
| 8037 | -c "found use_srtp extension" \ |
| 8038 | -c "found srtp profile" \ |
| 8039 | -c "selected srtp profile" \ |
| 8040 | -c "DTLS-SRTP key material is"\ |
| 8041 | -c "DTLS-SRTP no mki value negotiated"\ |
| 8042 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8043 | -C "dumping 'received mki' (8 bytes)" \ |
| 8044 | -C "error" |
| 8045 | |
| 8046 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8047 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8048 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8049 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8050 | "$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] | 8051 | 0 \ |
| 8052 | -s "found use_srtp extension" \ |
| 8053 | -s "found srtp profile" \ |
| 8054 | -s "selected srtp profile" \ |
| 8055 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8056 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8057 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 8058 | |
| 8059 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8060 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8061 | 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] | 8062 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8063 | "$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] | 8064 | 0 \ |
| 8065 | -s "found use_srtp extension" \ |
| 8066 | -s "found srtp profile" \ |
| 8067 | -s "selected srtp profile" \ |
| 8068 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8069 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8070 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 8071 | |
| 8072 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8073 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8074 | 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] | 8075 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8076 | "$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] | 8077 | 0 \ |
| 8078 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8079 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8080 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8081 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8082 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8083 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 8084 | |
| 8085 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8086 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8087 | 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] | 8088 | "$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] | 8089 | "$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] | 8090 | 0 \ |
| 8091 | -s "found use_srtp extension" \ |
| 8092 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8093 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8094 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8095 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8096 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 8097 | |
| 8098 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8099 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8100 | 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] | 8101 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8102 | "$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] | 8103 | 0 \ |
| 8104 | -s "found use_srtp extension" \ |
| 8105 | -s "found srtp profile" \ |
| 8106 | -s "selected srtp profile" \ |
| 8107 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8108 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8109 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 8110 | |
| 8111 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8112 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8113 | 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] | 8114 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 8115 | "$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] | 8116 | 0 \ |
| 8117 | -s "found use_srtp extension" \ |
| 8118 | -s "found srtp profile" \ |
| 8119 | -S "selected srtp profile" \ |
| 8120 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8121 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8122 | -C "SRTP profile:" |
| 8123 | |
| 8124 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8125 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8126 | 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] | 8127 | "$P_SRV dtls=1 debug_level=3" \ |
| 8128 | "$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] | 8129 | 0 \ |
| 8130 | -s "found use_srtp extension" \ |
| 8131 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8132 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8133 | -C "SRTP profile:" |
| 8134 | |
| 8135 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8136 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8137 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 8138 | "$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" \ |
| 8139 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8140 | 0 \ |
| 8141 | -c "client hello, adding use_srtp extension" \ |
| 8142 | -c "found use_srtp extension" \ |
| 8143 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8144 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8145 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8146 | -C "error" |
| 8147 | |
| 8148 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8149 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8150 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 8151 | "$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" \ |
| 8152 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8153 | 0 \ |
| 8154 | -c "client hello, adding use_srtp extension" \ |
| 8155 | -c "found use_srtp extension" \ |
| 8156 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8157 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8158 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8159 | -C "error" |
| 8160 | |
| 8161 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8162 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8163 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 8164 | "$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" \ |
| 8165 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8166 | 0 \ |
| 8167 | -c "client hello, adding use_srtp extension" \ |
| 8168 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8169 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8170 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8171 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8172 | -C "error" |
| 8173 | |
| 8174 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8175 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8176 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 8177 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8178 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8179 | 0 \ |
| 8180 | -c "client hello, adding use_srtp extension" \ |
| 8181 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8182 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8183 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8184 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8185 | -C "error" |
| 8186 | |
| 8187 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8188 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8189 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 8190 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8191 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8192 | 0 \ |
| 8193 | -c "client hello, adding use_srtp extension" \ |
| 8194 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8195 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8196 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8197 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8198 | -C "error" |
| 8199 | |
| 8200 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8201 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8202 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 8203 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8204 | "$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] | 8205 | 0 \ |
| 8206 | -c "client hello, adding use_srtp extension" \ |
| 8207 | -C "found use_srtp extension" \ |
| 8208 | -C "found srtp profile" \ |
| 8209 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8210 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8211 | -C "error" |
| 8212 | |
| 8213 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8214 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8215 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 8216 | "$G_SRV -u" \ |
| 8217 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8218 | 0 \ |
| 8219 | -c "client hello, adding use_srtp extension" \ |
| 8220 | -C "found use_srtp extension" \ |
| 8221 | -C "found srtp profile" \ |
| 8222 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8223 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8224 | -C "error" |
| 8225 | |
| 8226 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8227 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8228 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 8229 | "$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" \ |
| 8230 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8231 | 0 \ |
| 8232 | -c "client hello, adding use_srtp extension" \ |
| 8233 | -c "found use_srtp extension" \ |
| 8234 | -c "found srtp profile" \ |
| 8235 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8236 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 8237 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8238 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8239 | -c "dumping 'received mki' (8 bytes)" \ |
| 8240 | -C "error" |
| 8241 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 8242 | # Tests for specific things with "unreliable" UDP connection |
| 8243 | |
| 8244 | not_with_valgrind # spurious resend due to timeout |
| 8245 | run_test "DTLS proxy: reference" \ |
| 8246 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8247 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 8248 | "$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] | 8249 | 0 \ |
| 8250 | -C "replayed record" \ |
| 8251 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 8252 | -C "Buffer record from epoch" \ |
| 8253 | -S "Buffer record from epoch" \ |
| 8254 | -C "ssl_buffer_message" \ |
| 8255 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8256 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8257 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8258 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8259 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8260 | -c "HTTP/1.0 200 OK" |
| 8261 | |
| 8262 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8263 | run_test "DTLS proxy: duplicate every packet" \ |
| 8264 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8265 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 8266 | "$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] | 8267 | 0 \ |
| 8268 | -c "replayed record" \ |
| 8269 | -s "replayed record" \ |
| 8270 | -c "record from another epoch" \ |
| 8271 | -s "record from another epoch" \ |
| 8272 | -S "resend" \ |
| 8273 | -s "Extra-header:" \ |
| 8274 | -c "HTTP/1.0 200 OK" |
| 8275 | |
| 8276 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 8277 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8278 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 8279 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8280 | 0 \ |
| 8281 | -c "replayed record" \ |
| 8282 | -S "replayed record" \ |
| 8283 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8284 | -s "record from another epoch" \ |
| 8285 | -c "resend" \ |
| 8286 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8287 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8288 | -c "HTTP/1.0 200 OK" |
| 8289 | |
| 8290 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 8291 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8292 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8293 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8294 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8295 | -c "next record in same datagram" \ |
| 8296 | -s "next record in same datagram" |
| 8297 | |
| 8298 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 8299 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8300 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8301 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8302 | 0 \ |
| 8303 | -c "next record in same datagram" \ |
| 8304 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8305 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8306 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 8307 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8308 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 8309 | "$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] | 8310 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8311 | -c "discarding invalid record (mac)" \ |
| 8312 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8313 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8314 | -c "HTTP/1.0 200 OK" \ |
| 8315 | -S "too many records with bad MAC" \ |
| 8316 | -S "Verification of the message MAC failed" |
| 8317 | |
| 8318 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 8319 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8320 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 8321 | "$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] | 8322 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8323 | -C "discarding invalid record (mac)" \ |
| 8324 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8325 | -S "Extra-header:" \ |
| 8326 | -C "HTTP/1.0 200 OK" \ |
| 8327 | -s "too many records with bad MAC" \ |
| 8328 | -s "Verification of the message MAC failed" |
| 8329 | |
| 8330 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 8331 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8332 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 8333 | "$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] | 8334 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8335 | -c "discarding invalid record (mac)" \ |
| 8336 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8337 | -s "Extra-header:" \ |
| 8338 | -c "HTTP/1.0 200 OK" \ |
| 8339 | -S "too many records with bad MAC" \ |
| 8340 | -S "Verification of the message MAC failed" |
| 8341 | |
| 8342 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 8343 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8344 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 8345 | "$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] | 8346 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8347 | -c "discarding invalid record (mac)" \ |
| 8348 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8349 | -s "Extra-header:" \ |
| 8350 | -c "HTTP/1.0 200 OK" \ |
| 8351 | -s "too many records with bad MAC" \ |
| 8352 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8353 | |
| 8354 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 8355 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 8356 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 8357 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8358 | 0 \ |
| 8359 | -c "record from another epoch" \ |
| 8360 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8361 | -s "Extra-header:" \ |
| 8362 | -c "HTTP/1.0 200 OK" |
| 8363 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8364 | # Tests for reordering support with DTLS |
| 8365 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8366 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 8367 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8368 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8369 | hs_timeout=2500-60000" \ |
| 8370 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8371 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8372 | 0 \ |
| 8373 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8374 | -c "Next handshake message has been buffered - load"\ |
| 8375 | -S "Buffering HS message" \ |
| 8376 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8377 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8378 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8379 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8380 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8381 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8382 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 8383 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8384 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8385 | hs_timeout=2500-60000" \ |
| 8386 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8387 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8388 | 0 \ |
| 8389 | -c "Buffering HS message" \ |
| 8390 | -c "found fragmented DTLS handshake message"\ |
| 8391 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 8392 | -c "Next handshake message has been buffered - load"\ |
| 8393 | -S "Buffering HS message" \ |
| 8394 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8395 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8396 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8397 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8398 | -S "Remember CCS message" |
| 8399 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8400 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 8401 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 8402 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 8403 | # while keeping the ServerKeyExchange. |
| 8404 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 8405 | 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] | 8406 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8407 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8408 | hs_timeout=2500-60000" \ |
| 8409 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8410 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8411 | 0 \ |
| 8412 | -c "Buffering HS message" \ |
| 8413 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8414 | -C "attempt to make space by freeing buffered messages" \ |
| 8415 | -S "Buffering HS message" \ |
| 8416 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8417 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8418 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8419 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8420 | -S "Remember CCS message" |
| 8421 | |
| 8422 | # The size constraints ensure that the delayed certificate message can't |
| 8423 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 8424 | # when dropping it first. |
| 8425 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 8426 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 8427 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 8428 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8429 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8430 | hs_timeout=2500-60000" \ |
| 8431 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8432 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8433 | 0 \ |
| 8434 | -c "Buffering HS message" \ |
| 8435 | -c "attempt to make space by freeing buffered future messages" \ |
| 8436 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8437 | -S "Buffering HS message" \ |
| 8438 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8439 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8440 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8441 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8442 | -S "Remember CCS message" |
| 8443 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8444 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 8445 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8446 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 8447 | hs_timeout=2500-60000" \ |
| 8448 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8449 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8450 | 0 \ |
| 8451 | -C "Buffering HS message" \ |
| 8452 | -C "Next handshake message has been buffered - load"\ |
| 8453 | -s "Buffering HS message" \ |
| 8454 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8455 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8456 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8457 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8458 | -S "Remember CCS message" |
| 8459 | |
| 8460 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 8461 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8462 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8463 | hs_timeout=2500-60000" \ |
| 8464 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8465 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8466 | 0 \ |
| 8467 | -C "Buffering HS message" \ |
| 8468 | -C "Next handshake message has been buffered - load"\ |
| 8469 | -S "Buffering HS message" \ |
| 8470 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8471 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8472 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8473 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8474 | -S "Remember CCS message" |
| 8475 | |
| 8476 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 8477 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8478 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8479 | hs_timeout=2500-60000" \ |
| 8480 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8481 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8482 | 0 \ |
| 8483 | -C "Buffering HS message" \ |
| 8484 | -C "Next handshake message has been buffered - load"\ |
| 8485 | -S "Buffering HS message" \ |
| 8486 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8487 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8488 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8489 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8490 | -s "Remember CCS message" |
| 8491 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8492 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8493 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8494 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8495 | hs_timeout=2500-60000" \ |
| 8496 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8497 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 8498 | 0 \ |
| 8499 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8500 | -s "Found buffered record from current epoch - load" \ |
| 8501 | -c "Buffer record from epoch 1" \ |
| 8502 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8503 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8504 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 8505 | # from the server are delayed, so that the encrypted Finished message |
| 8506 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 8507 | # in afterwards, the encrypted Finished message must be freed in order |
| 8508 | # to make space for the NewSessionTicket to be reassembled. |
| 8509 | # This works only in very particular circumstances: |
| 8510 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 8511 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 8512 | # the encrypted Finished message. |
| 8513 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 8514 | # needs to be fragmented. |
| 8515 | # - All messages sent by the server must be small enough to be either sent |
| 8516 | # without fragmentation or be reassembled within the bounds of |
| 8517 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 8518 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 8519 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 8520 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8521 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 8522 | -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] | 8523 | "$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] | 8524 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 8525 | 0 \ |
| 8526 | -s "Buffer record from epoch 1" \ |
| 8527 | -s "Found buffered record from current epoch - load" \ |
| 8528 | -c "Buffer record from epoch 1" \ |
| 8529 | -C "Found buffered record from current epoch - load" \ |
| 8530 | -c "Enough space available after freeing future epoch record" |
| 8531 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 8532 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 8533 | |
| 8534 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8535 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 8536 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8537 | "$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] | 8538 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8539 | "$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] | 8540 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8541 | 0 \ |
| 8542 | -s "Extra-header:" \ |
| 8543 | -c "HTTP/1.0 200 OK" |
| 8544 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8545 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8546 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 8547 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8548 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8549 | "$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] | 8550 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8551 | 0 \ |
| 8552 | -s "Extra-header:" \ |
| 8553 | -c "HTTP/1.0 200 OK" |
| 8554 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8555 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8556 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 8557 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8558 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8559 | "$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] | 8560 | 0 \ |
| 8561 | -s "Extra-header:" \ |
| 8562 | -c "HTTP/1.0 200 OK" |
| 8563 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8564 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8565 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 8566 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8567 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 8568 | "$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] | 8569 | 0 \ |
| 8570 | -s "Extra-header:" \ |
| 8571 | -c "HTTP/1.0 200 OK" |
| 8572 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8573 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8574 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 8575 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8576 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 8577 | "$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] | 8578 | 0 \ |
| 8579 | -s "Extra-header:" \ |
| 8580 | -c "HTTP/1.0 200 OK" |
| 8581 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8582 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8583 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 8584 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8585 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 8586 | "$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] | 8587 | 0 \ |
| 8588 | -s "Extra-header:" \ |
| 8589 | -c "HTTP/1.0 200 OK" |
| 8590 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8591 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8592 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 8593 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8594 | "$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] | 8595 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8596 | "$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] | 8597 | 0 \ |
| 8598 | -s "Extra-header:" \ |
| 8599 | -c "HTTP/1.0 200 OK" |
| 8600 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8601 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 8602 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 8603 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8604 | "$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] | 8605 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8606 | "$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] | 8607 | 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] | 8608 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8609 | 0 \ |
| 8610 | -s "a session has been resumed" \ |
| 8611 | -c "a session has been resumed" \ |
| 8612 | -s "Extra-header:" \ |
| 8613 | -c "HTTP/1.0 200 OK" |
| 8614 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8615 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 8616 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 8617 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8618 | "$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] | 8619 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8620 | "$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] | 8621 | 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] | 8622 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 8623 | 0 \ |
| 8624 | -s "a session has been resumed" \ |
| 8625 | -c "a session has been resumed" \ |
| 8626 | -s "Extra-header:" \ |
| 8627 | -c "HTTP/1.0 200 OK" |
| 8628 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8629 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8630 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8631 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8632 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8633 | "$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] | 8634 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8635 | "$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] | 8636 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8637 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8638 | 0 \ |
| 8639 | -c "=> renegotiate" \ |
| 8640 | -s "=> renegotiate" \ |
| 8641 | -s "Extra-header:" \ |
| 8642 | -c "HTTP/1.0 200 OK" |
| 8643 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8644 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8645 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8646 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 8647 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8648 | "$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] | 8649 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8650 | "$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] | 8651 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8652 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8653 | 0 \ |
| 8654 | -c "=> renegotiate" \ |
| 8655 | -s "=> renegotiate" \ |
| 8656 | -s "Extra-header:" \ |
| 8657 | -c "HTTP/1.0 200 OK" |
| 8658 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8659 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8660 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8661 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 8662 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8663 | "$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] | 8664 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8665 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8666 | "$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] | 8667 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8668 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8669 | 0 \ |
| 8670 | -c "=> renegotiate" \ |
| 8671 | -s "=> renegotiate" \ |
| 8672 | -s "Extra-header:" \ |
| 8673 | -c "HTTP/1.0 200 OK" |
| 8674 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8675 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8676 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8677 | 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] | 8678 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8679 | "$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] | 8680 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8681 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8682 | "$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] | 8683 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8684 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8685 | 0 \ |
| 8686 | -c "=> renegotiate" \ |
| 8687 | -s "=> renegotiate" \ |
| 8688 | -s "Extra-header:" \ |
| 8689 | -c "HTTP/1.0 200 OK" |
| 8690 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8691 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 8692 | ## all versions installed on the CI machines), reported here: |
| 8693 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 8694 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8695 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 8696 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8697 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8698 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8699 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8700 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8701 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8702 | "$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] | 8703 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8704 | -c "HTTP/1.0 200 OK" |
| 8705 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8706 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8707 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8708 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8709 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 8710 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8711 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8712 | "$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] | 8713 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8714 | -c "HTTP/1.0 200 OK" |
| 8715 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8716 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8717 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8718 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8719 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 8720 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8721 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8722 | "$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] | 8723 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8724 | -c "HTTP/1.0 200 OK" |
| 8725 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 8726 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8727 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8728 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8729 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 8730 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 8731 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8732 | "$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] | 8733 | 0 \ |
| 8734 | -s "Extra-header:" \ |
| 8735 | -c "Extra-header:" |
| 8736 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8737 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8738 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8739 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8740 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 8741 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8742 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8743 | "$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] | 8744 | 0 \ |
| 8745 | -s "Extra-header:" \ |
| 8746 | -c "Extra-header:" |
| 8747 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8748 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8749 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8750 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8751 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 8752 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8753 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8754 | "$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] | 8755 | 0 \ |
| 8756 | -s "Extra-header:" \ |
| 8757 | -c "Extra-header:" |
| 8758 | |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8759 | run_test "export keys functionality" \ |
| 8760 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 8761 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 8762 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 8763 | -c "EAP-TLS key material is:"\ |
| 8764 | -s "EAP-TLS key material is:"\ |
| 8765 | -c "EAP-TLS IV is:" \ |
| 8766 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8767 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 8768 | # openssl feature tests: check if tls1.3 exists. |
| 8769 | requires_openssl_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 8770 | run_test "TLS 1.3: Test openssl tls1_3 feature" \ |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 8771 | "$O_NEXT_SRV -tls1_3 -msg" \ |
| 8772 | "$O_NEXT_CLI -tls1_3 -msg" \ |
| 8773 | 0 \ |
| 8774 | -c "TLS 1.3" \ |
| 8775 | -s "TLS 1.3" |
| 8776 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 8777 | # 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] | 8778 | requires_gnutls_tls1_3 |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 8779 | requires_gnutls_next_no_ticket |
| 8780 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 8781 | run_test "TLS 1.3: Test gnutls tls1_3 feature" \ |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 8782 | "$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] | 8783 | "$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] | 8784 | 0 \ |
| 8785 | -s "Version: TLS1.3" \ |
| 8786 | -c "Version: TLS1.3" |
| 8787 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 8788 | # TLS1.3 test cases |
| 8789 | # TODO: remove or rewrite this test case if #4832 is resolved. |
| 8790 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 8791 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 8792 | skip_handshake_stage_check |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 8793 | run_test "TLS 1.3: Not supported version check: tls12 and tls13" \ |
Xiaofei Bai | d25fab6 | 2021-12-02 06:36:27 +0000 | [diff] [blame] | 8794 | "$P_SRV debug_level=1 min_version=tls12 max_version=tls13" \ |
| 8795 | "$P_CLI debug_level=1 min_version=tls12 max_version=tls13" \ |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 8796 | 1 \ |
| 8797 | -s "SSL - The requested feature is not available" \ |
| 8798 | -c "SSL - The requested feature is not available" \ |
| 8799 | -s "Hybrid TLS 1.2 + TLS 1.3 configurations are not yet supported" \ |
| 8800 | -c "Hybrid TLS 1.2 + TLS 1.3 configurations are not yet supported" |
| 8801 | |
Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 8802 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 8803 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 8804 | run_test "TLS 1.3: handshake dispatch test: tls13 only" \ |
Xiaofei Bai | d25fab6 | 2021-12-02 06:36:27 +0000 | [diff] [blame] | 8805 | "$P_SRV debug_level=2 min_version=tls13 max_version=tls13" \ |
| 8806 | "$P_CLI debug_level=2 min_version=tls13 max_version=tls13" \ |
Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 8807 | 1 \ |
Jerry Yu | e3b3412 | 2021-09-28 17:53:35 +0800 | [diff] [blame] | 8808 | -s "tls13 server state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 8809 | -c "tls13 client state: MBEDTLS_SSL_HELLO_REQUEST" |
Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 8810 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 8811 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 8812 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 8813 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 8814 | requires_config_enabled MBEDTLS_DEBUG_C |
| 8815 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 42920ec | 2021-09-28 14:31:15 +0800 | [diff] [blame] | 8816 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 8817 | run_test "TLS 1.3: minimal feature sets - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 8818 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
Xiaofei Bai | d25fab6 | 2021-12-02 06:36:27 +0000 | [diff] [blame] | 8819 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 8820 | 0 \ |
Jerry Yu | cdcc55f | 2021-11-11 13:26:33 +0800 | [diff] [blame] | 8821 | -c "tls13 client state: MBEDTLS_SSL_HELLO_REQUEST(0)" \ |
| 8822 | -c "tls13 client state: MBEDTLS_SSL_SERVER_HELLO(2)" \ |
| 8823 | -c "tls13 client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS(19)" \ |
| 8824 | -c "tls13 client state: MBEDTLS_SSL_CERTIFICATE_REQUEST(5)" \ |
| 8825 | -c "tls13 client state: MBEDTLS_SSL_SERVER_CERTIFICATE(3)" \ |
| 8826 | -c "tls13 client state: MBEDTLS_SSL_CERTIFICATE_VERIFY(9)" \ |
| 8827 | -c "tls13 client state: MBEDTLS_SSL_SERVER_FINISHED(13)" \ |
| 8828 | -c "tls13 client state: MBEDTLS_SSL_CLIENT_FINISHED(11)" \ |
| 8829 | -c "tls13 client state: MBEDTLS_SSL_FLUSH_BUFFERS(14)" \ |
| 8830 | -c "tls13 client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP(15)" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 8831 | -c "<= ssl_tls13_process_server_hello" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 8832 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 8833 | -c "ECDH curve: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 8834 | -c "=> ssl_tls13_process_server_hello" \ |
Jerry Yu | daac359 | 2021-10-29 20:01:42 +0800 | [diff] [blame] | 8835 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 8836 | -c "Certificate verification flags clear" \ |
Jerry Yu | 5398c10 | 2021-11-05 13:32:38 +0800 | [diff] [blame] | 8837 | -c "=> parse certificate verify" \ |
| 8838 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 8839 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 8840 | -c "<= parse finished message" \ |
| 8841 | -c "HTTP/1.0 200 ok" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 8842 | |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 8843 | requires_gnutls_tls1_3 |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 8844 | requires_gnutls_next_no_ticket |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 8845 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 8846 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 8847 | requires_config_enabled MBEDTLS_DEBUG_C |
| 8848 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 42920ec | 2021-09-28 14:31:15 +0800 | [diff] [blame] | 8849 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 8850 | run_test "TLS 1.3: minimal feature sets - gnutls" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 8851 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --disable-client-cert" \ |
Xiaofei Bai | d25fab6 | 2021-12-02 06:36:27 +0000 | [diff] [blame] | 8852 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 8853 | 0 \ |
Jerry Yu | cdcc55f | 2021-11-11 13:26:33 +0800 | [diff] [blame] | 8854 | -s "SERVER HELLO was queued" \ |
| 8855 | -c "tls13 client state: MBEDTLS_SSL_HELLO_REQUEST(0)" \ |
| 8856 | -c "tls13 client state: MBEDTLS_SSL_SERVER_HELLO(2)" \ |
| 8857 | -c "tls13 client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS(19)" \ |
| 8858 | -c "tls13 client state: MBEDTLS_SSL_CERTIFICATE_REQUEST(5)" \ |
| 8859 | -c "tls13 client state: MBEDTLS_SSL_SERVER_CERTIFICATE(3)" \ |
| 8860 | -c "tls13 client state: MBEDTLS_SSL_CERTIFICATE_VERIFY(9)" \ |
| 8861 | -c "tls13 client state: MBEDTLS_SSL_SERVER_FINISHED(13)" \ |
| 8862 | -c "tls13 client state: MBEDTLS_SSL_CLIENT_FINISHED(11)" \ |
| 8863 | -c "tls13 client state: MBEDTLS_SSL_FLUSH_BUFFERS(14)" \ |
| 8864 | -c "tls13 client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP(15)" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 8865 | -c "<= ssl_tls13_process_server_hello" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 8866 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 8867 | -c "ECDH curve: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 8868 | -c "=> ssl_tls13_process_server_hello" \ |
Jerry Yu | daac359 | 2021-10-29 20:01:42 +0800 | [diff] [blame] | 8869 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 8870 | -c "Certificate verification flags clear" \ |
Jerry Yu | 5398c10 | 2021-11-05 13:32:38 +0800 | [diff] [blame] | 8871 | -c "=> parse certificate verify" \ |
| 8872 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 8873 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 8874 | -c "<= parse finished message" \ |
| 8875 | -c "HTTP/1.0 200 OK" |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 8876 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 8877 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 8878 | requires_config_enabled MBEDTLS_DEBUG_C |
| 8879 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 8880 | skip_handshake_stage_check |
| 8881 | requires_gnutls_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 8882 | run_test "TLS 1.3:Not supported version check:gnutls: srv max TLS 1.0" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 8883 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0 -d 4" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 8884 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 8885 | 1 \ |
| 8886 | -s "Client's version: 3.3" \ |
| 8887 | -c "is a fatal alert message (msg 40)" \ |
| 8888 | -S "Version: TLS1.0" \ |
| 8889 | -C "Protocol is TLSv1.0" |
| 8890 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 8891 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 8892 | requires_config_enabled MBEDTLS_DEBUG_C |
| 8893 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 8894 | skip_handshake_stage_check |
| 8895 | requires_gnutls_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 8896 | run_test "TLS 1.3:Not supported version check:gnutls: srv max TLS 1.1" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 8897 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1 -d 4" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 8898 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 8899 | 1 \ |
| 8900 | -s "Client's version: 3.3" \ |
| 8901 | -c "is a fatal alert message (msg 40)" \ |
| 8902 | -S "Version: TLS1.1" \ |
| 8903 | -C "Protocol is TLSv1.1" |
| 8904 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 8905 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 8906 | requires_config_enabled MBEDTLS_DEBUG_C |
| 8907 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 8908 | skip_handshake_stage_check |
| 8909 | requires_gnutls_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 8910 | run_test "TLS 1.3:Not supported version check:gnutls: srv max TLS 1.2" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 8911 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2 -d 4" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 8912 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 8913 | 1 \ |
| 8914 | -s "Client's version: 3.3" \ |
| 8915 | -c "is a fatal alert message (msg 40)" \ |
| 8916 | -S "Version: TLS1.2" \ |
| 8917 | -C "Protocol is TLSv1.2" |
| 8918 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 8919 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 8920 | requires_config_enabled MBEDTLS_DEBUG_C |
| 8921 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 8922 | skip_handshake_stage_check |
| 8923 | requires_openssl_next |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 8924 | run_test "TLS 1.3:Not supported version check:openssl: srv max TLS 1.0" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 8925 | "$O_NEXT_SRV -msg -tls1" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 8926 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 8927 | 1 \ |
| 8928 | -s "fatal protocol_version" \ |
| 8929 | -c "is a fatal alert message (msg 70)" \ |
| 8930 | -S "Version: TLS1.0" \ |
| 8931 | -C "Protocol : TLSv1.0" |
| 8932 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 8933 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 8934 | requires_config_enabled MBEDTLS_DEBUG_C |
| 8935 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 8936 | skip_handshake_stage_check |
| 8937 | requires_openssl_next |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 8938 | run_test "TLS 1.3:Not supported version check:openssl: srv max TLS 1.1" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 8939 | "$O_NEXT_SRV -msg -tls1_1" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 8940 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 8941 | 1 \ |
| 8942 | -s "fatal protocol_version" \ |
| 8943 | -c "is a fatal alert message (msg 70)" \ |
| 8944 | -S "Version: TLS1.1" \ |
| 8945 | -C "Protocol : TLSv1.1" |
| 8946 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 8947 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 8948 | requires_config_enabled MBEDTLS_DEBUG_C |
| 8949 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 8950 | skip_handshake_stage_check |
| 8951 | requires_openssl_next |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 8952 | run_test "TLS 1.3:Not supported version check:openssl: srv max TLS 1.2" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 8953 | "$O_NEXT_SRV -msg -tls1_2" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 8954 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 8955 | 1 \ |
| 8956 | -s "fatal protocol_version" \ |
| 8957 | -c "is a fatal alert message (msg 70)" \ |
| 8958 | -S "Version: TLS1.2" \ |
| 8959 | -C "Protocol : TLSv1.2" |
| 8960 | |
Jerry Yu | 936dffd | 2021-11-22 18:34:36 +0800 | [diff] [blame] | 8961 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 8962 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 8963 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 8964 | requires_config_enabled MBEDTLS_DEBUG_C |
| 8965 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 936dffd | 2021-11-22 18:34:36 +0800 | [diff] [blame] | 8966 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 8967 | run_test "TLS 1.3: CertificateRequest check - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 8968 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 8969 | "$P_CLI debug_level=4 force_version=tls13 " \ |
Jerry Yu | 936dffd | 2021-11-22 18:34:36 +0800 | [diff] [blame] | 8970 | 1 \ |
| 8971 | -c "CertificateRequest not supported" |
| 8972 | |
| 8973 | requires_gnutls_tls1_3 |
| 8974 | requires_gnutls_next_no_ticket |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 8975 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 8976 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 8977 | requires_config_enabled MBEDTLS_DEBUG_C |
| 8978 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 936dffd | 2021-11-22 18:34:36 +0800 | [diff] [blame] | 8979 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 8980 | run_test "TLS 1.3: CertificateRequest check - gnutls" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 8981 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 8982 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
Jerry Yu | 936dffd | 2021-11-22 18:34:36 +0800 | [diff] [blame] | 8983 | 1 \ |
| 8984 | -c "CertificateRequest not supported" |
| 8985 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 8986 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 8987 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 8988 | requires_config_enabled MBEDTLS_DEBUG_C |
| 8989 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 8990 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 8991 | requires_openssl_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 8992 | run_test "TLS 1.3: HelloRetryRequest check - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 8993 | "$O_NEXT_SRV -ciphersuites TLS_AES_256_GCM_SHA384 -sigalgs ecdsa_secp256r1_sha256 -groups P-256 -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 8994 | "$P_CLI debug_level=4 force_version=tls13" \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 8995 | 1 \ |
| 8996 | -c "received HelloRetryRequest message" \ |
| 8997 | -c "HRR not supported" \ |
| 8998 | -c "Last error was: -0x6E00 - SSL - The handshake negotiation failed" |
| 8999 | |
| 9000 | requires_gnutls_tls1_3 |
| 9001 | requires_gnutls_next_no_ticket |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9002 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9003 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9004 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9005 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 9006 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9007 | run_test "TLS 1.3: HelloRetryRequest check - gnutls" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9008 | "$G_NEXT_SRV -d 4 --priority=NONE:+GROUP-SECP256R1:+AES-256-GCM:+SHA384:+AEAD:+SIGN-ECDSA-SECP256R1-SHA256:+VERS-TLS1.3:%NO_TICKETS" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9009 | "$P_CLI debug_level=4 force_version=tls13" \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 9010 | 1 \ |
| 9011 | -c "received HelloRetryRequest message" \ |
| 9012 | -c "HRR not supported" \ |
| 9013 | -c "Last error was: -0x6E00 - SSL - The handshake negotiation failed" \ |
| 9014 | -s "HELLO RETRY REQUEST was queued" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9015 | |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 9016 | for i in $(ls opt-testcases/*.sh) |
| 9017 | do |
| 9018 | . $i |
| 9019 | done |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 9020 | |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9021 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9022 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9023 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9024 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9025 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9026 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 9027 | run_test "TLS 1.3 m->O both peers do not support middlebox compatibility" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9028 | "$O_NEXT_SRV -msg -tls1_3 -no_middlebox -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
| 9029 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
| 9030 | 0 \ |
| 9031 | -c "HTTP/1.0 200 ok" |
| 9032 | |
| 9033 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9034 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9035 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9036 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9037 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9038 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 9039 | run_test "TLS 1.3 m->O server with middlebox compat support, not client" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9040 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
| 9041 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
| 9042 | 1 \ |
| 9043 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 9044 | |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 9045 | requires_gnutls_tls1_3 |
| 9046 | requires_gnutls_next_no_ticket |
| 9047 | requires_gnutls_next_disable_tls13_compat |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9048 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 9049 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 9050 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9051 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 9052 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9053 | run_test "TLS 1.3 m->G both peers do not support middlebox compatibility" \ |
| 9054 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE --disable-client-cert" \ |
| 9055 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
| 9056 | 0 \ |
| 9057 | -c "HTTP/1.0 200 OK" |
| 9058 | |
| 9059 | requires_gnutls_tls1_3 |
| 9060 | requires_gnutls_next_no_ticket |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9061 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 9062 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 9063 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9064 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 9065 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9066 | run_test "TLS 1.3 m->G server with middlebox compat support, not client" \ |
| 9067 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --disable-client-cert" \ |
| 9068 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
| 9069 | 1 \ |
| 9070 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 9071 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 9072 | # Test heap memory usage after handshake |
| 9073 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 9074 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 9075 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9076 | requires_max_content_len 16384 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 9077 | run_tests_memory_after_hanshake |
| 9078 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 9079 | # Final report |
| 9080 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9081 | echo "------------------------------------------------------------------------" |
| 9082 | |
| 9083 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 9084 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9085 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 9086 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9087 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 9088 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 9089 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9090 | |
| 9091 | exit $FAILS |