| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1 | #!/bin/sh | 
|  | 2 |  | 
| Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 3 | # ssl-opt.sh | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 4 | # | 
| Bence Szépkúti | 1e14827 | 2020-08-07 13:07:28 +0200 | [diff] [blame] | 5 | # Copyright The Mbed TLS Contributors | 
| Bence Szépkúti | c7da1fe | 2020-05-26 01:54:15 +0200 | [diff] [blame] | 6 | # SPDX-License-Identifier: Apache-2.0 | 
|  | 7 | # | 
|  | 8 | # Licensed under the Apache License, Version 2.0 (the "License"); you may | 
|  | 9 | # not use this file except in compliance with the License. | 
|  | 10 | # You may obtain a copy of the License at | 
|  | 11 | # | 
|  | 12 | # http://www.apache.org/licenses/LICENSE-2.0 | 
|  | 13 | # | 
|  | 14 | # Unless required by applicable law or agreed to in writing, software | 
|  | 15 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | 
|  | 16 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
|  | 17 | # See the License for the specific language governing permissions and | 
|  | 18 | # limitations under the License. | 
|  | 19 | # | 
| Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 20 | # Purpose | 
|  | 21 | # | 
|  | 22 | # Executes tests to prove various TLS/SSL options and extensions. | 
|  | 23 | # | 
|  | 24 | # The goal is not to cover every ciphersuite/version, but instead to cover | 
|  | 25 | # specific options (max fragment length, truncated hmac, etc) or procedures | 
|  | 26 | # (session resumption from cache or ticket, renego, etc). | 
|  | 27 | # | 
|  | 28 | # The tests assume a build with default options, with exceptions expressed | 
|  | 29 | # with a dependency.  The tests focus on functionality and do not consider | 
|  | 30 | # performance. | 
|  | 31 | # | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 32 |  | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 33 | set -u | 
|  | 34 |  | 
| Jaeden Amero | 6e70eb2 | 2019-07-03 13:51:04 +0100 | [diff] [blame] | 35 | # Limit the size of each log to 10 GiB, in case of failures with this script | 
|  | 36 | # where it may output seemingly unlimited length error logs. | 
|  | 37 | ulimit -f 20971520 | 
|  | 38 |  | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 39 | ORIGINAL_PWD=$PWD | 
|  | 40 | if ! cd "$(dirname "$0")"; then | 
|  | 41 | exit 125 | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 42 | fi | 
|  | 43 |  | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 44 | # default values, can be overridden by the environment | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 45 | : ${P_SRV:=../programs/ssl/ssl_server2} | 
|  | 46 | : ${P_CLI:=../programs/ssl/ssl_client2} | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 47 | : ${P_PXY:=../programs/test/udp_proxy} | 
| Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 48 | : ${OPENSSL_CMD:=openssl} # OPENSSL would conflict with the build system | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 49 | : ${GNUTLS_CLI:=gnutls-cli} | 
|  | 50 | : ${GNUTLS_SERV:=gnutls-serv} | 
| Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 51 | : ${PERL:=perl} | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 52 |  | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 53 | guess_config_name() { | 
| Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 54 | if git diff --quiet ../include/mbedtls/mbedtls_config.h 2>/dev/null; then | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 55 | echo "default" | 
|  | 56 | else | 
|  | 57 | echo "unknown" | 
|  | 58 | fi | 
|  | 59 | } | 
|  | 60 | : ${MBEDTLS_TEST_OUTCOME_FILE=} | 
|  | 61 | : ${MBEDTLS_TEST_CONFIGURATION:="$(guess_config_name)"} | 
|  | 62 | : ${MBEDTLS_TEST_PLATFORM:="$(uname -s | tr -c \\n0-9A-Za-z _)-$(uname -m | tr -c \\n0-9A-Za-z _)"} | 
|  | 63 |  | 
| Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 64 | O_SRV="$OPENSSL_CMD s_server -www -cert data_files/server5.crt -key data_files/server5.key" | 
| Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 65 | O_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_CMD s_client" | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 66 | G_SRV="$GNUTLS_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 67 | G_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_CLI --x509cafile data_files/test-ca_cat12.crt" | 
| Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 68 | TCP_CLIENT="$PERL scripts/tcp_client.pl" | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 69 |  | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 70 | # alternative versions of OpenSSL and GnuTLS (no default path) | 
|  | 71 |  | 
|  | 72 | if [ -n "${OPENSSL_LEGACY:-}" ]; then | 
|  | 73 | O_LEGACY_SRV="$OPENSSL_LEGACY s_server -www -cert data_files/server5.crt -key data_files/server5.key" | 
|  | 74 | O_LEGACY_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_LEGACY s_client" | 
|  | 75 | else | 
|  | 76 | O_LEGACY_SRV=false | 
|  | 77 | O_LEGACY_CLI=false | 
|  | 78 | fi | 
|  | 79 |  | 
| Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 80 | if [ -n "${OPENSSL_NEXT:-}" ]; then | 
|  | 81 | O_NEXT_SRV="$OPENSSL_NEXT s_server -www -cert data_files/server5.crt -key data_files/server5.key" | 
|  | 82 | O_NEXT_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_NEXT s_client" | 
|  | 83 | else | 
|  | 84 | O_NEXT_SRV=false | 
|  | 85 | O_NEXT_CLI=false | 
|  | 86 | fi | 
|  | 87 |  | 
| Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 88 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 89 | G_NEXT_SRV="$GNUTLS_NEXT_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" | 
|  | 90 | else | 
|  | 91 | G_NEXT_SRV=false | 
|  | 92 | fi | 
|  | 93 |  | 
| Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 94 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 95 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile data_files/test-ca_cat12.crt" | 
|  | 96 | else | 
|  | 97 | G_NEXT_CLI=false | 
|  | 98 | fi | 
|  | 99 |  | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 100 | TESTS=0 | 
|  | 101 | FAILS=0 | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 102 | SKIPS=0 | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 103 |  | 
| Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 104 | CONFIG_H='../include/mbedtls/mbedtls_config.h' | 
| Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 105 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 106 | MEMCHECK=0 | 
| Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 107 | FILTER='.*' | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 108 | EXCLUDE='^$' | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 109 |  | 
| Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 110 | SHOW_TEST_NUMBER=0 | 
| Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 111 | RUN_TEST_NUMBER='' | 
|  | 112 |  | 
| Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 113 | PRESERVE_LOGS=0 | 
|  | 114 |  | 
| Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 115 | # Pick a "unique" server port in the range 10000-19999, and a proxy | 
|  | 116 | # port which is this plus 10000. Each port number may be independently | 
|  | 117 | # overridden by a command line option. | 
|  | 118 | SRV_PORT=$(($$ % 10000 + 10000)) | 
|  | 119 | PXY_PORT=$((SRV_PORT + 10000)) | 
|  | 120 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 121 | print_usage() { | 
|  | 122 | echo "Usage: $0 [options]" | 
| Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 123 | printf "  -h|--help\tPrint this help.\n" | 
|  | 124 | printf "  -m|--memcheck\tCheck memory leaks and errors.\n" | 
| Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 125 | printf "  -f|--filter\tOnly matching tests are executed (substring or BRE)\n" | 
|  | 126 | printf "  -e|--exclude\tMatching tests are excluded (substring or BRE)\n" | 
| Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 127 | 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] | 128 | 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] | 129 | printf "  -p|--preserve-logs\tPreserve logs of successful tests as well\n" | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 130 | printf "     --outcome-file\tFile where test outcomes are written\n" | 
|  | 131 | printf "                \t(default: \$MBEDTLS_TEST_OUTCOME_FILE, none if empty)\n" | 
|  | 132 | printf "     --port     \tTCP/UDP port (default: randomish 1xxxx)\n" | 
| Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 133 | printf "     --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 134 | 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] | 135 | } | 
|  | 136 |  | 
|  | 137 | get_options() { | 
|  | 138 | while [ $# -gt 0 ]; do | 
|  | 139 | case "$1" in | 
| Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 140 | -f|--filter) | 
|  | 141 | shift; FILTER=$1 | 
|  | 142 | ;; | 
|  | 143 | -e|--exclude) | 
|  | 144 | shift; EXCLUDE=$1 | 
|  | 145 | ;; | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 146 | -m|--memcheck) | 
|  | 147 | MEMCHECK=1 | 
|  | 148 | ;; | 
| Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 149 | -n|--number) | 
|  | 150 | shift; RUN_TEST_NUMBER=$1 | 
|  | 151 | ;; | 
| Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 152 | -s|--show-numbers) | 
|  | 153 | SHOW_TEST_NUMBER=1 | 
|  | 154 | ;; | 
| Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 155 | -p|--preserve-logs) | 
|  | 156 | PRESERVE_LOGS=1 | 
|  | 157 | ;; | 
| Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 158 | --port) | 
|  | 159 | shift; SRV_PORT=$1 | 
|  | 160 | ;; | 
|  | 161 | --proxy-port) | 
|  | 162 | shift; PXY_PORT=$1 | 
|  | 163 | ;; | 
| Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 164 | --seed) | 
|  | 165 | shift; SEED="$1" | 
|  | 166 | ;; | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 167 | -h|--help) | 
|  | 168 | print_usage | 
|  | 169 | exit 0 | 
|  | 170 | ;; | 
|  | 171 | *) | 
| Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 172 | echo "Unknown argument: '$1'" | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 173 | print_usage | 
|  | 174 | exit 1 | 
|  | 175 | ;; | 
|  | 176 | esac | 
|  | 177 | shift | 
|  | 178 | done | 
|  | 179 | } | 
|  | 180 |  | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 181 | # Make the outcome file path relative to the original directory, not | 
|  | 182 | # to .../tests | 
|  | 183 | case "$MBEDTLS_TEST_OUTCOME_FILE" in | 
|  | 184 | [!/]*) | 
|  | 185 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" | 
|  | 186 | ;; | 
|  | 187 | esac | 
|  | 188 |  | 
| Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 189 | # Read boolean configuration options from mbedtls_config.h for easy and quick | 
| Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 190 | # testing. Skip non-boolean options (with something other than spaces | 
|  | 191 | # and a comment after "#define SYMBOL"). The variable contains a | 
|  | 192 | # space-separated list of symbols. | 
|  | 193 | CONFIGS_ENABLED=" $(<"$CONFIG_H" \ | 
|  | 194 | sed -n 's!^ *#define  *\([A-Za-z][0-9A-Z_a-z]*\) *\(/*\)*!\1!p' | | 
|  | 195 | tr '\n' ' ')" | 
|  | 196 |  | 
| Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 197 | # Skip next test; use this macro to skip tests which are legitimate | 
|  | 198 | # in theory and expected to be re-introduced at some point, but | 
|  | 199 | # aren't expected to succeed at the moment due to problems outside | 
|  | 200 | # our control (such as bugs in other TLS implementations). | 
|  | 201 | skip_next_test() { | 
|  | 202 | SKIP_NEXT="YES" | 
|  | 203 | } | 
|  | 204 |  | 
| Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 205 | # 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] | 206 | requires_config_enabled() { | 
| Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 207 | case $CONFIGS_ENABLED in | 
|  | 208 | *" $1 "*) :;; | 
|  | 209 | *) SKIP_NEXT="YES";; | 
|  | 210 | esac | 
| Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 211 | } | 
|  | 212 |  | 
| Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 213 | # 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] | 214 | requires_config_disabled() { | 
| Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 215 | case $CONFIGS_ENABLED in | 
|  | 216 | *" $1 "*) SKIP_NEXT="YES";; | 
|  | 217 | esac | 
| Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 218 | } | 
|  | 219 |  | 
| Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 220 | get_config_value_or_default() { | 
| Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 221 | # This function uses the query_config command line option to query the | 
|  | 222 | # required Mbed TLS compile time configuration from the ssl_server2 | 
|  | 223 | # program. The command will always return a success value if the | 
|  | 224 | # configuration is defined and the value will be printed to stdout. | 
|  | 225 | # | 
|  | 226 | # Note that if the configuration is not defined or is defined to nothing, | 
|  | 227 | # the output of this function will be an empty string. | 
|  | 228 | ${P_SRV} "query_config=${1}" | 
| Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 229 | } | 
|  | 230 |  | 
|  | 231 | requires_config_value_at_least() { | 
| Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 232 | VAL="$( get_config_value_or_default "$1" )" | 
|  | 233 | if [ -z "$VAL" ]; then | 
|  | 234 | # Should never happen | 
|  | 235 | echo "Mbed TLS configuration $1 is not defined" | 
|  | 236 | exit 1 | 
|  | 237 | elif [ "$VAL" -lt "$2" ]; then | 
| Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 238 | SKIP_NEXT="YES" | 
|  | 239 | fi | 
|  | 240 | } | 
|  | 241 |  | 
|  | 242 | requires_config_value_at_most() { | 
| Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 243 | VAL=$( get_config_value_or_default "$1" ) | 
| Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 244 | if [ -z "$VAL" ]; then | 
|  | 245 | # Should never happen | 
|  | 246 | echo "Mbed TLS configuration $1 is not defined" | 
|  | 247 | exit 1 | 
|  | 248 | elif [ "$VAL" -gt "$2" ]; then | 
| Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 249 | SKIP_NEXT="YES" | 
|  | 250 | fi | 
|  | 251 | } | 
|  | 252 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 253 | requires_config_value_equals() { | 
|  | 254 | VAL=$( get_config_value_or_default "$1" ) | 
|  | 255 | if [ -z "$VAL" ]; then | 
|  | 256 | # Should never happen | 
|  | 257 | echo "Mbed TLS configuration $1 is not defined" | 
|  | 258 | exit 1 | 
|  | 259 | elif [ "$VAL" -ne "$2" ]; then | 
|  | 260 | SKIP_NEXT="YES" | 
|  | 261 | fi | 
|  | 262 | } | 
|  | 263 |  | 
| Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 264 | # Space-separated list of ciphersuites supported by this build of | 
|  | 265 | # Mbed TLS. | 
|  | 266 | P_CIPHERSUITES=" $($P_CLI --help 2>/dev/null | | 
|  | 267 | grep TLS- | | 
|  | 268 | tr -s ' \n' ' ')" | 
| Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 269 | requires_ciphersuite_enabled() { | 
| Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 270 | case $P_CIPHERSUITES in | 
|  | 271 | *" $1 "*) :;; | 
|  | 272 | *) SKIP_NEXT="YES";; | 
|  | 273 | esac | 
| Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 274 | } | 
|  | 275 |  | 
| Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 276 | # maybe_requires_ciphersuite_enabled CMD [RUN_TEST_OPTION...] | 
|  | 277 | # If CMD (call to a TLS client or server program) requires a specific | 
|  | 278 | # ciphersuite, arrange to only run the test case if this ciphersuite is | 
| Dave Rodgman | c424098 | 2021-06-29 19:53:16 +0100 | [diff] [blame] | 279 | # enabled. | 
| Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 280 | maybe_requires_ciphersuite_enabled() { | 
|  | 281 | case "$1" in | 
|  | 282 | *\ force_ciphersuite=*) :;; | 
|  | 283 | *) return;; # No specific required ciphersuite | 
|  | 284 | esac | 
|  | 285 | ciphersuite="${1##*\ force_ciphersuite=}" | 
|  | 286 | ciphersuite="${ciphersuite%%[!-0-9A-Z_a-z]*}" | 
|  | 287 | shift | 
|  | 288 |  | 
| Dave Rodgman | c424098 | 2021-06-29 19:53:16 +0100 | [diff] [blame] | 289 | requires_ciphersuite_enabled "$ciphersuite" | 
| Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 290 |  | 
|  | 291 | unset ciphersuite | 
|  | 292 | } | 
|  | 293 |  | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 294 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV | 
|  | 295 | requires_openssl_with_fallback_scsv() { | 
|  | 296 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then | 
|  | 297 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null | 
|  | 298 | then | 
|  | 299 | OPENSSL_HAS_FBSCSV="YES" | 
|  | 300 | else | 
|  | 301 | OPENSSL_HAS_FBSCSV="NO" | 
|  | 302 | fi | 
|  | 303 | fi | 
|  | 304 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then | 
|  | 305 | SKIP_NEXT="YES" | 
|  | 306 | fi | 
|  | 307 | } | 
|  | 308 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 309 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value | 
|  | 310 | requires_max_content_len() { | 
|  | 311 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 | 
|  | 312 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 | 
|  | 313 | } | 
|  | 314 |  | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 315 | # skip next test if GnuTLS isn't available | 
|  | 316 | requires_gnutls() { | 
|  | 317 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then | 
| Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 318 | 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] | 319 | GNUTLS_AVAILABLE="YES" | 
|  | 320 | else | 
|  | 321 | GNUTLS_AVAILABLE="NO" | 
|  | 322 | fi | 
|  | 323 | fi | 
|  | 324 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then | 
|  | 325 | SKIP_NEXT="YES" | 
|  | 326 | fi | 
|  | 327 | } | 
|  | 328 |  | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 329 | # skip next test if GnuTLS-next isn't available | 
|  | 330 | requires_gnutls_next() { | 
|  | 331 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then | 
|  | 332 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then | 
|  | 333 | GNUTLS_NEXT_AVAILABLE="YES" | 
|  | 334 | else | 
|  | 335 | GNUTLS_NEXT_AVAILABLE="NO" | 
|  | 336 | fi | 
|  | 337 | fi | 
|  | 338 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then | 
|  | 339 | SKIP_NEXT="YES" | 
|  | 340 | fi | 
|  | 341 | } | 
|  | 342 |  | 
|  | 343 | # skip next test if OpenSSL-legacy isn't available | 
|  | 344 | requires_openssl_legacy() { | 
|  | 345 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then | 
|  | 346 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then | 
|  | 347 | OPENSSL_LEGACY_AVAILABLE="YES" | 
|  | 348 | else | 
|  | 349 | OPENSSL_LEGACY_AVAILABLE="NO" | 
|  | 350 | fi | 
|  | 351 | fi | 
|  | 352 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then | 
|  | 353 | SKIP_NEXT="YES" | 
|  | 354 | fi | 
|  | 355 | } | 
|  | 356 |  | 
| Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 357 | requires_openssl_next() { | 
|  | 358 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then | 
|  | 359 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then | 
|  | 360 | OPENSSL_NEXT_AVAILABLE="YES" | 
|  | 361 | else | 
|  | 362 | OPENSSL_NEXT_AVAILABLE="NO" | 
|  | 363 | fi | 
|  | 364 | fi | 
|  | 365 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then | 
|  | 366 | SKIP_NEXT="YES" | 
|  | 367 | fi | 
|  | 368 | } | 
|  | 369 |  | 
|  | 370 | # skip next test if tls1_3 is not available | 
|  | 371 | requires_openssl_tls1_3() { | 
|  | 372 | requires_openssl_next | 
|  | 373 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then | 
|  | 374 | OPENSSL_TLS1_3_AVAILABLE="NO" | 
|  | 375 | fi | 
|  | 376 | if [ -z "${OPENSSL_TLS1_3_AVAILABLE:-}" ]; then | 
|  | 377 | if $OPENSSL_NEXT s_client -help 2>&1 | grep tls1_3 >/dev/null | 
|  | 378 | then | 
|  | 379 | OPENSSL_TLS1_3_AVAILABLE="YES" | 
|  | 380 | else | 
|  | 381 | OPENSSL_TLS1_3_AVAILABLE="NO" | 
|  | 382 | fi | 
|  | 383 | fi | 
|  | 384 | if [ "$OPENSSL_TLS1_3_AVAILABLE" = "NO" ]; then | 
|  | 385 | SKIP_NEXT="YES" | 
|  | 386 | fi | 
|  | 387 | } | 
|  | 388 |  | 
|  | 389 | # skip next test if tls1_3 is not available | 
|  | 390 | requires_gnutls_tls1_3() { | 
|  | 391 | requires_gnutls_next | 
|  | 392 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then | 
|  | 393 | GNUTLS_TLS1_3_AVAILABLE="NO" | 
|  | 394 | fi | 
|  | 395 | if [ -z "${GNUTLS_TLS1_3_AVAILABLE:-}" ]; then | 
|  | 396 | if $GNUTLS_NEXT_CLI -l 2>&1 | grep VERS-TLS1.3 >/dev/null | 
|  | 397 | then | 
|  | 398 | GNUTLS_TLS1_3_AVAILABLE="YES" | 
|  | 399 | else | 
|  | 400 | GNUTLS_TLS1_3_AVAILABLE="NO" | 
|  | 401 | fi | 
|  | 402 | fi | 
|  | 403 | if [ "$GNUTLS_TLS1_3_AVAILABLE" = "NO" ]; then | 
|  | 404 | SKIP_NEXT="YES" | 
|  | 405 | fi | 
|  | 406 | } | 
|  | 407 |  | 
| Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 408 | # Check %NO_TICKETS option | 
| Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 409 | requires_gnutls_next_no_ticket() { | 
|  | 410 | requires_gnutls_next | 
|  | 411 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then | 
|  | 412 | GNUTLS_NO_TICKETS_AVAILABLE="NO" | 
|  | 413 | fi | 
|  | 414 | if [ -z "${GNUTLS_NO_TICKETS_AVAILABLE:-}" ]; then | 
|  | 415 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep NO_TICKETS >/dev/null | 
|  | 416 | then | 
|  | 417 | GNUTLS_NO_TICKETS_AVAILABLE="YES" | 
|  | 418 | else | 
|  | 419 | GNUTLS_NO_TICKETS_AVAILABLE="NO" | 
|  | 420 | fi | 
|  | 421 | fi | 
|  | 422 | if [ "$GNUTLS_NO_TICKETS_AVAILABLE" = "NO" ]; then | 
|  | 423 | SKIP_NEXT="YES" | 
|  | 424 | fi | 
|  | 425 | } | 
|  | 426 |  | 
| Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 427 | # Check %DISABLE_TLS13_COMPAT_MODE option | 
| Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 428 | requires_gnutls_next_disable_tls13_compat() { | 
|  | 429 | requires_gnutls_next | 
|  | 430 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then | 
|  | 431 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" | 
|  | 432 | fi | 
|  | 433 | if [ -z "${GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE:-}" ]; then | 
|  | 434 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep DISABLE_TLS13_COMPAT_MODE >/dev/null | 
|  | 435 | then | 
|  | 436 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="YES" | 
|  | 437 | else | 
|  | 438 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" | 
|  | 439 | fi | 
|  | 440 | fi | 
|  | 441 | if [ "$GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE" = "NO" ]; then | 
|  | 442 | SKIP_NEXT="YES" | 
|  | 443 | fi | 
|  | 444 | } | 
|  | 445 |  | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 446 | # skip next test if IPv6 isn't available on this host | 
|  | 447 | requires_ipv6() { | 
|  | 448 | if [ -z "${HAS_IPV6:-}" ]; then | 
|  | 449 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & | 
|  | 450 | SRV_PID=$! | 
|  | 451 | sleep 1 | 
|  | 452 | kill $SRV_PID >/dev/null 2>&1 | 
|  | 453 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then | 
|  | 454 | HAS_IPV6="NO" | 
|  | 455 | else | 
|  | 456 | HAS_IPV6="YES" | 
|  | 457 | fi | 
|  | 458 | rm -r $SRV_OUT | 
|  | 459 | fi | 
|  | 460 |  | 
|  | 461 | if [ "$HAS_IPV6" = "NO" ]; then | 
|  | 462 | SKIP_NEXT="YES" | 
|  | 463 | fi | 
|  | 464 | } | 
|  | 465 |  | 
| Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 466 | # skip next test if it's i686 or uname is not available | 
|  | 467 | requires_not_i686() { | 
|  | 468 | if [ -z "${IS_I686:-}" ]; then | 
|  | 469 | IS_I686="YES" | 
|  | 470 | if which "uname" >/dev/null 2>&1; then | 
|  | 471 | if [ -z "$(uname -a | grep i686)" ]; then | 
|  | 472 | IS_I686="NO" | 
|  | 473 | fi | 
|  | 474 | fi | 
|  | 475 | fi | 
|  | 476 | if [ "$IS_I686" = "YES" ]; then | 
|  | 477 | SKIP_NEXT="YES" | 
|  | 478 | fi | 
|  | 479 | } | 
|  | 480 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 481 | # Calculate the input & output maximum content lengths set in the config | 
| David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 482 | MAX_CONTENT_LEN=16384 | 
| Yuto Takano | 2be6f1a | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 483 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) | 
|  | 484 | 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] | 485 |  | 
| Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 486 | # Calculate the maximum content length that fits both | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 487 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then | 
|  | 488 | MAX_CONTENT_LEN="$MAX_IN_LEN" | 
|  | 489 | fi | 
|  | 490 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then | 
|  | 491 | MAX_CONTENT_LEN="$MAX_OUT_LEN" | 
|  | 492 | fi | 
|  | 493 |  | 
|  | 494 | # skip the next test if the SSL output buffer is less than 16KB | 
|  | 495 | requires_full_size_output_buffer() { | 
|  | 496 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then | 
|  | 497 | SKIP_NEXT="YES" | 
|  | 498 | fi | 
|  | 499 | } | 
|  | 500 |  | 
| Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 501 | # skip the next test if valgrind is in use | 
|  | 502 | not_with_valgrind() { | 
|  | 503 | if [ "$MEMCHECK" -gt 0 ]; then | 
|  | 504 | SKIP_NEXT="YES" | 
|  | 505 | fi | 
|  | 506 | } | 
|  | 507 |  | 
| Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 508 | # skip the next test if valgrind is NOT in use | 
|  | 509 | only_with_valgrind() { | 
|  | 510 | if [ "$MEMCHECK" -eq 0 ]; then | 
|  | 511 | SKIP_NEXT="YES" | 
|  | 512 | fi | 
|  | 513 | } | 
|  | 514 |  | 
| Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 515 | # 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] | 516 | client_needs_more_time() { | 
| Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 517 | CLI_DELAY_FACTOR=$1 | 
|  | 518 | } | 
|  | 519 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 520 | # wait for the given seconds after the client finished in the next test | 
|  | 521 | server_needs_more_time() { | 
|  | 522 | SRV_DELAY_SECONDS=$1 | 
|  | 523 | } | 
|  | 524 |  | 
| Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 525 | # print_name <name> | 
|  | 526 | print_name() { | 
| Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 527 | TESTS=$(( $TESTS + 1 )) | 
|  | 528 | LINE="" | 
|  | 529 |  | 
|  | 530 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then | 
|  | 531 | LINE="$TESTS " | 
|  | 532 | fi | 
|  | 533 |  | 
|  | 534 | LINE="$LINE$1" | 
| Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 535 | printf "%s " "$LINE" | 
| Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 536 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) | 
| Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 537 | for i in `seq 1 $LEN`; do printf '.'; done | 
|  | 538 | printf ' ' | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 539 |  | 
| Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 540 | } | 
|  | 541 |  | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 542 | # record_outcome <outcome> [<failure-reason>] | 
|  | 543 | # The test name must be in $NAME. | 
|  | 544 | record_outcome() { | 
|  | 545 | echo "$1" | 
|  | 546 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then | 
|  | 547 | printf '%s;%s;%s;%s;%s;%s\n' \ | 
|  | 548 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ | 
|  | 549 | "ssl-opt" "$NAME" \ | 
|  | 550 | "$1" "${2-}" \ | 
|  | 551 | >>"$MBEDTLS_TEST_OUTCOME_FILE" | 
|  | 552 | fi | 
|  | 553 | } | 
|  | 554 |  | 
| Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 555 | # fail <message> | 
|  | 556 | fail() { | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 557 | record_outcome "FAIL" "$1" | 
| Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 558 | echo "  ! $1" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 559 |  | 
| Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 560 | mv $SRV_OUT o-srv-${TESTS}.log | 
|  | 561 | mv $CLI_OUT o-cli-${TESTS}.log | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 562 | if [ -n "$PXY_CMD" ]; then | 
|  | 563 | mv $PXY_OUT o-pxy-${TESTS}.log | 
|  | 564 | fi | 
|  | 565 | echo "  ! outputs saved to o-XXX-${TESTS}.log" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 566 |  | 
| Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 567 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then | 
| Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 568 | echo "  ! server output:" | 
|  | 569 | cat o-srv-${TESTS}.log | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 570 | echo "  ! ========================================================" | 
| Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 571 | echo "  ! client output:" | 
|  | 572 | cat o-cli-${TESTS}.log | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 573 | if [ -n "$PXY_CMD" ]; then | 
|  | 574 | echo "  ! ========================================================" | 
|  | 575 | echo "  ! proxy output:" | 
|  | 576 | cat o-pxy-${TESTS}.log | 
|  | 577 | fi | 
|  | 578 | echo "" | 
| Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 579 | fi | 
|  | 580 |  | 
| Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 581 | FAILS=$(( $FAILS + 1 )) | 
| Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 582 | } | 
|  | 583 |  | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 584 | # is_polar <cmd_line> | 
|  | 585 | is_polar() { | 
| Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 586 | case "$1" in | 
|  | 587 | *ssl_client2*) true;; | 
|  | 588 | *ssl_server2*) true;; | 
|  | 589 | *) false;; | 
|  | 590 | esac | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 591 | } | 
|  | 592 |  | 
| Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 593 | # openssl s_server doesn't have -www with DTLS | 
|  | 594 | check_osrv_dtls() { | 
| Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 595 | case "$SRV_CMD" in | 
|  | 596 | *s_server*-dtls*) | 
|  | 597 | NEEDS_INPUT=1 | 
|  | 598 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; | 
|  | 599 | *) NEEDS_INPUT=0;; | 
|  | 600 | esac | 
| Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 601 | } | 
|  | 602 |  | 
|  | 603 | # provide input to commands that need it | 
|  | 604 | provide_input() { | 
|  | 605 | if [ $NEEDS_INPUT -eq 0 ]; then | 
|  | 606 | return | 
|  | 607 | fi | 
|  | 608 |  | 
|  | 609 | while true; do | 
|  | 610 | echo "HTTP/1.0 200 OK" | 
|  | 611 | sleep 1 | 
|  | 612 | done | 
|  | 613 | } | 
|  | 614 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 615 | # has_mem_err <log_file_name> | 
|  | 616 | has_mem_err() { | 
|  | 617 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && | 
|  | 618 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null | 
|  | 619 | then | 
|  | 620 | return 1 # false: does not have errors | 
|  | 621 | else | 
|  | 622 | return 0 # true: has errors | 
|  | 623 | fi | 
|  | 624 | } | 
|  | 625 |  | 
| Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 626 | # 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] | 627 | if type lsof >/dev/null 2>/dev/null; then | 
| Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 628 | wait_app_start() { | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 629 | START_TIME=$(date +%s) | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 630 | if [ "$DTLS" -eq 1 ]; then | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 631 | proto=UDP | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 632 | else | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 633 | proto=TCP | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 634 | fi | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 635 | # Make a tight loop, server normally takes less than 1s to start. | 
|  | 636 | while ! lsof -a -n -b -i "$proto:$1" -p "$2" >/dev/null 2>/dev/null; do | 
|  | 637 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then | 
| Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 638 | echo "$3 START TIMEOUT" | 
|  | 639 | echo "$3 START TIMEOUT" >> $4 | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 640 | break | 
|  | 641 | fi | 
|  | 642 | # Linux and *BSD support decimal arguments to sleep. On other | 
|  | 643 | # OSes this may be a tight loop. | 
|  | 644 | sleep 0.1 2>/dev/null || true | 
|  | 645 | done | 
|  | 646 | } | 
|  | 647 | else | 
| Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 648 | echo "Warning: lsof not available, wait_app_start = sleep" | 
|  | 649 | wait_app_start() { | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 650 | sleep "$START_DELAY" | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 651 | } | 
|  | 652 | fi | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 653 |  | 
| Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 654 | # Wait for server process $2 to be listening on port $1. | 
|  | 655 | wait_server_start() { | 
|  | 656 | wait_app_start $1 $2 "SERVER" $SRV_OUT | 
|  | 657 | } | 
|  | 658 |  | 
|  | 659 | # Wait for proxy process $2 to be listening on port $1. | 
|  | 660 | wait_proxy_start() { | 
|  | 661 | wait_app_start $1 $2 "PROXY" $PXY_OUT | 
|  | 662 | } | 
|  | 663 |  | 
| Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 664 | # 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] | 665 | # 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] | 666 | # acceptable bounds | 
|  | 667 | check_server_hello_time() { | 
|  | 668 | # 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] | 669 | 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] | 670 | # Get the Unix timestamp for now | 
|  | 671 | CUR_TIME=$(date +'%s') | 
|  | 672 | THRESHOLD_IN_SECS=300 | 
|  | 673 |  | 
|  | 674 | # Check if the ServerHello time was printed | 
|  | 675 | if [ -z "$SERVER_HELLO_TIME" ]; then | 
|  | 676 | return 1 | 
|  | 677 | fi | 
|  | 678 |  | 
|  | 679 | # Check the time in ServerHello is within acceptable bounds | 
|  | 680 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then | 
|  | 681 | # The time in ServerHello is at least 5 minutes before now | 
|  | 682 | return 1 | 
|  | 683 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then | 
| Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 684 | # 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] | 685 | return 1 | 
|  | 686 | else | 
|  | 687 | return 0 | 
|  | 688 | fi | 
|  | 689 | } | 
|  | 690 |  | 
| Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 691 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument | 
|  | 692 | handshake_memory_get() { | 
|  | 693 | OUTPUT_VARIABLE="$1" | 
|  | 694 | OUTPUT_FILE="$2" | 
|  | 695 |  | 
|  | 696 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" | 
|  | 697 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) | 
|  | 698 |  | 
|  | 699 | # Check if memory usage was read | 
|  | 700 | if [ -z "$MEM_USAGE" ]; then | 
|  | 701 | echo "Error: Can not read the value of handshake memory usage" | 
|  | 702 | return 1 | 
|  | 703 | else | 
|  | 704 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" | 
|  | 705 | return 0 | 
|  | 706 | fi | 
|  | 707 | } | 
|  | 708 |  | 
|  | 709 | # Get handshake memory usage from server or client output and check if this value | 
|  | 710 | # is not higher than the maximum given by the first argument | 
|  | 711 | handshake_memory_check() { | 
|  | 712 | MAX_MEMORY="$1" | 
|  | 713 | OUTPUT_FILE="$2" | 
|  | 714 |  | 
|  | 715 | # Get memory usage | 
|  | 716 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then | 
|  | 717 | return 1 | 
|  | 718 | fi | 
|  | 719 |  | 
|  | 720 | # Check if memory usage is below max value | 
|  | 721 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then | 
|  | 722 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ | 
|  | 723 | "but should be below $MAX_MEMORY bytes" | 
|  | 724 | return 1 | 
|  | 725 | else | 
|  | 726 | return 0 | 
|  | 727 | fi | 
|  | 728 | } | 
|  | 729 |  | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 730 | # wait for client to terminate and set CLI_EXIT | 
|  | 731 | # must be called right after starting the client | 
|  | 732 | wait_client_done() { | 
|  | 733 | CLI_PID=$! | 
|  | 734 |  | 
| Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 735 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) | 
|  | 736 | CLI_DELAY_FACTOR=1 | 
|  | 737 |  | 
| Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 738 | ( 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] | 739 | DOG_PID=$! | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 740 |  | 
|  | 741 | wait $CLI_PID | 
|  | 742 | CLI_EXIT=$? | 
|  | 743 |  | 
| Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 744 | kill $DOG_PID >/dev/null 2>&1 | 
|  | 745 | wait $DOG_PID | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 746 |  | 
|  | 747 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 748 |  | 
|  | 749 | sleep $SRV_DELAY_SECONDS | 
|  | 750 | SRV_DELAY_SECONDS=0 | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 751 | } | 
|  | 752 |  | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 753 | # check if the given command uses dtls and sets global variable DTLS | 
|  | 754 | detect_dtls() { | 
| Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 755 | case "$1" in | 
| Paul Elliott | 1428f25 | 2021-10-12 16:02:55 +0100 | [diff] [blame] | 756 | *dtls=1*|*-dtls*|*-u*) DTLS=1;; | 
| Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 757 | *) DTLS=0;; | 
|  | 758 | esac | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 759 | } | 
|  | 760 |  | 
| Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 761 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS | 
|  | 762 | is_gnutls() { | 
|  | 763 | case "$1" in | 
|  | 764 | *gnutls-cli*) | 
|  | 765 | CMD_IS_GNUTLS=1 | 
|  | 766 | ;; | 
|  | 767 | *gnutls-serv*) | 
|  | 768 | CMD_IS_GNUTLS=1 | 
|  | 769 | ;; | 
|  | 770 | *) | 
|  | 771 | CMD_IS_GNUTLS=0 | 
|  | 772 | ;; | 
|  | 773 | esac | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 774 | } | 
|  | 775 |  | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 776 | # Compare file content | 
|  | 777 | # Usage: find_in_both pattern file1 file2 | 
|  | 778 | # extract from file1 the first line matching the pattern | 
|  | 779 | # check in file2 that the same line can be found | 
|  | 780 | find_in_both() { | 
|  | 781 | srv_pattern=$(grep -m 1 "$1" "$2"); | 
|  | 782 | if [ -z "$srv_pattern" ]; then | 
|  | 783 | return 1; | 
|  | 784 | fi | 
|  | 785 |  | 
|  | 786 | if grep "$srv_pattern" $3 >/dev/null; then : | 
| Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 787 | return 0; | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 788 | else | 
|  | 789 | return 1; | 
|  | 790 | fi | 
|  | 791 | } | 
|  | 792 |  | 
| Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 793 | SKIP_HANDSHAKE_CHECK="NO" | 
|  | 794 | skip_handshake_stage_check() { | 
|  | 795 | SKIP_HANDSHAKE_CHECK="YES" | 
|  | 796 | } | 
|  | 797 |  | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 798 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 799 | # Options:  -s pattern  pattern that must be present in server output | 
|  | 800 | #           -c pattern  pattern that must be present in client output | 
| Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 801 | #           -u pattern  lines after pattern must be unique in client output | 
| Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 802 | #           -f call shell function on client output | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 803 | #           -S pattern  pattern that must be absent in server output | 
|  | 804 | #           -C pattern  pattern that must be absent in client output | 
| Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 805 | #           -U pattern  lines after pattern must be unique in server output | 
| Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 806 | #           -F call shell function on server output | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 807 | #           -g call shell function on server and client output | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 808 | run_test() { | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 809 | NAME="$1" | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 810 | shift 1 | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 811 |  | 
| Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 812 | if is_excluded "$NAME"; then | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 813 | SKIP_NEXT="NO" | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 814 | # There was no request to run the test, so don't record its outcome. | 
| Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 815 | return | 
|  | 816 | fi | 
|  | 817 |  | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 818 | print_name "$NAME" | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 819 |  | 
| Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 820 | # Do we only run numbered tests? | 
| Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 821 | if [ -n "$RUN_TEST_NUMBER" ]; then | 
|  | 822 | case ",$RUN_TEST_NUMBER," in | 
|  | 823 | *",$TESTS,"*) :;; | 
|  | 824 | *) SKIP_NEXT="YES";; | 
|  | 825 | esac | 
| Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 826 | fi | 
|  | 827 |  | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 828 | # does this test use a proxy? | 
|  | 829 | if [ "X$1" = "X-p" ]; then | 
|  | 830 | PXY_CMD="$2" | 
|  | 831 | shift 2 | 
|  | 832 | else | 
|  | 833 | PXY_CMD="" | 
|  | 834 | fi | 
|  | 835 |  | 
|  | 836 | # get commands and client output | 
|  | 837 | SRV_CMD="$1" | 
|  | 838 | CLI_CMD="$2" | 
|  | 839 | CLI_EXPECT="$3" | 
|  | 840 | shift 3 | 
|  | 841 |  | 
| Hanno Becker | 91e72c3 | 2019-05-10 14:38:42 +0100 | [diff] [blame] | 842 | # Check if test uses files | 
| Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 843 | case "$SRV_CMD $CLI_CMD" in | 
|  | 844 | *data_files/*) | 
|  | 845 | requires_config_enabled MBEDTLS_FS_IO;; | 
|  | 846 | esac | 
| Hanno Becker | 91e72c3 | 2019-05-10 14:38:42 +0100 | [diff] [blame] | 847 |  | 
| Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 848 | # If the client or serve requires a ciphersuite, check that it's enabled. | 
|  | 849 | maybe_requires_ciphersuite_enabled "$SRV_CMD" "$@" | 
|  | 850 | maybe_requires_ciphersuite_enabled "$CLI_CMD" "$@" | 
| Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 851 |  | 
|  | 852 | # should we skip? | 
|  | 853 | if [ "X$SKIP_NEXT" = "XYES" ]; then | 
|  | 854 | SKIP_NEXT="NO" | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 855 | record_outcome "SKIP" | 
| Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 856 | SKIPS=$(( $SKIPS + 1 )) | 
|  | 857 | return | 
|  | 858 | fi | 
|  | 859 |  | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 860 | # update DTLS variable | 
|  | 861 | detect_dtls "$SRV_CMD" | 
|  | 862 |  | 
| Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 863 | # if the test uses DTLS but no custom proxy, add a simple proxy | 
|  | 864 | # 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] | 865 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then | 
| Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 866 | PXY_CMD="$P_PXY" | 
| Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 867 | case " $SRV_CMD " in | 
|  | 868 | *' server_addr=::1 '*) | 
|  | 869 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; | 
|  | 870 | esac | 
| Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 871 | fi | 
|  | 872 |  | 
| Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 873 | # update CMD_IS_GNUTLS variable | 
|  | 874 | is_gnutls "$SRV_CMD" | 
|  | 875 |  | 
|  | 876 | # if the server uses gnutls but doesn't set priority, explicitly | 
|  | 877 | # set the default priority | 
|  | 878 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then | 
|  | 879 | case "$SRV_CMD" in | 
|  | 880 | *--priority*) :;; | 
|  | 881 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; | 
|  | 882 | esac | 
|  | 883 | fi | 
|  | 884 |  | 
|  | 885 | # update CMD_IS_GNUTLS variable | 
|  | 886 | is_gnutls "$CLI_CMD" | 
|  | 887 |  | 
|  | 888 | # if the client uses gnutls but doesn't set priority, explicitly | 
|  | 889 | # set the default priority | 
|  | 890 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then | 
|  | 891 | case "$CLI_CMD" in | 
|  | 892 | *--priority*) :;; | 
|  | 893 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; | 
|  | 894 | esac | 
|  | 895 | fi | 
|  | 896 |  | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 897 | # fix client port | 
|  | 898 | if [ -n "$PXY_CMD" ]; then | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 899 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) | 
|  | 900 | else | 
|  | 901 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) | 
|  | 902 | fi | 
| Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 903 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 904 | # prepend valgrind to our commands if active | 
|  | 905 | if [ "$MEMCHECK" -gt 0 ]; then | 
|  | 906 | if is_polar "$SRV_CMD"; then | 
|  | 907 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" | 
|  | 908 | fi | 
|  | 909 | if is_polar "$CLI_CMD"; then | 
|  | 910 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" | 
|  | 911 | fi | 
|  | 912 | fi | 
|  | 913 |  | 
| Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 914 | TIMES_LEFT=2 | 
|  | 915 | while [ $TIMES_LEFT -gt 0 ]; do | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 916 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) | 
| Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 917 |  | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 918 | # run the commands | 
|  | 919 | if [ -n "$PXY_CMD" ]; then | 
| Manuel Pégourié-Gonnard | a3b994f | 2020-07-27 09:45:32 +0200 | [diff] [blame] | 920 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 921 | $PXY_CMD >> $PXY_OUT 2>&1 & | 
|  | 922 | PXY_PID=$! | 
| Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 923 | wait_proxy_start "$PXY_PORT" "$PXY_PID" | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 924 | fi | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 925 |  | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 926 | check_osrv_dtls | 
| Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 927 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 928 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & | 
|  | 929 | SRV_PID=$! | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 930 | wait_server_start "$SRV_PORT" "$SRV_PID" | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 931 |  | 
| Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 932 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 933 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & | 
|  | 934 | wait_client_done | 
| Manuel Pégourié-Gonnard | e01af4c | 2014-03-25 14:16:44 +0100 | [diff] [blame] | 935 |  | 
| Hanno Becker | cadb5bb | 2017-05-26 13:56:10 +0100 | [diff] [blame] | 936 | sleep 0.05 | 
|  | 937 |  | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 938 | # terminate the server (and the proxy) | 
|  | 939 | kill $SRV_PID | 
|  | 940 | wait $SRV_PID | 
| Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 941 | SRV_RET=$? | 
| Hanno Becker | d82d846 | 2017-05-29 21:37:46 +0100 | [diff] [blame] | 942 |  | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 943 | if [ -n "$PXY_CMD" ]; then | 
|  | 944 | kill $PXY_PID >/dev/null 2>&1 | 
|  | 945 | wait $PXY_PID | 
|  | 946 | fi | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 947 |  | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 948 | # retry only on timeouts | 
|  | 949 | if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then | 
|  | 950 | printf "RETRY " | 
|  | 951 | else | 
|  | 952 | TIMES_LEFT=0 | 
|  | 953 | fi | 
| Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 954 | done | 
|  | 955 |  | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 956 | # 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] | 957 | # (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] | 958 | # expected client exit to incorrectly succeed in case of catastrophic | 
|  | 959 | # failure) | 
| Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 960 | if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ] | 
|  | 961 | then | 
|  | 962 | if is_polar "$SRV_CMD"; then | 
|  | 963 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; | 
|  | 964 | else | 
|  | 965 | fail "server or client failed to reach handshake stage" | 
|  | 966 | return | 
|  | 967 | fi | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 968 | fi | 
| Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 969 | if is_polar "$CLI_CMD"; then | 
|  | 970 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; | 
|  | 971 | else | 
|  | 972 | fail "server or client failed to reach handshake stage" | 
|  | 973 | return | 
|  | 974 | fi | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 975 | fi | 
|  | 976 | fi | 
|  | 977 |  | 
| Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 978 | SKIP_HANDSHAKE_CHECK="NO" | 
| Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 979 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't | 
|  | 980 | # exit with status 0 when interrupted by a signal, and we don't really | 
|  | 981 | # care anyway), in case e.g. the server reports a memory leak. | 
|  | 982 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then | 
| Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 983 | fail "Server exited with status $SRV_RET" | 
| Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 984 | return | 
|  | 985 | fi | 
|  | 986 |  | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 987 | # check client exit code | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 988 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ | 
|  | 989 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 990 | then | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 991 | 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] | 992 | return | 
|  | 993 | fi | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 994 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 995 | # check other assertions | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 996 | # lines beginning with == are added by valgrind, ignore them | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 997 | # 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] | 998 | while [ $# -gt 0 ] | 
|  | 999 | do | 
|  | 1000 | case $1 in | 
|  | 1001 | "-s") | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1002 | 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] | 1003 | fail "pattern '$2' MUST be present in the Server output" | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1004 | return | 
|  | 1005 | fi | 
|  | 1006 | ;; | 
|  | 1007 |  | 
|  | 1008 | "-c") | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1009 | 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] | 1010 | fail "pattern '$2' MUST be present in the Client output" | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1011 | return | 
|  | 1012 | fi | 
|  | 1013 | ;; | 
|  | 1014 |  | 
|  | 1015 | "-S") | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1016 | if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then | 
| Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1017 | fail "pattern '$2' MUST NOT be present in the Server output" | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1018 | return | 
|  | 1019 | fi | 
|  | 1020 | ;; | 
|  | 1021 |  | 
|  | 1022 | "-C") | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1023 | if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then | 
| Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1024 | fail "pattern '$2' MUST NOT be present in the Client output" | 
|  | 1025 | return | 
|  | 1026 | fi | 
|  | 1027 | ;; | 
|  | 1028 |  | 
|  | 1029 | # The filtering in the following two options (-u and -U) do the following | 
|  | 1030 | #   - ignore valgrind output | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 1031 | #   - filter out everything but lines right after the pattern occurrences | 
| Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1032 | #   - keep one of each non-unique line | 
|  | 1033 | #   - count how many lines remain | 
|  | 1034 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 | 
|  | 1035 | # if there were no duplicates. | 
|  | 1036 | "-U") | 
|  | 1037 | 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 | 
|  | 1038 | fail "lines following pattern '$2' must be unique in Server output" | 
|  | 1039 | return | 
|  | 1040 | fi | 
|  | 1041 | ;; | 
|  | 1042 |  | 
|  | 1043 | "-u") | 
|  | 1044 | 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 | 
|  | 1045 | 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] | 1046 | return | 
|  | 1047 | fi | 
|  | 1048 | ;; | 
| Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 1049 | "-F") | 
|  | 1050 | if ! $2 "$SRV_OUT"; then | 
|  | 1051 | fail "function call to '$2' failed on Server output" | 
|  | 1052 | return | 
|  | 1053 | fi | 
|  | 1054 | ;; | 
|  | 1055 | "-f") | 
|  | 1056 | if ! $2 "$CLI_OUT"; then | 
|  | 1057 | fail "function call to '$2' failed on Client output" | 
|  | 1058 | return | 
|  | 1059 | fi | 
|  | 1060 | ;; | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1061 | "-g") | 
|  | 1062 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then | 
|  | 1063 | fail "function call to '$2' failed on Server and Client output" | 
|  | 1064 | return | 
|  | 1065 | fi | 
|  | 1066 | ;; | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1067 |  | 
|  | 1068 | *) | 
| Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1069 | echo "Unknown test: $1" >&2 | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1070 | exit 1 | 
|  | 1071 | esac | 
|  | 1072 | shift 2 | 
|  | 1073 | done | 
|  | 1074 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1075 | # check valgrind's results | 
|  | 1076 | if [ "$MEMCHECK" -gt 0 ]; then | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1077 | 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] | 1078 | fail "Server has memory errors" | 
|  | 1079 | return | 
|  | 1080 | fi | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1081 | 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] | 1082 | fail "Client has memory errors" | 
|  | 1083 | return | 
|  | 1084 | fi | 
|  | 1085 | fi | 
|  | 1086 |  | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1087 | # if we're here, everything is ok | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1088 | record_outcome "PASS" | 
| Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1089 | if [ "$PRESERVE_LOGS" -gt 0 ]; then | 
|  | 1090 | mv $SRV_OUT o-srv-${TESTS}.log | 
|  | 1091 | mv $CLI_OUT o-cli-${TESTS}.log | 
| Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1092 | if [ -n "$PXY_CMD" ]; then | 
|  | 1093 | mv $PXY_OUT o-pxy-${TESTS}.log | 
|  | 1094 | fi | 
| Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1095 | fi | 
|  | 1096 |  | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1097 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1098 | } | 
|  | 1099 |  | 
| Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1100 | run_test_psa() { | 
|  | 1101 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1102 | run_test    "PSA-supported ciphersuite: $1" \ | 
| Hanno Becker | 4c8c7aa | 2019-04-10 09:25:41 +0100 | [diff] [blame] | 1103 | "$P_SRV debug_level=3 force_version=tls1_2" \ | 
|  | 1104 | "$P_CLI debug_level=3 force_version=tls1_2 force_ciphersuite=$1" \ | 
| Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1105 | 0 \ | 
|  | 1106 | -c "Successfully setup PSA-based decryption cipher context" \ | 
|  | 1107 | -c "Successfully setup PSA-based encryption cipher context" \ | 
| Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1108 | -c "PSA calc verify" \ | 
| Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1109 | -c "calc PSA finished" \ | 
| Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1110 | -s "Successfully setup PSA-based decryption cipher context" \ | 
|  | 1111 | -s "Successfully setup PSA-based encryption cipher context" \ | 
| Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1112 | -s "PSA calc verify" \ | 
| Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1113 | -s "calc PSA finished" \ | 
| Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1114 | -C "Failed to setup PSA-based cipher context"\ | 
|  | 1115 | -S "Failed to setup PSA-based cipher context"\ | 
|  | 1116 | -s "Protocol is TLSv1.2" \ | 
| Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1117 | -c "Perform PSA-based ECDH computation."\ | 
| Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1118 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ | 
| Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1119 | -S "error" \ | 
|  | 1120 | -C "error" | 
|  | 1121 | } | 
|  | 1122 |  | 
| Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1123 | run_test_psa_force_curve() { | 
|  | 1124 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 1125 | run_test    "PSA - ECDH with $1" \ | 
| Gilles Peskine | 12b5b38 | 2021-06-02 10:00:42 +0200 | [diff] [blame] | 1126 | "$P_SRV debug_level=4 force_version=tls1_2 curves=$1" \ | 
| Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1127 | "$P_CLI debug_level=4 force_version=tls1_2 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 curves=$1" \ | 
|  | 1128 | 0 \ | 
| Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1129 | -c "Successfully setup PSA-based decryption cipher context" \ | 
|  | 1130 | -c "Successfully setup PSA-based encryption cipher context" \ | 
|  | 1131 | -c "PSA calc verify" \ | 
|  | 1132 | -c "calc PSA finished" \ | 
|  | 1133 | -s "Successfully setup PSA-based decryption cipher context" \ | 
|  | 1134 | -s "Successfully setup PSA-based encryption cipher context" \ | 
|  | 1135 | -s "PSA calc verify" \ | 
|  | 1136 | -s "calc PSA finished" \ | 
|  | 1137 | -C "Failed to setup PSA-based cipher context"\ | 
|  | 1138 | -S "Failed to setup PSA-based cipher context"\ | 
| Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1139 | -s "Protocol is TLSv1.2" \ | 
| Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1140 | -c "Perform PSA-based ECDH computation."\ | 
| Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1141 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1142 | -S "error" \ | 
| Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1143 | -C "error" | 
|  | 1144 | } | 
|  | 1145 |  | 
| Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1146 | # Test that the server's memory usage after a handshake is reduced when a client specifies | 
|  | 1147 | # a maximum fragment length. | 
|  | 1148 | #  first argument ($1) is MFL for SSL client | 
|  | 1149 | #  second argument ($2) is memory usage for SSL client with default MFL (16k) | 
|  | 1150 | run_test_memory_after_hanshake_with_mfl() | 
|  | 1151 | { | 
|  | 1152 | # The test passes if the difference is around 2*(16k-MFL) | 
| Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1153 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" | 
| Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1154 |  | 
|  | 1155 | # Leave some margin for robustness | 
|  | 1156 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" | 
|  | 1157 |  | 
|  | 1158 | run_test    "Handshake memory usage (MFL $1)" \ | 
|  | 1159 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ | 
|  | 1160 | "$P_CLI debug_level=3 force_version=tls1_2 \ | 
|  | 1161 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 1162 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ | 
|  | 1163 | 0 \ | 
|  | 1164 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" | 
|  | 1165 | } | 
|  | 1166 |  | 
|  | 1167 |  | 
|  | 1168 | # Test that the server's memory usage after a handshake is reduced when a client specifies | 
|  | 1169 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes | 
|  | 1170 | run_tests_memory_after_hanshake() | 
|  | 1171 | { | 
|  | 1172 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) | 
|  | 1173 | SKIP_THIS_TESTS="$SKIP_NEXT" | 
|  | 1174 |  | 
|  | 1175 | # first test with default MFU is to get reference memory usage | 
|  | 1176 | MEMORY_USAGE_MFL_16K=0 | 
|  | 1177 | run_test    "Handshake memory usage initial (MFL 16384 - default)" \ | 
|  | 1178 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ | 
|  | 1179 | "$P_CLI debug_level=3 force_version=tls1_2 \ | 
|  | 1180 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 1181 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ | 
|  | 1182 | 0 \ | 
|  | 1183 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" | 
|  | 1184 |  | 
|  | 1185 | SKIP_NEXT="$SKIP_THIS_TESTS" | 
|  | 1186 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" | 
|  | 1187 |  | 
|  | 1188 | SKIP_NEXT="$SKIP_THIS_TESTS" | 
|  | 1189 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" | 
|  | 1190 |  | 
|  | 1191 | SKIP_NEXT="$SKIP_THIS_TESTS" | 
|  | 1192 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" | 
|  | 1193 |  | 
|  | 1194 | SKIP_NEXT="$SKIP_THIS_TESTS" | 
|  | 1195 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" | 
|  | 1196 | } | 
|  | 1197 |  | 
| Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1198 | cleanup() { | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1199 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION | 
| Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1200 | rm -f context_srv.txt | 
|  | 1201 | rm -f context_cli.txt | 
| Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1202 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 | 
|  | 1203 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 | 
|  | 1204 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 | 
|  | 1205 | 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] | 1206 | exit 1 | 
|  | 1207 | } | 
|  | 1208 |  | 
| Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1209 | # | 
|  | 1210 | # MAIN | 
|  | 1211 | # | 
|  | 1212 |  | 
| Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1213 | get_options "$@" | 
|  | 1214 |  | 
| Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1215 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell | 
|  | 1216 | # patterns rather than regular expressions, use a case statement instead | 
|  | 1217 | # of calling grep. To keep the optimizer simple, it is incomplete and only | 
|  | 1218 | # detects simple cases: plain substring, everything, nothing. | 
|  | 1219 | # | 
|  | 1220 | # As an exception, the character '.' is treated as an ordinary character | 
|  | 1221 | # if it is the only special character in the string. This is because it's | 
|  | 1222 | # rare to need "any one character", but needing a literal '.' is common | 
|  | 1223 | # (e.g. '-f "DTLS 1.2"'). | 
|  | 1224 | need_grep= | 
|  | 1225 | case "$FILTER" in | 
|  | 1226 | '^$') simple_filter=;; | 
|  | 1227 | '.*') simple_filter='*';; | 
| Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1228 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep | 
| Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1229 | need_grep=1;; | 
|  | 1230 | *) # No regexp or shell-pattern special character | 
|  | 1231 | simple_filter="*$FILTER*";; | 
|  | 1232 | esac | 
|  | 1233 | case "$EXCLUDE" in | 
|  | 1234 | '^$') simple_exclude=;; | 
|  | 1235 | '.*') simple_exclude='*';; | 
| Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1236 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep | 
| Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1237 | need_grep=1;; | 
|  | 1238 | *) # No regexp or shell-pattern special character | 
|  | 1239 | simple_exclude="*$EXCLUDE*";; | 
|  | 1240 | esac | 
|  | 1241 | if [ -n "$need_grep" ]; then | 
|  | 1242 | is_excluded () { | 
|  | 1243 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" | 
|  | 1244 | } | 
|  | 1245 | else | 
|  | 1246 | is_excluded () { | 
|  | 1247 | case "$1" in | 
|  | 1248 | $simple_exclude) true;; | 
|  | 1249 | $simple_filter) false;; | 
|  | 1250 | *) true;; | 
|  | 1251 | esac | 
|  | 1252 | } | 
|  | 1253 | fi | 
|  | 1254 |  | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1255 | # sanity checks, avoid an avalanche of errors | 
| Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1256 | P_SRV_BIN="${P_SRV%%[  ]*}" | 
|  | 1257 | P_CLI_BIN="${P_CLI%%[  ]*}" | 
|  | 1258 | P_PXY_BIN="${P_PXY%%[  ]*}" | 
| Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1259 | if [ ! -x "$P_SRV_BIN" ]; then | 
|  | 1260 | echo "Command '$P_SRV_BIN' is not an executable file" | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1261 | exit 1 | 
|  | 1262 | fi | 
| Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1263 | if [ ! -x "$P_CLI_BIN" ]; then | 
|  | 1264 | echo "Command '$P_CLI_BIN' is not an executable file" | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1265 | exit 1 | 
|  | 1266 | fi | 
| Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1267 | if [ ! -x "$P_PXY_BIN" ]; then | 
|  | 1268 | echo "Command '$P_PXY_BIN' is not an executable file" | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1269 | exit 1 | 
|  | 1270 | fi | 
| Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1271 | if [ "$MEMCHECK" -gt 0 ]; then | 
|  | 1272 | if which valgrind >/dev/null 2>&1; then :; else | 
|  | 1273 | echo "Memcheck not possible. Valgrind not found" | 
|  | 1274 | exit 1 | 
|  | 1275 | fi | 
|  | 1276 | fi | 
| Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1277 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else | 
|  | 1278 | echo "Command '$OPENSSL_CMD' not found" | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1279 | exit 1 | 
|  | 1280 | fi | 
|  | 1281 |  | 
| Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1282 | # used by watchdog | 
|  | 1283 | MAIN_PID="$$" | 
|  | 1284 |  | 
| Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1285 | # We use somewhat arbitrary delays for tests: | 
|  | 1286 | # - how long do we wait for the server to start (when lsof not available)? | 
|  | 1287 | # - how long do we allow for the client to finish? | 
|  | 1288 | #   (not to check performance, just to avoid waiting indefinitely) | 
|  | 1289 | # Things are slower with valgrind, so give extra time here. | 
|  | 1290 | # | 
|  | 1291 | # Note: without lsof, there is a trade-off between the running time of this | 
|  | 1292 | # script and the risk of spurious errors because we didn't wait long enough. | 
|  | 1293 | # The watchdog delay on the other hand doesn't affect normal running time of | 
|  | 1294 | # 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] | 1295 | if [ "$MEMCHECK" -gt 0 ]; then | 
| Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1296 | START_DELAY=6 | 
|  | 1297 | DOG_DELAY=60 | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1298 | else | 
| Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1299 | START_DELAY=2 | 
|  | 1300 | DOG_DELAY=20 | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1301 | fi | 
| Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1302 |  | 
|  | 1303 | # some particular tests need more time: | 
|  | 1304 | # - for the client, we multiply the usual watchdog limit by a factor | 
|  | 1305 | # - for the server, we sleep for a number of seconds after the client exits | 
|  | 1306 | # see client_need_more_time() and server_needs_more_time() | 
| Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1307 | CLI_DELAY_FACTOR=1 | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1308 | SRV_DELAY_SECONDS=0 | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1309 |  | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1310 | # 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] | 1311 | # +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] | 1312 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many | 
|  | 1313 | # 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] | 1314 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" | 
|  | 1315 | 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] | 1316 | 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] | 1317 | O_SRV="$O_SRV -accept $SRV_PORT" | 
| Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1318 | 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] | 1319 | G_SRV="$G_SRV -p $SRV_PORT" | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1320 | G_CLI="$G_CLI -p +SRV_PORT" | 
| Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1321 |  | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1322 | if [ -n "${OPENSSL_LEGACY:-}" ]; then | 
|  | 1323 | 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] | 1324 | 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] | 1325 | fi | 
|  | 1326 |  | 
| Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 1327 | if [ -n "${OPENSSL_NEXT:-}" ]; then | 
|  | 1328 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" | 
| Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1329 | 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] | 1330 | fi | 
|  | 1331 |  | 
| Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1332 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1333 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" | 
|  | 1334 | fi | 
|  | 1335 |  | 
| Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1336 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1337 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1338 | fi | 
| Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1339 |  | 
| Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1340 | # Allow SHA-1, because many of our test certificates use it | 
|  | 1341 | P_SRV="$P_SRV allow_sha1=1" | 
|  | 1342 | P_CLI="$P_CLI allow_sha1=1" | 
|  | 1343 |  | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1344 | # Also pick a unique name for intermediate files | 
|  | 1345 | SRV_OUT="srv_out.$$" | 
|  | 1346 | CLI_OUT="cli_out.$$" | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1347 | PXY_OUT="pxy_out.$$" | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1348 | SESSION="session.$$" | 
|  | 1349 |  | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1350 | SKIP_NEXT="NO" | 
|  | 1351 |  | 
| Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1352 | trap cleanup INT TERM HUP | 
|  | 1353 |  | 
| Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1354 | # Basic test | 
|  | 1355 |  | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1356 | # Checks that: | 
|  | 1357 | # - 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] | 1358 | # - the expected parameters are selected | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1359 | #   ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) | 
| Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1360 | run_test    "Default" \ | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1361 | "$P_SRV debug_level=3" \ | 
| Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1362 | "$P_CLI" \ | 
|  | 1363 | 0 \ | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1364 | -s "Protocol is TLSv1.2" \ | 
| Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1365 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1366 | -s "client hello v3, signature_algorithm ext: 6" \ | 
| Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 1367 | -s "ECDHE curve: x25519" \ | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1368 | -S "error" \ | 
|  | 1369 | -C "error" | 
| Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1370 |  | 
| Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1371 | run_test    "Default, DTLS" \ | 
|  | 1372 | "$P_SRV dtls=1" \ | 
|  | 1373 | "$P_CLI dtls=1" \ | 
|  | 1374 | 0 \ | 
|  | 1375 | -s "Protocol is DTLSv1.2" \ | 
| Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1376 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" | 
| Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1377 |  | 
| Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1378 | run_test    "TLS client auth: required" \ | 
|  | 1379 | "$P_SRV auth_mode=required" \ | 
|  | 1380 | "$P_CLI" \ | 
|  | 1381 | 0 \ | 
|  | 1382 | -s "Verifying peer X.509 certificate... ok" | 
|  | 1383 |  | 
| Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1384 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
|  | 1385 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 1386 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 1387 | run_test    "TLS: password protected client key" \ | 
|  | 1388 | "$P_SRV auth_mode=required" \ | 
|  | 1389 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ | 
|  | 1390 | 0 | 
|  | 1391 |  | 
|  | 1392 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
|  | 1393 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 1394 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 1395 | run_test    "TLS: password protected server key" \ | 
|  | 1396 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ | 
|  | 1397 | "$P_CLI" \ | 
|  | 1398 | 0 | 
|  | 1399 |  | 
|  | 1400 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
|  | 1401 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 1402 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 1403 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 1404 | run_test    "TLS: password protected server key, two certificates" \ | 
|  | 1405 | "$P_SRV \ | 
|  | 1406 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ | 
|  | 1407 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ | 
|  | 1408 | "$P_CLI" \ | 
|  | 1409 | 0 | 
|  | 1410 |  | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1411 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 1412 | run_test    "CA callback on client" \ | 
|  | 1413 | "$P_SRV debug_level=3" \ | 
|  | 1414 | "$P_CLI ca_callback=1 debug_level=3 " \ | 
|  | 1415 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1416 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1417 | -S "error" \ | 
|  | 1418 | -C "error" | 
|  | 1419 |  | 
|  | 1420 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 1421 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
|  | 1422 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 1423 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 1424 | run_test    "CA callback on server" \ | 
|  | 1425 | "$P_SRV auth_mode=required" \ | 
|  | 1426 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ | 
|  | 1427 | key_file=data_files/server5.key" \ | 
|  | 1428 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1429 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1430 | -s "Verifying peer X.509 certificate... ok" \ | 
|  | 1431 | -S "error" \ | 
|  | 1432 | -C "error" | 
|  | 1433 |  | 
| Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1434 | # Test using an opaque private key for client authentication | 
|  | 1435 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 1436 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
|  | 1437 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 1438 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 1439 | run_test    "Opaque key for client authentication" \ | 
|  | 1440 | "$P_SRV auth_mode=required" \ | 
|  | 1441 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ | 
|  | 1442 | key_file=data_files/server5.key" \ | 
|  | 1443 | 0 \ | 
|  | 1444 | -c "key type: Opaque" \ | 
|  | 1445 | -s "Verifying peer X.509 certificate... ok" \ | 
|  | 1446 | -S "error" \ | 
|  | 1447 | -C "error" | 
|  | 1448 |  | 
| Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1449 | # Test ciphersuites which we expect to be fully supported by PSA Crypto | 
|  | 1450 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. | 
|  | 1451 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM | 
|  | 1452 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 | 
|  | 1453 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM | 
|  | 1454 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 | 
|  | 1455 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 | 
|  | 1456 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 | 
|  | 1457 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA | 
|  | 1458 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 | 
|  | 1459 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 | 
|  | 1460 |  | 
| Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1461 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED | 
|  | 1462 | run_test_psa_force_curve "secp521r1" | 
|  | 1463 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED | 
|  | 1464 | run_test_psa_force_curve "brainpoolP512r1" | 
|  | 1465 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED | 
|  | 1466 | run_test_psa_force_curve "secp384r1" | 
|  | 1467 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED | 
|  | 1468 | run_test_psa_force_curve "brainpoolP384r1" | 
|  | 1469 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
|  | 1470 | run_test_psa_force_curve "secp256r1" | 
|  | 1471 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED | 
|  | 1472 | run_test_psa_force_curve "secp256k1" | 
|  | 1473 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED | 
|  | 1474 | run_test_psa_force_curve "brainpoolP256r1" | 
|  | 1475 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED | 
|  | 1476 | run_test_psa_force_curve "secp224r1" | 
| Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1477 | ## SECP224K1 is buggy via the PSA API | 
|  | 1478 | ## (https://github.com/ARMmbed/mbedtls/issues/3541), | 
|  | 1479 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. | 
|  | 1480 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but | 
|  | 1481 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. | 
|  | 1482 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED | 
|  | 1483 | #run_test_psa_force_curve "secp224k1" | 
| Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1484 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED | 
|  | 1485 | run_test_psa_force_curve "secp192r1" | 
|  | 1486 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED | 
|  | 1487 | run_test_psa_force_curve "secp192k1" | 
|  | 1488 |  | 
| Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1489 | # Test current time in ServerHello | 
|  | 1490 | requires_config_enabled MBEDTLS_HAVE_TIME | 
| Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1491 | run_test    "ServerHello contains gmt_unix_time" \ | 
| Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1492 | "$P_SRV debug_level=3" \ | 
|  | 1493 | "$P_CLI debug_level=3" \ | 
|  | 1494 | 0 \ | 
| Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1495 | -f "check_server_hello_time" \ | 
|  | 1496 | -F "check_server_hello_time" | 
|  | 1497 |  | 
| Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1498 | # Test for uniqueness of IVs in AEAD ciphersuites | 
|  | 1499 | run_test    "Unique IV in GCM" \ | 
|  | 1500 | "$P_SRV exchanges=20 debug_level=4" \ | 
|  | 1501 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ | 
|  | 1502 | 0 \ | 
|  | 1503 | -u "IV used" \ | 
|  | 1504 | -U "IV used" | 
|  | 1505 |  | 
| Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1506 | # Tests for certificate verification callback | 
|  | 1507 | run_test    "Configuration-specific CRT verification callback" \ | 
|  | 1508 | "$P_SRV debug_level=3" \ | 
|  | 1509 | "$P_CLI context_crt_cb=0 debug_level=3" \ | 
|  | 1510 | 0 \ | 
| Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1511 | -S "error" \ | 
|  | 1512 | -c "Verify requested for " \ | 
|  | 1513 | -c "Use configuration-specific verification callback" \ | 
|  | 1514 | -C "Use context-specific verification callback" \ | 
|  | 1515 | -C "error" | 
|  | 1516 |  | 
| Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1517 | run_test    "Context-specific CRT verification callback" \ | 
|  | 1518 | "$P_SRV debug_level=3" \ | 
|  | 1519 | "$P_CLI context_crt_cb=1 debug_level=3" \ | 
|  | 1520 | 0 \ | 
| Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1521 | -S "error" \ | 
| Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1522 | -c "Verify requested for " \ | 
|  | 1523 | -c "Use context-specific verification callback" \ | 
|  | 1524 | -C "Use configuration-specific verification callback" \ | 
| Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1525 | -C "error" | 
|  | 1526 |  | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1527 | # Tests for SHA-1 support | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1528 | run_test    "SHA-1 forbidden by default in server certificate" \ | 
|  | 1529 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ | 
|  | 1530 | "$P_CLI debug_level=2 allow_sha1=0" \ | 
|  | 1531 | 1 \ | 
|  | 1532 | -c "The certificate is signed with an unacceptable hash" | 
|  | 1533 |  | 
|  | 1534 | run_test    "SHA-1 explicitly allowed in server certificate" \ | 
|  | 1535 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ | 
|  | 1536 | "$P_CLI allow_sha1=1" \ | 
|  | 1537 | 0 | 
|  | 1538 |  | 
|  | 1539 | run_test    "SHA-256 allowed by default in server certificate" \ | 
|  | 1540 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ | 
|  | 1541 | "$P_CLI allow_sha1=0" \ | 
|  | 1542 | 0 | 
|  | 1543 |  | 
|  | 1544 | run_test    "SHA-1 forbidden by default in client certificate" \ | 
|  | 1545 | "$P_SRV auth_mode=required allow_sha1=0" \ | 
|  | 1546 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ | 
|  | 1547 | 1 \ | 
|  | 1548 | -s "The certificate is signed with an unacceptable hash" | 
|  | 1549 |  | 
|  | 1550 | run_test    "SHA-1 explicitly allowed in client certificate" \ | 
|  | 1551 | "$P_SRV auth_mode=required allow_sha1=1" \ | 
|  | 1552 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ | 
|  | 1553 | 0 | 
|  | 1554 |  | 
|  | 1555 | run_test    "SHA-256 allowed by default in client certificate" \ | 
|  | 1556 | "$P_SRV auth_mode=required allow_sha1=0" \ | 
|  | 1557 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ | 
|  | 1558 | 0 | 
|  | 1559 |  | 
| Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1560 | # Dummy TLS 1.3 test | 
|  | 1561 | # Currently only checking that passing TLS 1.3 key exchange modes to | 
|  | 1562 | # ssl_client2/ssl_server2 example programs works. | 
|  | 1563 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL | 
|  | 1564 | run_test    "TLS 1.3, key exchange mode parameter passing: PSK only" \ | 
| Jerry Yu | 31c01d3 | 2021-08-24 10:49:06 +0800 | [diff] [blame] | 1565 | "$P_SRV tls13_kex_modes=psk" \ | 
|  | 1566 | "$P_CLI tls13_kex_modes=psk" \ | 
| Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1567 | 0 | 
|  | 1568 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL | 
|  | 1569 | run_test    "TLS 1.3, key exchange mode parameter passing: PSK-ephemeral only" \ | 
|  | 1570 | "$P_SRV tls13_kex_modes=psk_ephemeral" \ | 
|  | 1571 | "$P_CLI tls13_kex_modes=psk_ephemeral" \ | 
|  | 1572 | 0 | 
|  | 1573 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL | 
|  | 1574 | 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] | 1575 | "$P_SRV tls13_kex_modes=ephemeral" \ | 
|  | 1576 | "$P_CLI tls13_kex_modes=ephemeral" \ | 
| Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1577 | 0 | 
|  | 1578 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL | 
|  | 1579 | run_test    "TLS 1.3, key exchange mode parameter passing: All ephemeral" \ | 
|  | 1580 | "$P_SRV tls13_kex_modes=ephemeral_all" \ | 
|  | 1581 | "$P_CLI tls13_kex_modes=ephemeral_all" \ | 
|  | 1582 | 0 | 
|  | 1583 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL | 
|  | 1584 | run_test    "TLS 1.3, key exchange mode parameter passing: All PSK" \ | 
|  | 1585 | "$P_SRV tls13_kex_modes=psk_all" \ | 
|  | 1586 | "$P_CLI tls13_kex_modes=psk_all" \ | 
|  | 1587 | 0 | 
|  | 1588 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL | 
|  | 1589 | run_test    "TLS 1.3, key exchange mode parameter passing: All" \ | 
|  | 1590 | "$P_SRV tls13_kex_modes=all" \ | 
|  | 1591 | "$P_CLI tls13_kex_modes=all" \ | 
|  | 1592 | 0 | 
|  | 1593 |  | 
| Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1594 | # Tests for datagram packing | 
|  | 1595 | run_test    "DTLS: multiple records in same datagram, client and server" \ | 
|  | 1596 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ | 
|  | 1597 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ | 
|  | 1598 | 0 \ | 
|  | 1599 | -c "next record in same datagram" \ | 
|  | 1600 | -s "next record in same datagram" | 
|  | 1601 |  | 
|  | 1602 | run_test    "DTLS: multiple records in same datagram, client only" \ | 
|  | 1603 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ | 
|  | 1604 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ | 
|  | 1605 | 0 \ | 
|  | 1606 | -s "next record in same datagram" \ | 
|  | 1607 | -C "next record in same datagram" | 
|  | 1608 |  | 
|  | 1609 | run_test    "DTLS: multiple records in same datagram, server only" \ | 
|  | 1610 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ | 
|  | 1611 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ | 
|  | 1612 | 0 \ | 
|  | 1613 | -S "next record in same datagram" \ | 
|  | 1614 | -c "next record in same datagram" | 
|  | 1615 |  | 
|  | 1616 | run_test    "DTLS: multiple records in same datagram, neither client nor server" \ | 
|  | 1617 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ | 
|  | 1618 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ | 
|  | 1619 | 0 \ | 
|  | 1620 | -S "next record in same datagram" \ | 
|  | 1621 | -C "next record in same datagram" | 
|  | 1622 |  | 
| Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1623 | # Tests for Context serialization | 
|  | 1624 |  | 
|  | 1625 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1626 | run_test    "Context serialization, client serializes, CCM" \ | 
| Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1627 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1628 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 1629 | 0 \ | 
|  | 1630 | -c "Deserializing connection..." \ | 
|  | 1631 | -S "Deserializing connection..." | 
|  | 1632 |  | 
|  | 1633 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1634 | run_test    "Context serialization, client serializes, ChaChaPoly" \ | 
|  | 1635 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ | 
|  | 1636 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
|  | 1637 | 0 \ | 
|  | 1638 | -c "Deserializing connection..." \ | 
|  | 1639 | -S "Deserializing connection..." | 
|  | 1640 |  | 
|  | 1641 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1642 | run_test    "Context serialization, client serializes, GCM" \ | 
|  | 1643 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ | 
|  | 1644 | "$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] | 1645 | 0 \ | 
| Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1646 | -c "Deserializing connection..." \ | 
| Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1647 | -S "Deserializing connection..." | 
|  | 1648 |  | 
|  | 1649 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1650 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 1651 | run_test    "Context serialization, client serializes, with CID" \ | 
|  | 1652 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ | 
|  | 1653 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ | 
|  | 1654 | 0 \ | 
|  | 1655 | -c "Deserializing connection..." \ | 
|  | 1656 | -S "Deserializing connection..." | 
|  | 1657 |  | 
|  | 1658 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1659 | run_test    "Context serialization, server serializes, CCM" \ | 
| Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1660 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1661 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 1662 | 0 \ | 
|  | 1663 | -C "Deserializing connection..." \ | 
|  | 1664 | -s "Deserializing connection..." | 
|  | 1665 |  | 
|  | 1666 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1667 | run_test    "Context serialization, server serializes, ChaChaPoly" \ | 
|  | 1668 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ | 
|  | 1669 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
|  | 1670 | 0 \ | 
|  | 1671 | -C "Deserializing connection..." \ | 
|  | 1672 | -s "Deserializing connection..." | 
|  | 1673 |  | 
|  | 1674 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1675 | run_test    "Context serialization, server serializes, GCM" \ | 
|  | 1676 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ | 
|  | 1677 | "$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] | 1678 | 0 \ | 
| Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1679 | -C "Deserializing connection..." \ | 
| Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1680 | -s "Deserializing connection..." | 
|  | 1681 |  | 
|  | 1682 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1683 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 1684 | run_test    "Context serialization, server serializes, with CID" \ | 
|  | 1685 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ | 
|  | 1686 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ | 
|  | 1687 | 0 \ | 
|  | 1688 | -C "Deserializing connection..." \ | 
|  | 1689 | -s "Deserializing connection..." | 
|  | 1690 |  | 
|  | 1691 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1692 | run_test    "Context serialization, both serialize, CCM" \ | 
| Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1693 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1694 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 1695 | 0 \ | 
|  | 1696 | -c "Deserializing connection..." \ | 
|  | 1697 | -s "Deserializing connection..." | 
|  | 1698 |  | 
|  | 1699 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1700 | run_test    "Context serialization, both serialize, ChaChaPoly" \ | 
|  | 1701 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ | 
|  | 1702 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
|  | 1703 | 0 \ | 
|  | 1704 | -c "Deserializing connection..." \ | 
|  | 1705 | -s "Deserializing connection..." | 
|  | 1706 |  | 
|  | 1707 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1708 | run_test    "Context serialization, both serialize, GCM" \ | 
|  | 1709 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ | 
|  | 1710 | "$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] | 1711 | 0 \ | 
| Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1712 | -c "Deserializing connection..." \ | 
| Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1713 | -s "Deserializing connection..." | 
|  | 1714 |  | 
| Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1715 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1716 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 1717 | run_test    "Context serialization, both serialize, with CID" \ | 
|  | 1718 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ | 
|  | 1719 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ | 
|  | 1720 | 0 \ | 
|  | 1721 | -c "Deserializing connection..." \ | 
|  | 1722 | -s "Deserializing connection..." | 
|  | 1723 |  | 
|  | 1724 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1725 | run_test    "Context serialization, re-init, client serializes, CCM" \ | 
| Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1726 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1727 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 1728 | 0 \ | 
|  | 1729 | -c "Deserializing connection..." \ | 
|  | 1730 | -S "Deserializing connection..." | 
|  | 1731 |  | 
|  | 1732 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1733 | run_test    "Context serialization, re-init, client serializes, ChaChaPoly" \ | 
|  | 1734 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ | 
|  | 1735 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
|  | 1736 | 0 \ | 
|  | 1737 | -c "Deserializing connection..." \ | 
|  | 1738 | -S "Deserializing connection..." | 
|  | 1739 |  | 
|  | 1740 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1741 | run_test    "Context serialization, re-init, client serializes, GCM" \ | 
|  | 1742 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ | 
|  | 1743 | "$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] | 1744 | 0 \ | 
|  | 1745 | -c "Deserializing connection..." \ | 
|  | 1746 | -S "Deserializing connection..." | 
|  | 1747 |  | 
| Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1748 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1749 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 1750 | run_test    "Context serialization, re-init, client serializes, with CID" \ | 
|  | 1751 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ | 
|  | 1752 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ | 
|  | 1753 | 0 \ | 
|  | 1754 | -c "Deserializing connection..." \ | 
|  | 1755 | -S "Deserializing connection..." | 
|  | 1756 |  | 
|  | 1757 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1758 | run_test    "Context serialization, re-init, server serializes, CCM" \ | 
| Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1759 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1760 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 1761 | 0 \ | 
|  | 1762 | -C "Deserializing connection..." \ | 
|  | 1763 | -s "Deserializing connection..." | 
|  | 1764 |  | 
|  | 1765 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1766 | run_test    "Context serialization, re-init, server serializes, ChaChaPoly" \ | 
|  | 1767 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ | 
|  | 1768 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
|  | 1769 | 0 \ | 
|  | 1770 | -C "Deserializing connection..." \ | 
|  | 1771 | -s "Deserializing connection..." | 
|  | 1772 |  | 
|  | 1773 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1774 | run_test    "Context serialization, re-init, server serializes, GCM" \ | 
|  | 1775 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ | 
|  | 1776 | "$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] | 1777 | 0 \ | 
|  | 1778 | -C "Deserializing connection..." \ | 
|  | 1779 | -s "Deserializing connection..." | 
|  | 1780 |  | 
| Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1781 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1782 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 1783 | run_test    "Context serialization, re-init, server serializes, with CID" \ | 
|  | 1784 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ | 
|  | 1785 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ | 
|  | 1786 | 0 \ | 
|  | 1787 | -C "Deserializing connection..." \ | 
|  | 1788 | -s "Deserializing connection..." | 
|  | 1789 |  | 
|  | 1790 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1791 | run_test    "Context serialization, re-init, both serialize, CCM" \ | 
| Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1792 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1793 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 1794 | 0 \ | 
|  | 1795 | -c "Deserializing connection..." \ | 
|  | 1796 | -s "Deserializing connection..." | 
|  | 1797 |  | 
|  | 1798 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1799 | run_test    "Context serialization, re-init, both serialize, ChaChaPoly" \ | 
|  | 1800 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ | 
|  | 1801 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
|  | 1802 | 0 \ | 
|  | 1803 | -c "Deserializing connection..." \ | 
|  | 1804 | -s "Deserializing connection..." | 
|  | 1805 |  | 
|  | 1806 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1807 | run_test    "Context serialization, re-init, both serialize, GCM" \ | 
|  | 1808 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ | 
|  | 1809 | "$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] | 1810 | 0 \ | 
|  | 1811 | -c "Deserializing connection..." \ | 
|  | 1812 | -s "Deserializing connection..." | 
|  | 1813 |  | 
| Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1814 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1815 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 1816 | run_test    "Context serialization, re-init, both serialize, with CID" \ | 
|  | 1817 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ | 
|  | 1818 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ | 
|  | 1819 | 0 \ | 
|  | 1820 | -c "Deserializing connection..." \ | 
|  | 1821 | -s "Deserializing connection..." | 
|  | 1822 |  | 
| Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1823 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1824 | run_test    "Saving the serialized context to a file" \ | 
|  | 1825 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ | 
|  | 1826 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ | 
|  | 1827 | 0 \ | 
|  | 1828 | -s "Save serialized context to a file... ok" \ | 
|  | 1829 | -c "Save serialized context to a file... ok" | 
|  | 1830 | rm -f context_srv.txt | 
|  | 1831 | rm -f context_cli.txt | 
|  | 1832 |  | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1833 | # Tests for DTLS Connection ID extension | 
|  | 1834 |  | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1835 | # So far, the CID API isn't implemented, so we can't | 
|  | 1836 | # grep for output witnessing its use. This needs to be | 
|  | 1837 | # changed once the CID extension is implemented. | 
|  | 1838 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1839 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1840 | run_test    "Connection ID: Cli enabled, Srv disabled" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1841 | "$P_SRV debug_level=3 dtls=1 cid=0" \ | 
|  | 1842 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ | 
|  | 1843 | 0 \ | 
|  | 1844 | -s "Disable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1845 | -s "found CID extension"           \ | 
|  | 1846 | -s "Client sent CID extension, but CID disabled" \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1847 | -c "Enable use of CID extension."  \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1848 | -c "client hello, adding CID extension" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1849 | -S "server hello, adding CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1850 | -C "found CID extension" \ | 
|  | 1851 | -S "Copy CIDs into SSL transform" \ | 
| Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1852 | -C "Copy CIDs into SSL transform" \ | 
|  | 1853 | -c "Use of Connection ID was rejected by the server" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1854 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1855 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1856 | run_test    "Connection ID: Cli disabled, Srv enabled" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1857 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ | 
|  | 1858 | "$P_CLI debug_level=3 dtls=1 cid=0" \ | 
|  | 1859 | 0 \ | 
|  | 1860 | -c "Disable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1861 | -C "client hello, adding CID extension"           \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1862 | -S "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1863 | -s "Enable use of CID extension." \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1864 | -S "server hello, adding CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1865 | -C "found CID extension" \ | 
|  | 1866 | -S "Copy CIDs into SSL transform" \ | 
| Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1867 | -C "Copy CIDs into SSL transform"  \ | 
| Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 1868 | -s "Use of Connection ID was not offered by client" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1869 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1870 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1871 | run_test    "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1872 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ | 
|  | 1873 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ | 
|  | 1874 | 0 \ | 
|  | 1875 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1876 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1877 | -c "client hello, adding CID extension" \ | 
|  | 1878 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1879 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1880 | -s "server hello, adding CID extension" \ | 
|  | 1881 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1882 | -c "Use of CID extension negotiated" \ | 
|  | 1883 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1884 | -c "Copy CIDs into SSL transform" \ | 
|  | 1885 | -c "Peer CID (length 2 Bytes): de ad" \ | 
|  | 1886 | -s "Peer CID (length 2 Bytes): be ef" \ | 
|  | 1887 | -s "Use of Connection ID has been negotiated" \ | 
|  | 1888 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1889 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1890 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1891 | run_test    "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1892 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1893 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ | 
|  | 1894 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ | 
|  | 1895 | 0 \ | 
|  | 1896 | -c "Enable use of CID extension." \ | 
|  | 1897 | -s "Enable use of CID extension." \ | 
|  | 1898 | -c "client hello, adding CID extension" \ | 
|  | 1899 | -s "found CID extension"           \ | 
|  | 1900 | -s "Use of CID extension negotiated" \ | 
|  | 1901 | -s "server hello, adding CID extension" \ | 
|  | 1902 | -c "found CID extension" \ | 
|  | 1903 | -c "Use of CID extension negotiated" \ | 
|  | 1904 | -s "Copy CIDs into SSL transform" \ | 
|  | 1905 | -c "Copy CIDs into SSL transform" \ | 
|  | 1906 | -c "Peer CID (length 2 Bytes): de ad" \ | 
|  | 1907 | -s "Peer CID (length 2 Bytes): be ef" \ | 
|  | 1908 | -s "Use of Connection ID has been negotiated" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1909 | -c "Use of Connection ID has been negotiated" \ | 
|  | 1910 | -c "ignoring unexpected CID" \ | 
|  | 1911 | -s "ignoring unexpected CID" | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1912 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1913 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1914 | run_test    "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ | 
|  | 1915 | -p "$P_PXY mtu=800" \ | 
|  | 1916 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ | 
|  | 1917 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ | 
|  | 1918 | 0 \ | 
|  | 1919 | -c "Enable use of CID extension." \ | 
|  | 1920 | -s "Enable use of CID extension." \ | 
|  | 1921 | -c "client hello, adding CID extension" \ | 
|  | 1922 | -s "found CID extension"           \ | 
|  | 1923 | -s "Use of CID extension negotiated" \ | 
|  | 1924 | -s "server hello, adding CID extension" \ | 
|  | 1925 | -c "found CID extension" \ | 
|  | 1926 | -c "Use of CID extension negotiated" \ | 
|  | 1927 | -s "Copy CIDs into SSL transform" \ | 
|  | 1928 | -c "Copy CIDs into SSL transform" \ | 
|  | 1929 | -c "Peer CID (length 2 Bytes): de ad" \ | 
|  | 1930 | -s "Peer CID (length 2 Bytes): be ef" \ | 
|  | 1931 | -s "Use of Connection ID has been negotiated" \ | 
|  | 1932 | -c "Use of Connection ID has been negotiated" | 
|  | 1933 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1934 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1935 | 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] | 1936 | -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] | 1937 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ | 
|  | 1938 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ | 
|  | 1939 | 0 \ | 
|  | 1940 | -c "Enable use of CID extension." \ | 
|  | 1941 | -s "Enable use of CID extension." \ | 
|  | 1942 | -c "client hello, adding CID extension" \ | 
|  | 1943 | -s "found CID extension"           \ | 
|  | 1944 | -s "Use of CID extension negotiated" \ | 
|  | 1945 | -s "server hello, adding CID extension" \ | 
|  | 1946 | -c "found CID extension" \ | 
|  | 1947 | -c "Use of CID extension negotiated" \ | 
|  | 1948 | -s "Copy CIDs into SSL transform" \ | 
|  | 1949 | -c "Copy CIDs into SSL transform" \ | 
|  | 1950 | -c "Peer CID (length 2 Bytes): de ad" \ | 
|  | 1951 | -s "Peer CID (length 2 Bytes): be ef" \ | 
|  | 1952 | -s "Use of Connection ID has been negotiated" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1953 | -c "Use of Connection ID has been negotiated" \ | 
|  | 1954 | -c "ignoring unexpected CID" \ | 
|  | 1955 | -s "ignoring unexpected CID" | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1956 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1957 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1958 | run_test    "Connection ID: Cli+Srv enabled, Cli CID empty" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1959 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ | 
|  | 1960 | "$P_CLI debug_level=3 dtls=1 cid=1" \ | 
|  | 1961 | 0 \ | 
|  | 1962 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1963 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1964 | -c "client hello, adding CID extension" \ | 
|  | 1965 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1966 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1967 | -s "server hello, adding CID extension" \ | 
|  | 1968 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1969 | -c "Use of CID extension negotiated" \ | 
|  | 1970 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1971 | -c "Copy CIDs into SSL transform" \ | 
|  | 1972 | -c "Peer CID (length 4 Bytes): de ad be ef" \ | 
|  | 1973 | -s "Peer CID (length 0 Bytes):" \ | 
|  | 1974 | -s "Use of Connection ID has been negotiated" \ | 
|  | 1975 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1976 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1977 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1978 | run_test    "Connection ID: Cli+Srv enabled, Srv CID empty" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1979 | "$P_SRV debug_level=3 dtls=1 cid=1" \ | 
|  | 1980 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ | 
|  | 1981 | 0 \ | 
|  | 1982 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1983 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1984 | -c "client hello, adding CID extension" \ | 
|  | 1985 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1986 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1987 | -s "server hello, adding CID extension" \ | 
|  | 1988 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1989 | -c "Use of CID extension negotiated" \ | 
|  | 1990 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1991 | -c "Copy CIDs into SSL transform" \ | 
|  | 1992 | -s "Peer CID (length 4 Bytes): de ad be ef" \ | 
|  | 1993 | -c "Peer CID (length 0 Bytes):" \ | 
|  | 1994 | -s "Use of Connection ID has been negotiated" \ | 
|  | 1995 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1996 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1997 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1998 | run_test    "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1999 | "$P_SRV debug_level=3 dtls=1 cid=1" \ | 
|  | 2000 | "$P_CLI debug_level=3 dtls=1 cid=1" \ | 
|  | 2001 | 0 \ | 
|  | 2002 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2003 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2004 | -c "client hello, adding CID extension" \ | 
|  | 2005 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2006 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2007 | -s "server hello, adding CID extension" \ | 
|  | 2008 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2009 | -c "Use of CID extension negotiated" \ | 
|  | 2010 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2011 | -c "Copy CIDs into SSL transform" \ | 
|  | 2012 | -S "Use of Connection ID has been negotiated" \ | 
|  | 2013 | -C "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2014 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2015 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2016 | 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] | 2017 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ | 
|  | 2018 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 2019 | 0 \ | 
|  | 2020 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2021 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2022 | -c "client hello, adding CID extension" \ | 
|  | 2023 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2024 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2025 | -s "server hello, adding CID extension" \ | 
|  | 2026 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2027 | -c "Use of CID extension negotiated" \ | 
|  | 2028 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2029 | -c "Copy CIDs into SSL transform" \ | 
|  | 2030 | -c "Peer CID (length 2 Bytes): de ad" \ | 
|  | 2031 | -s "Peer CID (length 2 Bytes): be ef" \ | 
|  | 2032 | -s "Use of Connection ID has been negotiated" \ | 
|  | 2033 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2034 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2035 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2036 | 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] | 2037 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ | 
|  | 2038 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 2039 | 0 \ | 
|  | 2040 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2041 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2042 | -c "client hello, adding CID extension" \ | 
|  | 2043 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2044 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2045 | -s "server hello, adding CID extension" \ | 
|  | 2046 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2047 | -c "Use of CID extension negotiated" \ | 
|  | 2048 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2049 | -c "Copy CIDs into SSL transform" \ | 
|  | 2050 | -c "Peer CID (length 4 Bytes): de ad be ef" \ | 
|  | 2051 | -s "Peer CID (length 0 Bytes):" \ | 
|  | 2052 | -s "Use of Connection ID has been negotiated" \ | 
|  | 2053 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2054 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2055 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2056 | 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] | 2057 | "$P_SRV debug_level=3 dtls=1 cid=1" \ | 
|  | 2058 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 2059 | 0 \ | 
|  | 2060 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2061 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2062 | -c "client hello, adding CID extension" \ | 
|  | 2063 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2064 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2065 | -s "server hello, adding CID extension" \ | 
|  | 2066 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2067 | -c "Use of CID extension negotiated" \ | 
|  | 2068 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2069 | -c "Copy CIDs into SSL transform" \ | 
|  | 2070 | -s "Peer CID (length 4 Bytes): de ad be ef" \ | 
|  | 2071 | -c "Peer CID (length 0 Bytes):" \ | 
|  | 2072 | -s "Use of Connection ID has been negotiated" \ | 
|  | 2073 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2074 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2075 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2076 | run_test    "Connection ID: Cli+Srv enabled, Cli+Srv CID empty, AES-128-CCM-8" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2077 | "$P_SRV debug_level=3 dtls=1 cid=1" \ | 
|  | 2078 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 2079 | 0 \ | 
|  | 2080 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2081 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2082 | -c "client hello, adding CID extension" \ | 
|  | 2083 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2084 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2085 | -s "server hello, adding CID extension" \ | 
|  | 2086 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2087 | -c "Use of CID extension negotiated" \ | 
|  | 2088 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2089 | -c "Copy CIDs into SSL transform" \ | 
|  | 2090 | -S "Use of Connection ID has been negotiated" \ | 
|  | 2091 | -C "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2092 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2093 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2094 | 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] | 2095 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ | 
|  | 2096 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 2097 | 0 \ | 
|  | 2098 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2099 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2100 | -c "client hello, adding CID extension" \ | 
|  | 2101 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2102 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2103 | -s "server hello, adding CID extension" \ | 
|  | 2104 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2105 | -c "Use of CID extension negotiated" \ | 
|  | 2106 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2107 | -c "Copy CIDs into SSL transform" \ | 
|  | 2108 | -c "Peer CID (length 2 Bytes): de ad" \ | 
|  | 2109 | -s "Peer CID (length 2 Bytes): be ef" \ | 
|  | 2110 | -s "Use of Connection ID has been negotiated" \ | 
|  | 2111 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2112 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2113 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2114 | 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] | 2115 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ | 
|  | 2116 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 2117 | 0 \ | 
|  | 2118 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2119 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2120 | -c "client hello, adding CID extension" \ | 
|  | 2121 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2122 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2123 | -s "server hello, adding CID extension" \ | 
|  | 2124 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2125 | -c "Use of CID extension negotiated" \ | 
|  | 2126 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2127 | -c "Copy CIDs into SSL transform" \ | 
|  | 2128 | -c "Peer CID (length 4 Bytes): de ad be ef" \ | 
|  | 2129 | -s "Peer CID (length 0 Bytes):" \ | 
|  | 2130 | -s "Use of Connection ID has been negotiated" \ | 
|  | 2131 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2132 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2133 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2134 | 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] | 2135 | "$P_SRV debug_level=3 dtls=1 cid=1" \ | 
|  | 2136 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 2137 | 0 \ | 
|  | 2138 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2139 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2140 | -c "client hello, adding CID extension" \ | 
|  | 2141 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2142 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2143 | -s "server hello, adding CID extension" \ | 
|  | 2144 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2145 | -c "Use of CID extension negotiated" \ | 
|  | 2146 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2147 | -c "Copy CIDs into SSL transform" \ | 
|  | 2148 | -s "Peer CID (length 4 Bytes): de ad be ef" \ | 
|  | 2149 | -c "Peer CID (length 0 Bytes):" \ | 
|  | 2150 | -s "Use of Connection ID has been negotiated" \ | 
|  | 2151 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2152 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2153 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2154 | 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] | 2155 | "$P_SRV debug_level=3 dtls=1 cid=1" \ | 
|  | 2156 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 2157 | 0 \ | 
|  | 2158 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2159 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2160 | -c "client hello, adding CID extension" \ | 
|  | 2161 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2162 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2163 | -s "server hello, adding CID extension" \ | 
|  | 2164 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2165 | -c "Use of CID extension negotiated" \ | 
|  | 2166 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2167 | -c "Copy CIDs into SSL transform" \ | 
|  | 2168 | -S "Use of Connection ID has been negotiated" \ | 
|  | 2169 | -C "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2170 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2171 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 2172 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2173 | run_test    "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2174 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ | 
|  | 2175 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ | 
|  | 2176 | 0 \ | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2177 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2178 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2179 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2180 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2181 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2182 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2183 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2184 | -c "(after renegotiation) Use of Connection ID has been negotiated" | 
|  | 2185 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2186 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2187 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2188 | run_test    "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2189 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ | 
|  | 2190 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ | 
|  | 2191 | 0 \ | 
|  | 2192 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2193 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2194 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2195 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2196 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2197 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2198 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2199 | -c "(after renegotiation) Use of Connection ID has been negotiated" | 
|  | 2200 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2201 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2202 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2203 | run_test    "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ | 
|  | 2204 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ | 
|  | 2205 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ | 
|  | 2206 | 0 \ | 
|  | 2207 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2208 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2209 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2210 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2211 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2212 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2213 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2214 | -c "(after renegotiation) Use of Connection ID has been negotiated" | 
|  | 2215 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2216 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2217 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2218 | 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] | 2219 | -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] | 2220 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ | 
|  | 2221 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ | 
|  | 2222 | 0 \ | 
|  | 2223 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2224 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2225 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2226 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2227 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2228 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2229 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2230 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2231 | -c "ignoring unexpected CID" \ | 
|  | 2232 | -s "ignoring unexpected CID" | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2233 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2234 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2235 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 2236 | run_test    "Connection ID: Cli+Srv enabled, renegotiate without CID" \ | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2237 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ | 
|  | 2238 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ | 
|  | 2239 | 0 \ | 
|  | 2240 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2241 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2242 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2243 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2244 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2245 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2246 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2247 | -S "(after renegotiation) Use of Connection ID has been negotiated" | 
|  | 2248 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2249 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2250 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2251 | run_test    "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ | 
|  | 2252 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ | 
|  | 2253 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ | 
|  | 2254 | 0 \ | 
|  | 2255 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2256 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2257 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2258 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2259 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2260 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2261 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2262 | -S "(after renegotiation) Use of Connection ID has been negotiated" | 
|  | 2263 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2264 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2265 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2266 | run_test    "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2267 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2268 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ | 
|  | 2269 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ | 
|  | 2270 | 0 \ | 
|  | 2271 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2272 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2273 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2274 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2275 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2276 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2277 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2278 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2279 | -c "ignoring unexpected CID" \ | 
|  | 2280 | -s "ignoring unexpected CID" | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2281 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2282 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2283 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 2284 | run_test    "Connection ID: Cli+Srv enabled, CID on renegotiation" \ | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2285 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ | 
|  | 2286 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ | 
|  | 2287 | 0 \ | 
|  | 2288 | -S "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2289 | -C "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2290 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2291 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2292 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2293 | -s "(after renegotiation) Use of Connection ID has been negotiated" | 
|  | 2294 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2295 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2296 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2297 | run_test    "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ | 
|  | 2298 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ | 
|  | 2299 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ | 
|  | 2300 | 0 \ | 
|  | 2301 | -S "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2302 | -C "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2303 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2304 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2305 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2306 | -s "(after renegotiation) Use of Connection ID has been negotiated" | 
|  | 2307 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2308 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2309 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2310 | run_test    "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2311 | -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] | 2312 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ | 
|  | 2313 | "$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" \ | 
|  | 2314 | 0 \ | 
|  | 2315 | -S "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2316 | -C "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2317 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2318 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2319 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2320 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2321 | -c "ignoring unexpected CID" \ | 
|  | 2322 | -s "ignoring unexpected CID" | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2323 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2324 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2325 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 2326 | run_test    "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2327 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ | 
|  | 2328 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ | 
|  | 2329 | 0 \ | 
|  | 2330 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2331 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2332 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2333 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2334 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2335 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2336 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2337 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2338 | -s "(after renegotiation) Use of Connection ID was not offered by client" | 
|  | 2339 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2340 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2341 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2342 | run_test    "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2343 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2344 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ | 
|  | 2345 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ | 
|  | 2346 | 0 \ | 
|  | 2347 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2348 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2349 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2350 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2351 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2352 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2353 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2354 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2355 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ | 
|  | 2356 | -c "ignoring unexpected CID" \ | 
|  | 2357 | -s "ignoring unexpected CID" | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2358 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2359 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2360 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 2361 | run_test    "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ | 
|  | 2362 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ | 
|  | 2363 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ | 
|  | 2364 | 0 \ | 
|  | 2365 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2366 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2367 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2368 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2369 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2370 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2371 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2372 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2373 | -c "(after renegotiation) Use of Connection ID was rejected by the server" | 
|  | 2374 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2375 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2376 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 2377 | run_test    "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2378 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2379 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ | 
|  | 2380 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ | 
|  | 2381 | 0 \ | 
|  | 2382 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2383 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2384 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2385 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2386 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2387 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2388 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2389 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2390 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ | 
|  | 2391 | -c "ignoring unexpected CID" \ | 
|  | 2392 | -s "ignoring unexpected CID" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2393 |  | 
| Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 2394 | # 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] | 2395 | # tests check that the buffer contents are reallocated when the message is | 
|  | 2396 | # larger than the buffer. | 
| Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2397 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 2398 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH | 
| Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2399 | requires_max_content_len 513 | 
| Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2400 | run_test    "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ | 
|  | 2401 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ | 
|  | 2402 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ | 
|  | 2403 | 0 \ | 
|  | 2404 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2405 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2406 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2407 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2408 | -s "Reallocating in_buf" \ | 
|  | 2409 | -s "Reallocating out_buf" | 
|  | 2410 |  | 
|  | 2411 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 2412 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH | 
| Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2413 | requires_max_content_len 1025 | 
| Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2414 | run_test    "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ | 
|  | 2415 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ | 
|  | 2416 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ | 
|  | 2417 | 0 \ | 
|  | 2418 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2419 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2420 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2421 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2422 | -s "Reallocating in_buf" \ | 
|  | 2423 | -s "Reallocating out_buf" | 
|  | 2424 |  | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2425 | # Tests for Encrypt-then-MAC extension | 
|  | 2426 |  | 
|  | 2427 | run_test    "Encrypt then MAC: default" \ | 
| Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2428 | "$P_SRV debug_level=3 \ | 
|  | 2429 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2430 | "$P_CLI debug_level=3" \ | 
|  | 2431 | 0 \ | 
|  | 2432 | -c "client hello, adding encrypt_then_mac extension" \ | 
|  | 2433 | -s "found encrypt then mac extension" \ | 
|  | 2434 | -s "server hello, adding encrypt then mac extension" \ | 
|  | 2435 | -c "found encrypt_then_mac extension" \ | 
|  | 2436 | -c "using encrypt then mac" \ | 
|  | 2437 | -s "using encrypt then mac" | 
|  | 2438 |  | 
|  | 2439 | run_test    "Encrypt then MAC: client enabled, server disabled" \ | 
| Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2440 | "$P_SRV debug_level=3 etm=0 \ | 
|  | 2441 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2442 | "$P_CLI debug_level=3 etm=1" \ | 
|  | 2443 | 0 \ | 
|  | 2444 | -c "client hello, adding encrypt_then_mac extension" \ | 
|  | 2445 | -s "found encrypt then mac extension" \ | 
|  | 2446 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 2447 | -C "found encrypt_then_mac extension" \ | 
|  | 2448 | -C "using encrypt then mac" \ | 
|  | 2449 | -S "using encrypt then mac" | 
|  | 2450 |  | 
| Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2451 | run_test    "Encrypt then MAC: client enabled, aead cipher" \ | 
|  | 2452 | "$P_SRV debug_level=3 etm=1 \ | 
|  | 2453 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ | 
|  | 2454 | "$P_CLI debug_level=3 etm=1" \ | 
|  | 2455 | 0 \ | 
|  | 2456 | -c "client hello, adding encrypt_then_mac extension" \ | 
|  | 2457 | -s "found encrypt then mac extension" \ | 
|  | 2458 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 2459 | -C "found encrypt_then_mac extension" \ | 
|  | 2460 | -C "using encrypt then mac" \ | 
|  | 2461 | -S "using encrypt then mac" | 
|  | 2462 |  | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2463 | run_test    "Encrypt then MAC: client disabled, server enabled" \ | 
| Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2464 | "$P_SRV debug_level=3 etm=1 \ | 
|  | 2465 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2466 | "$P_CLI debug_level=3 etm=0" \ | 
|  | 2467 | 0 \ | 
|  | 2468 | -C "client hello, adding encrypt_then_mac extension" \ | 
|  | 2469 | -S "found encrypt then mac extension" \ | 
|  | 2470 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 2471 | -C "found encrypt_then_mac extension" \ | 
|  | 2472 | -C "using encrypt then mac" \ | 
|  | 2473 | -S "using encrypt then mac" | 
|  | 2474 |  | 
| Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2475 | # Tests for Extended Master Secret extension | 
|  | 2476 |  | 
|  | 2477 | run_test    "Extended Master Secret: default" \ | 
|  | 2478 | "$P_SRV debug_level=3" \ | 
|  | 2479 | "$P_CLI debug_level=3" \ | 
|  | 2480 | 0 \ | 
|  | 2481 | -c "client hello, adding extended_master_secret extension" \ | 
|  | 2482 | -s "found extended master secret extension" \ | 
|  | 2483 | -s "server hello, adding extended master secret extension" \ | 
|  | 2484 | -c "found extended_master_secret extension" \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2485 | -c "session hash for extended master secret" \ | 
|  | 2486 | -s "session hash for extended master secret" | 
| Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2487 |  | 
|  | 2488 | run_test    "Extended Master Secret: client enabled, server disabled" \ | 
|  | 2489 | "$P_SRV debug_level=3 extended_ms=0" \ | 
|  | 2490 | "$P_CLI debug_level=3 extended_ms=1" \ | 
|  | 2491 | 0 \ | 
|  | 2492 | -c "client hello, adding extended_master_secret extension" \ | 
|  | 2493 | -s "found extended master secret extension" \ | 
|  | 2494 | -S "server hello, adding extended master secret extension" \ | 
|  | 2495 | -C "found extended_master_secret extension" \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2496 | -C "session hash for extended master secret" \ | 
|  | 2497 | -S "session hash for extended master secret" | 
| Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2498 |  | 
|  | 2499 | run_test    "Extended Master Secret: client disabled, server enabled" \ | 
|  | 2500 | "$P_SRV debug_level=3 extended_ms=1" \ | 
|  | 2501 | "$P_CLI debug_level=3 extended_ms=0" \ | 
|  | 2502 | 0 \ | 
|  | 2503 | -C "client hello, adding extended_master_secret extension" \ | 
|  | 2504 | -S "found extended master secret extension" \ | 
|  | 2505 | -S "server hello, adding extended master secret extension" \ | 
|  | 2506 | -C "found extended_master_secret extension" \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2507 | -C "session hash for extended master secret" \ | 
|  | 2508 | -S "session hash for extended master secret" | 
| Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2509 |  | 
| Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2510 | # Test sending and receiving empty application data records | 
|  | 2511 |  | 
|  | 2512 | run_test    "Encrypt then MAC: empty application data record" \ | 
|  | 2513 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ | 
|  | 2514 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 2515 | 0 \ | 
|  | 2516 | -S "0000:  0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ | 
|  | 2517 | -s "dumping 'input payload after decrypt' (0 bytes)" \ | 
|  | 2518 | -c "0 bytes written in 1 fragments" | 
|  | 2519 |  | 
| Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2520 | run_test    "Encrypt then MAC: disabled, empty application data record" \ | 
| Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2521 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ | 
|  | 2522 | "$P_CLI auth_mode=none etm=0 request_size=0" \ | 
|  | 2523 | 0 \ | 
|  | 2524 | -s "dumping 'input payload after decrypt' (0 bytes)" \ | 
|  | 2525 | -c "0 bytes written in 1 fragments" | 
|  | 2526 |  | 
|  | 2527 | run_test    "Encrypt then MAC, DTLS: empty application data record" \ | 
|  | 2528 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ | 
|  | 2529 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ | 
|  | 2530 | 0 \ | 
|  | 2531 | -S "0000:  0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ | 
|  | 2532 | -s "dumping 'input payload after decrypt' (0 bytes)" \ | 
|  | 2533 | -c "0 bytes written in 1 fragments" | 
|  | 2534 |  | 
| Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2535 | run_test    "Encrypt then MAC, DTLS: disabled, empty application data record" \ | 
| Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2536 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ | 
|  | 2537 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ | 
|  | 2538 | 0 \ | 
|  | 2539 | -s "dumping 'input payload after decrypt' (0 bytes)" \ | 
|  | 2540 | -c "0 bytes written in 1 fragments" | 
|  | 2541 |  | 
| Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2542 | # Tests for CBC 1/n-1 record splitting | 
|  | 2543 |  | 
|  | 2544 | run_test    "CBC Record splitting: TLS 1.2, no splitting" \ | 
|  | 2545 | "$P_SRV" \ | 
|  | 2546 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 2547 | request_size=123 force_version=tls1_2" \ | 
|  | 2548 | 0 \ | 
|  | 2549 | -s "Read from client: 123 bytes read" \ | 
|  | 2550 | -S "Read from client: 1 bytes read" \ | 
|  | 2551 | -S "122 bytes read" | 
|  | 2552 |  | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2553 | # Tests for Session Tickets | 
|  | 2554 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2555 | run_test    "Session resume using tickets: basic" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2556 | "$P_SRV debug_level=3 tickets=1" \ | 
|  | 2557 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2558 | 0 \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2559 | -c "client hello, adding session ticket extension" \ | 
|  | 2560 | -s "found session ticket extension" \ | 
|  | 2561 | -s "server hello, adding session ticket extension" \ | 
|  | 2562 | -c "found session_ticket extension" \ | 
|  | 2563 | -c "parse new session ticket" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2564 | -S "session successfully restored from cache" \ | 
|  | 2565 | -s "session successfully restored from ticket" \ | 
|  | 2566 | -s "a session has been resumed" \ | 
|  | 2567 | -c "a session has been resumed" | 
|  | 2568 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2569 | run_test    "Session resume using tickets: cache disabled" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2570 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ | 
|  | 2571 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2572 | 0 \ | 
|  | 2573 | -c "client hello, adding session ticket extension" \ | 
|  | 2574 | -s "found session ticket extension" \ | 
|  | 2575 | -s "server hello, adding session ticket extension" \ | 
|  | 2576 | -c "found session_ticket extension" \ | 
|  | 2577 | -c "parse new session ticket" \ | 
|  | 2578 | -S "session successfully restored from cache" \ | 
|  | 2579 | -s "session successfully restored from ticket" \ | 
|  | 2580 | -s "a session has been resumed" \ | 
|  | 2581 | -c "a session has been resumed" | 
|  | 2582 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2583 | run_test    "Session resume using tickets: timeout" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2584 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ | 
|  | 2585 | "$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] | 2586 | 0 \ | 
|  | 2587 | -c "client hello, adding session ticket extension" \ | 
|  | 2588 | -s "found session ticket extension" \ | 
|  | 2589 | -s "server hello, adding session ticket extension" \ | 
|  | 2590 | -c "found session_ticket extension" \ | 
|  | 2591 | -c "parse new session ticket" \ | 
|  | 2592 | -S "session successfully restored from cache" \ | 
|  | 2593 | -S "session successfully restored from ticket" \ | 
|  | 2594 | -S "a session has been resumed" \ | 
|  | 2595 | -C "a session has been resumed" | 
|  | 2596 |  | 
| Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2597 | run_test    "Session resume using tickets: session copy" \ | 
|  | 2598 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ | 
|  | 2599 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ | 
|  | 2600 | 0 \ | 
|  | 2601 | -c "client hello, adding session ticket extension" \ | 
|  | 2602 | -s "found session ticket extension" \ | 
|  | 2603 | -s "server hello, adding session ticket extension" \ | 
|  | 2604 | -c "found session_ticket extension" \ | 
|  | 2605 | -c "parse new session ticket" \ | 
|  | 2606 | -S "session successfully restored from cache" \ | 
|  | 2607 | -s "session successfully restored from ticket" \ | 
|  | 2608 | -s "a session has been resumed" \ | 
|  | 2609 | -c "a session has been resumed" | 
|  | 2610 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2611 | run_test    "Session resume using tickets: openssl server" \ | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2612 | "$O_SRV" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2613 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2614 | 0 \ | 
|  | 2615 | -c "client hello, adding session ticket extension" \ | 
|  | 2616 | -c "found session_ticket extension" \ | 
|  | 2617 | -c "parse new session ticket" \ | 
|  | 2618 | -c "a session has been resumed" | 
|  | 2619 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2620 | run_test    "Session resume using tickets: openssl client" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2621 | "$P_SRV debug_level=3 tickets=1" \ | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2622 | "( $O_CLI -sess_out $SESSION; \ | 
|  | 2623 | $O_CLI -sess_in $SESSION; \ | 
|  | 2624 | rm -f $SESSION )" \ | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2625 | 0 \ | 
|  | 2626 | -s "found session ticket extension" \ | 
|  | 2627 | -s "server hello, adding session ticket extension" \ | 
|  | 2628 | -S "session successfully restored from cache" \ | 
|  | 2629 | -s "session successfully restored from ticket" \ | 
|  | 2630 | -s "a session has been resumed" | 
|  | 2631 |  | 
| Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2632 | # Tests for Session Tickets with DTLS | 
|  | 2633 |  | 
|  | 2634 | run_test    "Session resume using tickets, DTLS: basic" \ | 
|  | 2635 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2636 | "$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] | 2637 | 0 \ | 
|  | 2638 | -c "client hello, adding session ticket extension" \ | 
|  | 2639 | -s "found session ticket extension" \ | 
|  | 2640 | -s "server hello, adding session ticket extension" \ | 
|  | 2641 | -c "found session_ticket extension" \ | 
|  | 2642 | -c "parse new session ticket" \ | 
|  | 2643 | -S "session successfully restored from cache" \ | 
|  | 2644 | -s "session successfully restored from ticket" \ | 
|  | 2645 | -s "a session has been resumed" \ | 
|  | 2646 | -c "a session has been resumed" | 
|  | 2647 |  | 
|  | 2648 | run_test    "Session resume using tickets, DTLS: cache disabled" \ | 
|  | 2649 | "$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] | 2650 | "$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] | 2651 | 0 \ | 
|  | 2652 | -c "client hello, adding session ticket extension" \ | 
|  | 2653 | -s "found session ticket extension" \ | 
|  | 2654 | -s "server hello, adding session ticket extension" \ | 
|  | 2655 | -c "found session_ticket extension" \ | 
|  | 2656 | -c "parse new session ticket" \ | 
|  | 2657 | -S "session successfully restored from cache" \ | 
|  | 2658 | -s "session successfully restored from ticket" \ | 
|  | 2659 | -s "a session has been resumed" \ | 
|  | 2660 | -c "a session has been resumed" | 
|  | 2661 |  | 
|  | 2662 | run_test    "Session resume using tickets, DTLS: timeout" \ | 
|  | 2663 | "$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] | 2664 | "$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] | 2665 | 0 \ | 
|  | 2666 | -c "client hello, adding session ticket extension" \ | 
|  | 2667 | -s "found session ticket extension" \ | 
|  | 2668 | -s "server hello, adding session ticket extension" \ | 
|  | 2669 | -c "found session_ticket extension" \ | 
|  | 2670 | -c "parse new session ticket" \ | 
|  | 2671 | -S "session successfully restored from cache" \ | 
|  | 2672 | -S "session successfully restored from ticket" \ | 
|  | 2673 | -S "a session has been resumed" \ | 
|  | 2674 | -C "a session has been resumed" | 
|  | 2675 |  | 
| Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2676 | run_test    "Session resume using tickets, DTLS: session copy" \ | 
|  | 2677 | "$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] | 2678 | "$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] | 2679 | 0 \ | 
|  | 2680 | -c "client hello, adding session ticket extension" \ | 
|  | 2681 | -s "found session ticket extension" \ | 
|  | 2682 | -s "server hello, adding session ticket extension" \ | 
|  | 2683 | -c "found session_ticket extension" \ | 
|  | 2684 | -c "parse new session ticket" \ | 
|  | 2685 | -S "session successfully restored from cache" \ | 
|  | 2686 | -s "session successfully restored from ticket" \ | 
|  | 2687 | -s "a session has been resumed" \ | 
|  | 2688 | -c "a session has been resumed" | 
|  | 2689 |  | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2690 | run_test    "Session resume using tickets, DTLS: openssl server" \ | 
|  | 2691 | "$O_SRV -dtls" \ | 
|  | 2692 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ | 
|  | 2693 | 0 \ | 
|  | 2694 | -c "client hello, adding session ticket extension" \ | 
|  | 2695 | -c "found session_ticket extension" \ | 
|  | 2696 | -c "parse new session ticket" \ | 
|  | 2697 | -c "a session has been resumed" | 
|  | 2698 |  | 
| Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 2699 | # 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] | 2700 | # 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] | 2701 | requires_openssl_next | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2702 | run_test    "Session resume using tickets, DTLS: openssl client" \ | 
|  | 2703 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ | 
| Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 2704 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ | 
|  | 2705 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2706 | rm -f $SESSION )" \ | 
|  | 2707 | 0 \ | 
|  | 2708 | -s "found session ticket extension" \ | 
|  | 2709 | -s "server hello, adding session ticket extension" \ | 
|  | 2710 | -S "session successfully restored from cache" \ | 
|  | 2711 | -s "session successfully restored from ticket" \ | 
|  | 2712 | -s "a session has been resumed" | 
|  | 2713 |  | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2714 | # Tests for Session Resume based on session-ID and cache | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2715 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2716 | run_test    "Session resume using cache: tickets enabled on client" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2717 | "$P_SRV debug_level=3 tickets=0" \ | 
|  | 2718 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2719 | 0 \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2720 | -c "client hello, adding session ticket extension" \ | 
|  | 2721 | -s "found session ticket extension" \ | 
|  | 2722 | -S "server hello, adding session ticket extension" \ | 
|  | 2723 | -C "found session_ticket extension" \ | 
|  | 2724 | -C "parse new session ticket" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2725 | -s "session successfully restored from cache" \ | 
|  | 2726 | -S "session successfully restored from ticket" \ | 
|  | 2727 | -s "a session has been resumed" \ | 
|  | 2728 | -c "a session has been resumed" | 
|  | 2729 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2730 | run_test    "Session resume using cache: tickets enabled on server" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2731 | "$P_SRV debug_level=3 tickets=1" \ | 
|  | 2732 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2733 | 0 \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2734 | -C "client hello, adding session ticket extension" \ | 
|  | 2735 | -S "found session ticket extension" \ | 
|  | 2736 | -S "server hello, adding session ticket extension" \ | 
|  | 2737 | -C "found session_ticket extension" \ | 
|  | 2738 | -C "parse new session ticket" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2739 | -s "session successfully restored from cache" \ | 
|  | 2740 | -S "session successfully restored from ticket" \ | 
|  | 2741 | -s "a session has been resumed" \ | 
|  | 2742 | -c "a session has been resumed" | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2743 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2744 | run_test    "Session resume using cache: cache_max=0" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2745 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ | 
|  | 2746 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2747 | 0 \ | 
|  | 2748 | -S "session successfully restored from cache" \ | 
|  | 2749 | -S "session successfully restored from ticket" \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2750 | -S "a session has been resumed" \ | 
|  | 2751 | -C "a session has been resumed" | 
| Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2752 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2753 | run_test    "Session resume using cache: cache_max=1" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2754 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ | 
|  | 2755 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2756 | 0 \ | 
|  | 2757 | -s "session successfully restored from cache" \ | 
|  | 2758 | -S "session successfully restored from ticket" \ | 
|  | 2759 | -s "a session has been resumed" \ | 
|  | 2760 | -c "a session has been resumed" | 
|  | 2761 |  | 
| Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 2762 | run_test    "Session resume using cache: timeout > delay" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2763 | "$P_SRV debug_level=3 tickets=0" \ | 
|  | 2764 | "$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] | 2765 | 0 \ | 
|  | 2766 | -s "session successfully restored from cache" \ | 
|  | 2767 | -S "session successfully restored from ticket" \ | 
|  | 2768 | -s "a session has been resumed" \ | 
|  | 2769 | -c "a session has been resumed" | 
|  | 2770 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2771 | run_test    "Session resume using cache: timeout < delay" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2772 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ | 
|  | 2773 | "$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] | 2774 | 0 \ | 
|  | 2775 | -S "session successfully restored from cache" \ | 
|  | 2776 | -S "session successfully restored from ticket" \ | 
|  | 2777 | -S "a session has been resumed" \ | 
|  | 2778 | -C "a session has been resumed" | 
|  | 2779 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2780 | run_test    "Session resume using cache: no timeout" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2781 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ | 
|  | 2782 | "$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] | 2783 | 0 \ | 
|  | 2784 | -s "session successfully restored from cache" \ | 
|  | 2785 | -S "session successfully restored from ticket" \ | 
|  | 2786 | -s "a session has been resumed" \ | 
|  | 2787 | -c "a session has been resumed" | 
|  | 2788 |  | 
| Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2789 | run_test    "Session resume using cache: session copy" \ | 
|  | 2790 | "$P_SRV debug_level=3 tickets=0" \ | 
|  | 2791 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ | 
|  | 2792 | 0 \ | 
|  | 2793 | -s "session successfully restored from cache" \ | 
|  | 2794 | -S "session successfully restored from ticket" \ | 
|  | 2795 | -s "a session has been resumed" \ | 
|  | 2796 | -c "a session has been resumed" | 
|  | 2797 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2798 | run_test    "Session resume using cache: openssl client" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2799 | "$P_SRV debug_level=3 tickets=0" \ | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2800 | "( $O_CLI -sess_out $SESSION; \ | 
|  | 2801 | $O_CLI -sess_in $SESSION; \ | 
|  | 2802 | rm -f $SESSION )" \ | 
| Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2803 | 0 \ | 
|  | 2804 | -s "found session ticket extension" \ | 
|  | 2805 | -S "server hello, adding session ticket extension" \ | 
|  | 2806 | -s "session successfully restored from cache" \ | 
|  | 2807 | -S "session successfully restored from ticket" \ | 
|  | 2808 | -s "a session has been resumed" | 
|  | 2809 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2810 | run_test    "Session resume using cache: openssl server" \ | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2811 | "$O_SRV" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2812 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2813 | 0 \ | 
|  | 2814 | -C "found session_ticket extension" \ | 
|  | 2815 | -C "parse new session ticket" \ | 
|  | 2816 | -c "a session has been resumed" | 
|  | 2817 |  | 
| Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2818 | # Tests for Session Resume based on session-ID and cache, DTLS | 
|  | 2819 |  | 
|  | 2820 | run_test    "Session resume using cache, DTLS: tickets enabled on client" \ | 
|  | 2821 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2822 | "$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] | 2823 | 0 \ | 
|  | 2824 | -c "client hello, adding session ticket extension" \ | 
|  | 2825 | -s "found session ticket extension" \ | 
|  | 2826 | -S "server hello, adding session ticket extension" \ | 
|  | 2827 | -C "found session_ticket extension" \ | 
|  | 2828 | -C "parse new session ticket" \ | 
|  | 2829 | -s "session successfully restored from cache" \ | 
|  | 2830 | -S "session successfully restored from ticket" \ | 
|  | 2831 | -s "a session has been resumed" \ | 
|  | 2832 | -c "a session has been resumed" | 
|  | 2833 |  | 
|  | 2834 | run_test    "Session resume using cache, DTLS: tickets enabled on server" \ | 
|  | 2835 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2836 | "$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] | 2837 | 0 \ | 
|  | 2838 | -C "client hello, adding session ticket extension" \ | 
|  | 2839 | -S "found session ticket extension" \ | 
|  | 2840 | -S "server hello, adding session ticket extension" \ | 
|  | 2841 | -C "found session_ticket extension" \ | 
|  | 2842 | -C "parse new session ticket" \ | 
|  | 2843 | -s "session successfully restored from cache" \ | 
|  | 2844 | -S "session successfully restored from ticket" \ | 
|  | 2845 | -s "a session has been resumed" \ | 
|  | 2846 | -c "a session has been resumed" | 
|  | 2847 |  | 
|  | 2848 | run_test    "Session resume using cache, DTLS: cache_max=0" \ | 
|  | 2849 | "$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] | 2850 | "$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] | 2851 | 0 \ | 
|  | 2852 | -S "session successfully restored from cache" \ | 
|  | 2853 | -S "session successfully restored from ticket" \ | 
|  | 2854 | -S "a session has been resumed" \ | 
|  | 2855 | -C "a session has been resumed" | 
|  | 2856 |  | 
|  | 2857 | run_test    "Session resume using cache, DTLS: cache_max=1" \ | 
|  | 2858 | "$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] | 2859 | "$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] | 2860 | 0 \ | 
|  | 2861 | -s "session successfully restored from cache" \ | 
|  | 2862 | -S "session successfully restored from ticket" \ | 
|  | 2863 | -s "a session has been resumed" \ | 
|  | 2864 | -c "a session has been resumed" | 
|  | 2865 |  | 
|  | 2866 | run_test    "Session resume using cache, DTLS: timeout > delay" \ | 
|  | 2867 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2868 | "$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] | 2869 | 0 \ | 
|  | 2870 | -s "session successfully restored from cache" \ | 
|  | 2871 | -S "session successfully restored from ticket" \ | 
|  | 2872 | -s "a session has been resumed" \ | 
|  | 2873 | -c "a session has been resumed" | 
|  | 2874 |  | 
|  | 2875 | run_test    "Session resume using cache, DTLS: timeout < delay" \ | 
|  | 2876 | "$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] | 2877 | "$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] | 2878 | 0 \ | 
|  | 2879 | -S "session successfully restored from cache" \ | 
|  | 2880 | -S "session successfully restored from ticket" \ | 
|  | 2881 | -S "a session has been resumed" \ | 
|  | 2882 | -C "a session has been resumed" | 
|  | 2883 |  | 
|  | 2884 | run_test    "Session resume using cache, DTLS: no timeout" \ | 
|  | 2885 | "$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] | 2886 | "$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] | 2887 | 0 \ | 
|  | 2888 | -s "session successfully restored from cache" \ | 
|  | 2889 | -S "session successfully restored from ticket" \ | 
|  | 2890 | -s "a session has been resumed" \ | 
|  | 2891 | -c "a session has been resumed" | 
|  | 2892 |  | 
| Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2893 | run_test    "Session resume using cache, DTLS: session copy" \ | 
|  | 2894 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2895 | "$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] | 2896 | 0 \ | 
|  | 2897 | -s "session successfully restored from cache" \ | 
|  | 2898 | -S "session successfully restored from ticket" \ | 
|  | 2899 | -s "a session has been resumed" \ | 
|  | 2900 | -c "a session has been resumed" | 
|  | 2901 |  | 
| Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 2902 | # 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] | 2903 | # 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] | 2904 | requires_openssl_next | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2905 | run_test    "Session resume using cache, DTLS: openssl client" \ | 
|  | 2906 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ | 
| Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 2907 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ | 
|  | 2908 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2909 | rm -f $SESSION )" \ | 
|  | 2910 | 0 \ | 
|  | 2911 | -s "found session ticket extension" \ | 
|  | 2912 | -S "server hello, adding session ticket extension" \ | 
|  | 2913 | -s "session successfully restored from cache" \ | 
|  | 2914 | -S "session successfully restored from ticket" \ | 
|  | 2915 | -s "a session has been resumed" | 
|  | 2916 |  | 
|  | 2917 | run_test    "Session resume using cache, DTLS: openssl server" \ | 
|  | 2918 | "$O_SRV -dtls" \ | 
|  | 2919 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ | 
|  | 2920 | 0 \ | 
|  | 2921 | -C "found session_ticket extension" \ | 
|  | 2922 | -C "parse new session ticket" \ | 
|  | 2923 | -c "a session has been resumed" | 
|  | 2924 |  | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2925 | # Tests for Max Fragment Length extension | 
|  | 2926 |  | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2927 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2928 | run_test    "Max fragment length: enabled, default" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2929 | "$P_SRV debug_level=3" \ | 
|  | 2930 | "$P_CLI debug_level=3" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2931 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2932 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ | 
|  | 2933 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ | 
|  | 2934 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ | 
|  | 2935 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2936 | -C "client hello, adding max_fragment_length extension" \ | 
|  | 2937 | -S "found max fragment length extension" \ | 
|  | 2938 | -S "server hello, max_fragment_length extension" \ | 
|  | 2939 | -C "found max_fragment_length extension" | 
|  | 2940 |  | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2941 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2942 | run_test    "Max fragment length: enabled, default, larger message" \ | 
|  | 2943 | "$P_SRV debug_level=3" \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2944 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2945 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2946 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ | 
|  | 2947 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ | 
|  | 2948 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ | 
|  | 2949 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2950 | -C "client hello, adding max_fragment_length extension" \ | 
|  | 2951 | -S "found max fragment length extension" \ | 
|  | 2952 | -S "server hello, max_fragment_length extension" \ | 
|  | 2953 | -C "found max_fragment_length extension" \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2954 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ | 
|  | 2955 | -s "$MAX_CONTENT_LEN bytes read" \ | 
| Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 2956 | -s "1 bytes read" | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2957 |  | 
|  | 2958 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 2959 | run_test    "Max fragment length, DTLS: enabled, default, larger message" \ | 
|  | 2960 | "$P_SRV debug_level=3 dtls=1" \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2961 | "$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] | 2962 | 1 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2963 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ | 
|  | 2964 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ | 
|  | 2965 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ | 
|  | 2966 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2967 | -C "client hello, adding max_fragment_length extension" \ | 
|  | 2968 | -S "found max fragment length extension" \ | 
|  | 2969 | -S "server hello, max_fragment_length extension" \ | 
|  | 2970 | -C "found max_fragment_length extension" \ | 
|  | 2971 | -c "fragment larger than.*maximum " | 
|  | 2972 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2973 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled | 
|  | 2974 | # (session fragment length will be 16384 regardless of mbedtls | 
|  | 2975 | # content length configuration.) | 
|  | 2976 |  | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2977 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 2978 | run_test    "Max fragment length: disabled, larger message" \ | 
|  | 2979 | "$P_SRV debug_level=3" \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2980 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2981 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2982 | -C "Maximum incoming record payload length is 16384" \ | 
|  | 2983 | -C "Maximum outgoing record payload length is 16384" \ | 
|  | 2984 | -S "Maximum incoming record payload length is 16384" \ | 
|  | 2985 | -S "Maximum outgoing record payload length is 16384" \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2986 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ | 
|  | 2987 | -s "$MAX_CONTENT_LEN bytes read" \ | 
| Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 2988 | -s "1 bytes read" | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2989 |  | 
|  | 2990 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 2991 | run_test    "Max fragment length, DTLS: disabled, larger message" \ | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2992 | "$P_SRV debug_level=3 dtls=1" \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2993 | "$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] | 2994 | 1 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2995 | -C "Maximum incoming record payload length is 16384" \ | 
|  | 2996 | -C "Maximum outgoing record payload length is 16384" \ | 
|  | 2997 | -S "Maximum incoming record payload length is 16384" \ | 
|  | 2998 | -S "Maximum outgoing record payload length is 16384" \ | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2999 | -c "fragment larger than.*maximum " | 
|  | 3000 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3001 | requires_max_content_len 4096 | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3002 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3003 | run_test    "Max fragment length: used by client" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3004 | "$P_SRV debug_level=3" \ | 
|  | 3005 | "$P_CLI debug_level=3 max_frag_len=4096" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3006 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3007 | -c "Maximum incoming record payload length is 4096" \ | 
|  | 3008 | -c "Maximum outgoing record payload length is 4096" \ | 
|  | 3009 | -s "Maximum incoming record payload length is 4096" \ | 
|  | 3010 | -s "Maximum outgoing record payload length is 4096" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3011 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3012 | -s "found max fragment length extension" \ | 
|  | 3013 | -s "server hello, max_fragment_length extension" \ | 
|  | 3014 | -c "found max_fragment_length extension" | 
|  | 3015 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3016 | requires_max_content_len 1024 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3017 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 3018 | run_test    "Max fragment length: client 512, server 1024" \ | 
|  | 3019 | "$P_SRV debug_level=3 max_frag_len=1024" \ | 
|  | 3020 | "$P_CLI debug_level=3 max_frag_len=512" \ | 
|  | 3021 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3022 | -c "Maximum incoming record payload length is 512" \ | 
|  | 3023 | -c "Maximum outgoing record payload length is 512" \ | 
|  | 3024 | -s "Maximum incoming record payload length is 512" \ | 
|  | 3025 | -s "Maximum outgoing record payload length is 512" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3026 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3027 | -s "found max fragment length extension" \ | 
|  | 3028 | -s "server hello, max_fragment_length extension" \ | 
|  | 3029 | -c "found max_fragment_length extension" | 
|  | 3030 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3031 | requires_max_content_len 2048 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3032 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 3033 | run_test    "Max fragment length: client 512, server 2048" \ | 
|  | 3034 | "$P_SRV debug_level=3 max_frag_len=2048" \ | 
|  | 3035 | "$P_CLI debug_level=3 max_frag_len=512" \ | 
|  | 3036 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3037 | -c "Maximum incoming record payload length is 512" \ | 
|  | 3038 | -c "Maximum outgoing record payload length is 512" \ | 
|  | 3039 | -s "Maximum incoming record payload length is 512" \ | 
|  | 3040 | -s "Maximum outgoing record payload length is 512" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3041 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3042 | -s "found max fragment length extension" \ | 
|  | 3043 | -s "server hello, max_fragment_length extension" \ | 
|  | 3044 | -c "found max_fragment_length extension" | 
|  | 3045 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3046 | requires_max_content_len 4096 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3047 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 3048 | run_test    "Max fragment length: client 512, server 4096" \ | 
|  | 3049 | "$P_SRV debug_level=3 max_frag_len=4096" \ | 
|  | 3050 | "$P_CLI debug_level=3 max_frag_len=512" \ | 
|  | 3051 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3052 | -c "Maximum incoming record payload length is 512" \ | 
|  | 3053 | -c "Maximum outgoing record payload length is 512" \ | 
|  | 3054 | -s "Maximum incoming record payload length is 512" \ | 
|  | 3055 | -s "Maximum outgoing record payload length is 512" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3056 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3057 | -s "found max fragment length extension" \ | 
|  | 3058 | -s "server hello, max_fragment_length extension" \ | 
|  | 3059 | -c "found max_fragment_length extension" | 
|  | 3060 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3061 | requires_max_content_len 1024 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3062 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 3063 | run_test    "Max fragment length: client 1024, server 512" \ | 
|  | 3064 | "$P_SRV debug_level=3 max_frag_len=512" \ | 
|  | 3065 | "$P_CLI debug_level=3 max_frag_len=1024" \ | 
|  | 3066 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3067 | -c "Maximum incoming record payload length is 1024" \ | 
|  | 3068 | -c "Maximum outgoing record payload length is 1024" \ | 
|  | 3069 | -s "Maximum incoming record payload length is 1024" \ | 
|  | 3070 | -s "Maximum outgoing record payload length is 512" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [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 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3076 | requires_max_content_len 2048 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3077 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 3078 | run_test    "Max fragment length: client 1024, server 2048" \ | 
|  | 3079 | "$P_SRV debug_level=3 max_frag_len=2048" \ | 
|  | 3080 | "$P_CLI debug_level=3 max_frag_len=1024" \ | 
|  | 3081 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3082 | -c "Maximum incoming record payload length is 1024" \ | 
|  | 3083 | -c "Maximum outgoing record payload length is 1024" \ | 
|  | 3084 | -s "Maximum incoming record payload length is 1024" \ | 
|  | 3085 | -s "Maximum outgoing record payload length is 1024" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3086 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3087 | -s "found max fragment length extension" \ | 
|  | 3088 | -s "server hello, max_fragment_length extension" \ | 
|  | 3089 | -c "found max_fragment_length extension" | 
|  | 3090 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3091 | requires_max_content_len 4096 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3092 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 3093 | run_test    "Max fragment length: client 1024, server 4096" \ | 
|  | 3094 | "$P_SRV debug_level=3 max_frag_len=4096" \ | 
|  | 3095 | "$P_CLI debug_level=3 max_frag_len=1024" \ | 
|  | 3096 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3097 | -c "Maximum incoming record payload length is 1024" \ | 
|  | 3098 | -c "Maximum outgoing record payload length is 1024" \ | 
|  | 3099 | -s "Maximum incoming record payload length is 1024" \ | 
|  | 3100 | -s "Maximum outgoing record payload length is 1024" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3101 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3102 | -s "found max fragment length extension" \ | 
|  | 3103 | -s "server hello, max_fragment_length extension" \ | 
|  | 3104 | -c "found max_fragment_length extension" | 
|  | 3105 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3106 | requires_max_content_len 2048 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3107 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 3108 | run_test    "Max fragment length: client 2048, server 512" \ | 
|  | 3109 | "$P_SRV debug_level=3 max_frag_len=512" \ | 
|  | 3110 | "$P_CLI debug_level=3 max_frag_len=2048" \ | 
|  | 3111 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3112 | -c "Maximum incoming record payload length is 2048" \ | 
|  | 3113 | -c "Maximum outgoing record payload length is 2048" \ | 
|  | 3114 | -s "Maximum incoming record payload length is 2048" \ | 
|  | 3115 | -s "Maximum outgoing record payload length is 512" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3116 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3117 | -s "found max fragment length extension" \ | 
|  | 3118 | -s "server hello, max_fragment_length extension" \ | 
|  | 3119 | -c "found max_fragment_length extension" | 
|  | 3120 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3121 | requires_max_content_len 2048 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3122 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 3123 | run_test    "Max fragment length: client 2048, server 1024" \ | 
|  | 3124 | "$P_SRV debug_level=3 max_frag_len=1024" \ | 
|  | 3125 | "$P_CLI debug_level=3 max_frag_len=2048" \ | 
|  | 3126 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3127 | -c "Maximum incoming record payload length is 2048" \ | 
|  | 3128 | -c "Maximum outgoing record payload length is 2048" \ | 
|  | 3129 | -s "Maximum incoming record payload length is 2048" \ | 
|  | 3130 | -s "Maximum outgoing record payload length is 1024" \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3131 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3132 | -s "found max fragment length extension" \ | 
|  | 3133 | -s "server hello, max_fragment_length extension" \ | 
|  | 3134 | -c "found max_fragment_length extension" | 
|  | 3135 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3136 | requires_max_content_len 4096 | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3137 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 3138 | run_test    "Max fragment length: client 2048, server 4096" \ | 
|  | 3139 | "$P_SRV debug_level=3 max_frag_len=4096" \ | 
|  | 3140 | "$P_CLI debug_level=3 max_frag_len=2048" \ | 
|  | 3141 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3142 | -c "Maximum incoming record payload length is 2048" \ | 
|  | 3143 | -c "Maximum outgoing record payload length is 2048" \ | 
|  | 3144 | -s "Maximum incoming record payload length is 2048" \ | 
|  | 3145 | -s "Maximum outgoing record payload length is 2048" \ | 
| 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 4096 | 
| 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 4096, server 512" \ | 
|  | 3154 | "$P_SRV debug_level=3 max_frag_len=512" \ | 
|  | 3155 | "$P_CLI debug_level=3 max_frag_len=4096" \ | 
|  | 3156 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3157 | -c "Maximum incoming record payload length is 4096" \ | 
|  | 3158 | -c "Maximum outgoing record payload length is 4096" \ | 
|  | 3159 | -s "Maximum incoming record payload length is 4096" \ | 
|  | 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 4096 | 
| 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 4096, server 1024" \ | 
|  | 3169 | "$P_SRV debug_level=3 max_frag_len=1024" \ | 
|  | 3170 | "$P_CLI debug_level=3 max_frag_len=4096" \ | 
|  | 3171 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3172 | -c "Maximum incoming record payload length is 4096" \ | 
|  | 3173 | -c "Maximum outgoing record payload length is 4096" \ | 
|  | 3174 | -s "Maximum incoming record payload length is 4096" \ | 
|  | 3175 | -s "Maximum outgoing record payload length is 1024" \ | 
| 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 4096, server 2048" \ | 
|  | 3184 | "$P_SRV debug_level=3 max_frag_len=2048" \ | 
|  | 3185 | "$P_CLI debug_level=3 max_frag_len=4096" \ | 
|  | 3186 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3187 | -c "Maximum incoming record payload length is 4096" \ | 
|  | 3188 | -c "Maximum outgoing record payload length is 4096" \ | 
|  | 3189 | -s "Maximum incoming record payload length is 4096" \ | 
|  | 3190 | -s "Maximum outgoing record payload length is 2048" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [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 4096 | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3197 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3198 | run_test    "Max fragment length: used by server" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3199 | "$P_SRV debug_level=3 max_frag_len=4096" \ | 
|  | 3200 | "$P_CLI debug_level=3" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3201 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3202 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ | 
|  | 3203 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ | 
|  | 3204 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ | 
|  | 3205 | -s "Maximum outgoing record payload length is 4096" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [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" | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3210 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3211 | requires_max_content_len 4096 | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3212 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3213 | requires_gnutls | 
|  | 3214 | run_test    "Max fragment length: gnutls server" \ | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3215 | "$G_SRV" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3216 | "$P_CLI debug_level=3 max_frag_len=4096" \ | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3217 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3218 | -c "Maximum incoming record payload length is 4096" \ | 
|  | 3219 | -c "Maximum outgoing record payload length is 4096" \ | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3220 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3221 | -c "found max_fragment_length extension" | 
|  | 3222 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3223 | requires_max_content_len 2048 | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3224 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3225 | run_test    "Max fragment length: client, message just fits" \ | 
|  | 3226 | "$P_SRV debug_level=3" \ | 
|  | 3227 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ | 
|  | 3228 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3229 | -c "Maximum incoming record payload length is 2048" \ | 
|  | 3230 | -c "Maximum outgoing record payload length is 2048" \ | 
|  | 3231 | -s "Maximum incoming record payload length is 2048" \ | 
|  | 3232 | -s "Maximum outgoing record payload length is 2048" \ | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3233 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3234 | -s "found max fragment length extension" \ | 
|  | 3235 | -s "server hello, max_fragment_length extension" \ | 
|  | 3236 | -c "found max_fragment_length extension" \ | 
|  | 3237 | -c "2048 bytes written in 1 fragments" \ | 
|  | 3238 | -s "2048 bytes read" | 
|  | 3239 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3240 | requires_max_content_len 2048 | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3241 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3242 | run_test    "Max fragment length: client, larger message" \ | 
|  | 3243 | "$P_SRV debug_level=3" \ | 
|  | 3244 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ | 
|  | 3245 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3246 | -c "Maximum incoming record payload length is 2048" \ | 
|  | 3247 | -c "Maximum outgoing record payload length is 2048" \ | 
|  | 3248 | -s "Maximum incoming record payload length is 2048" \ | 
|  | 3249 | -s "Maximum outgoing record payload length is 2048" \ | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3250 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3251 | -s "found max fragment length extension" \ | 
|  | 3252 | -s "server hello, max_fragment_length extension" \ | 
|  | 3253 | -c "found max_fragment_length extension" \ | 
|  | 3254 | -c "2345 bytes written in 2 fragments" \ | 
|  | 3255 | -s "2048 bytes read" \ | 
|  | 3256 | -s "297 bytes read" | 
|  | 3257 |  | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3258 | requires_max_content_len 2048 | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3259 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 3260 | run_test    "Max fragment length: DTLS client, larger message" \ | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3261 | "$P_SRV debug_level=3 dtls=1" \ | 
|  | 3262 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ | 
|  | 3263 | 1 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3264 | -c "Maximum incoming record payload length is 2048" \ | 
|  | 3265 | -c "Maximum outgoing record payload length is 2048" \ | 
|  | 3266 | -s "Maximum incoming record payload length is 2048" \ | 
|  | 3267 | -s "Maximum outgoing record payload length is 2048" \ | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3268 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3269 | -s "found max fragment length extension" \ | 
|  | 3270 | -s "server hello, max_fragment_length extension" \ | 
|  | 3271 | -c "found max_fragment_length extension" \ | 
|  | 3272 | -c "fragment larger than.*maximum" | 
|  | 3273 |  | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3274 | # Tests for renegotiation | 
|  | 3275 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3276 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3277 | run_test    "Renegotiation: none, for reference" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3278 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3279 | "$P_CLI debug_level=3 exchanges=2" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3280 | 0 \ | 
|  | 3281 | -C "client hello, adding renegotiation extension" \ | 
|  | 3282 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3283 | -S "found renegotiation extension" \ | 
|  | 3284 | -s "server hello, secure renegotiation extension" \ | 
|  | 3285 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3286 | -C "=> renegotiate" \ | 
|  | 3287 | -S "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3288 | -S "write hello request" | 
|  | 3289 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3290 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3291 | run_test    "Renegotiation: client-initiated" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3292 | "$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] | 3293 | "$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] | 3294 | 0 \ | 
|  | 3295 | -c "client hello, adding renegotiation extension" \ | 
|  | 3296 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3297 | -s "found renegotiation extension" \ | 
|  | 3298 | -s "server hello, secure renegotiation extension" \ | 
|  | 3299 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3300 | -c "=> renegotiate" \ | 
|  | 3301 | -s "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3302 | -S "write hello request" | 
|  | 3303 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3304 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3305 | run_test    "Renegotiation: server-initiated" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3306 | "$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] | 3307 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3308 | 0 \ | 
|  | 3309 | -c "client hello, adding renegotiation extension" \ | 
|  | 3310 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3311 | -s "found renegotiation extension" \ | 
|  | 3312 | -s "server hello, secure renegotiation extension" \ | 
|  | 3313 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3314 | -c "=> renegotiate" \ | 
|  | 3315 | -s "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3316 | -s "write hello request" | 
|  | 3317 |  | 
| Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3318 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that | 
|  | 3319 | # 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] | 3320 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3321 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3322 | run_test    "Renegotiation: Signature Algorithms parsing, client-initiated" \ | 
|  | 3323 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ | 
|  | 3324 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ | 
|  | 3325 | 0 \ | 
|  | 3326 | -c "client hello, adding renegotiation extension" \ | 
|  | 3327 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3328 | -s "found renegotiation extension" \ | 
|  | 3329 | -s "server hello, secure renegotiation extension" \ | 
|  | 3330 | -c "found renegotiation extension" \ | 
|  | 3331 | -c "=> renegotiate" \ | 
|  | 3332 | -s "=> renegotiate" \ | 
|  | 3333 | -S "write hello request" \ | 
|  | 3334 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? | 
|  | 3335 |  | 
|  | 3336 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that | 
|  | 3337 | # 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] | 3338 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3339 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3340 | run_test    "Renegotiation: Signature Algorithms parsing, server-initiated" \ | 
|  | 3341 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ | 
|  | 3342 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ | 
|  | 3343 | 0 \ | 
|  | 3344 | -c "client hello, adding renegotiation extension" \ | 
|  | 3345 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3346 | -s "found renegotiation extension" \ | 
|  | 3347 | -s "server hello, secure renegotiation extension" \ | 
|  | 3348 | -c "found renegotiation extension" \ | 
|  | 3349 | -c "=> renegotiate" \ | 
|  | 3350 | -s "=> renegotiate" \ | 
|  | 3351 | -s "write hello request" \ | 
|  | 3352 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? | 
|  | 3353 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3354 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3355 | run_test    "Renegotiation: double" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3356 | "$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] | 3357 | "$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] | 3358 | 0 \ | 
|  | 3359 | -c "client hello, adding renegotiation extension" \ | 
|  | 3360 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3361 | -s "found renegotiation extension" \ | 
|  | 3362 | -s "server hello, secure renegotiation extension" \ | 
|  | 3363 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3364 | -c "=> renegotiate" \ | 
|  | 3365 | -s "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3366 | -s "write hello request" | 
|  | 3367 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3368 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3369 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3370 | requires_max_content_len 2048 | 
| Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3371 | run_test    "Renegotiation with max fragment length: client 2048, server 512" \ | 
|  | 3372 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ | 
|  | 3373 | "$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" \ | 
|  | 3374 | 0 \ | 
| Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3375 | -c "Maximum incoming record payload length is 2048" \ | 
|  | 3376 | -c "Maximum outgoing record payload length is 2048" \ | 
|  | 3377 | -s "Maximum incoming record payload length is 2048" \ | 
|  | 3378 | -s "Maximum outgoing record payload length is 512" \ | 
| Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3379 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3380 | -s "found max fragment length extension" \ | 
|  | 3381 | -s "server hello, max_fragment_length extension" \ | 
|  | 3382 | -c "found max_fragment_length extension" \ | 
|  | 3383 | -c "client hello, adding renegotiation extension" \ | 
|  | 3384 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3385 | -s "found renegotiation extension" \ | 
|  | 3386 | -s "server hello, secure renegotiation extension" \ | 
|  | 3387 | -c "found renegotiation extension" \ | 
|  | 3388 | -c "=> renegotiate" \ | 
|  | 3389 | -s "=> renegotiate" \ | 
|  | 3390 | -s "write hello request" | 
|  | 3391 |  | 
|  | 3392 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3393 | run_test    "Renegotiation: client-initiated, server-rejected" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3394 | "$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] | 3395 | "$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] | 3396 | 1 \ | 
|  | 3397 | -c "client hello, adding renegotiation extension" \ | 
|  | 3398 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3399 | -S "found renegotiation extension" \ | 
|  | 3400 | -s "server hello, secure renegotiation extension" \ | 
|  | 3401 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3402 | -c "=> renegotiate" \ | 
|  | 3403 | -S "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3404 | -S "write hello request" \ | 
| Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 3405 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3406 | -c "failed" | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3407 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3408 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3409 | run_test    "Renegotiation: server-initiated, client-rejected, default" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3410 | "$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] | 3411 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3412 | 0 \ | 
|  | 3413 | -C "client hello, adding renegotiation extension" \ | 
|  | 3414 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3415 | -S "found renegotiation extension" \ | 
|  | 3416 | -s "server hello, secure renegotiation extension" \ | 
|  | 3417 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3418 | -C "=> renegotiate" \ | 
|  | 3419 | -S "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3420 | -s "write hello request" \ | 
| Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 3421 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 3422 | -S "failed" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3423 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3424 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3425 | run_test    "Renegotiation: server-initiated, client-rejected, not enforced" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3426 | "$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] | 3427 | renego_delay=-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=0" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [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" \ | 
|  | 3435 | -C "=> renegotiate" \ | 
|  | 3436 | -S "=> renegotiate" \ | 
|  | 3437 | -s "write hello request" \ | 
|  | 3438 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 3439 | -S "failed" | 
|  | 3440 |  | 
| Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3441 | # delay 2 for 1 alert record + 1 application data record | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3442 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3443 | run_test    "Renegotiation: server-initiated, client-rejected, delay 2" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3444 | "$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] | 3445 | renego_delay=2 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3446 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3447 | 0 \ | 
|  | 3448 | -C "client hello, adding renegotiation extension" \ | 
|  | 3449 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3450 | -S "found renegotiation extension" \ | 
|  | 3451 | -s "server hello, secure renegotiation extension" \ | 
|  | 3452 | -c "found renegotiation extension" \ | 
|  | 3453 | -C "=> renegotiate" \ | 
|  | 3454 | -S "=> renegotiate" \ | 
|  | 3455 | -s "write hello request" \ | 
|  | 3456 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 3457 | -S "failed" | 
|  | 3458 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3459 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3460 | run_test    "Renegotiation: server-initiated, client-rejected, delay 0" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3461 | "$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] | 3462 | renego_delay=0 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3463 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3464 | 0 \ | 
|  | 3465 | -C "client hello, adding renegotiation extension" \ | 
|  | 3466 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3467 | -S "found renegotiation extension" \ | 
|  | 3468 | -s "server hello, secure renegotiation extension" \ | 
|  | 3469 | -c "found renegotiation extension" \ | 
|  | 3470 | -C "=> renegotiate" \ | 
|  | 3471 | -S "=> renegotiate" \ | 
|  | 3472 | -s "write hello request" \ | 
| Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3473 | -s "SSL - An unexpected message was received from our peer" | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3474 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3475 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3476 | run_test    "Renegotiation: server-initiated, client-accepted, delay 0" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3477 | "$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] | 3478 | renego_delay=0 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3479 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3480 | 0 \ | 
|  | 3481 | -c "client hello, adding renegotiation extension" \ | 
|  | 3482 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3483 | -s "found renegotiation extension" \ | 
|  | 3484 | -s "server hello, secure renegotiation extension" \ | 
|  | 3485 | -c "found renegotiation extension" \ | 
|  | 3486 | -c "=> renegotiate" \ | 
|  | 3487 | -s "=> renegotiate" \ | 
|  | 3488 | -s "write hello request" \ | 
|  | 3489 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 3490 | -S "failed" | 
|  | 3491 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3492 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3493 | run_test    "Renegotiation: periodic, just below period" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3494 | "$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] | 3495 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ | 
|  | 3496 | 0 \ | 
|  | 3497 | -C "client hello, adding renegotiation extension" \ | 
|  | 3498 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3499 | -S "found renegotiation extension" \ | 
|  | 3500 | -s "server hello, secure renegotiation extension" \ | 
|  | 3501 | -c "found renegotiation extension" \ | 
|  | 3502 | -S "record counter limit reached: renegotiate" \ | 
|  | 3503 | -C "=> renegotiate" \ | 
|  | 3504 | -S "=> renegotiate" \ | 
|  | 3505 | -S "write hello request" \ | 
|  | 3506 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 3507 | -S "failed" | 
|  | 3508 |  | 
| Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 3509 | # one extra exchange to be able to complete renego | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3510 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3511 | run_test    "Renegotiation: periodic, just above period" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3512 | "$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] | 3513 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3514 | 0 \ | 
|  | 3515 | -c "client hello, adding renegotiation extension" \ | 
|  | 3516 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3517 | -s "found renegotiation extension" \ | 
|  | 3518 | -s "server hello, secure renegotiation extension" \ | 
|  | 3519 | -c "found renegotiation extension" \ | 
|  | 3520 | -s "record counter limit reached: renegotiate" \ | 
|  | 3521 | -c "=> renegotiate" \ | 
|  | 3522 | -s "=> renegotiate" \ | 
|  | 3523 | -s "write hello request" \ | 
|  | 3524 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 3525 | -S "failed" | 
|  | 3526 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3527 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3528 | run_test    "Renegotiation: periodic, two times period" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3529 | "$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] | 3530 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3531 | 0 \ | 
|  | 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" \ | 
|  | 3537 | -s "record counter limit reached: renegotiate" \ | 
|  | 3538 | -c "=> renegotiate" \ | 
|  | 3539 | -s "=> renegotiate" \ | 
|  | 3540 | -s "write hello request" \ | 
|  | 3541 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 3542 | -S "failed" | 
|  | 3543 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3544 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3545 | run_test    "Renegotiation: periodic, above period, disabled" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3546 | "$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] | 3547 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ | 
|  | 3548 | 0 \ | 
|  | 3549 | -C "client hello, adding renegotiation extension" \ | 
|  | 3550 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3551 | -S "found renegotiation extension" \ | 
|  | 3552 | -s "server hello, secure renegotiation extension" \ | 
|  | 3553 | -c "found renegotiation extension" \ | 
|  | 3554 | -S "record counter limit reached: renegotiate" \ | 
|  | 3555 | -C "=> renegotiate" \ | 
|  | 3556 | -S "=> renegotiate" \ | 
|  | 3557 | -S "write hello request" \ | 
|  | 3558 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 3559 | -S "failed" | 
|  | 3560 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3561 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3562 | run_test    "Renegotiation: nbio, client-initiated" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3563 | "$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] | 3564 | "$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] | 3565 | 0 \ | 
|  | 3566 | -c "client hello, adding renegotiation extension" \ | 
|  | 3567 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3568 | -s "found renegotiation extension" \ | 
|  | 3569 | -s "server hello, secure renegotiation extension" \ | 
|  | 3570 | -c "found renegotiation extension" \ | 
|  | 3571 | -c "=> renegotiate" \ | 
|  | 3572 | -s "=> renegotiate" \ | 
|  | 3573 | -S "write hello request" | 
|  | 3574 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3575 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3576 | run_test    "Renegotiation: nbio, server-initiated" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3577 | "$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] | 3578 | "$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] | 3579 | 0 \ | 
|  | 3580 | -c "client hello, adding renegotiation extension" \ | 
|  | 3581 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3582 | -s "found renegotiation extension" \ | 
|  | 3583 | -s "server hello, secure renegotiation extension" \ | 
|  | 3584 | -c "found renegotiation extension" \ | 
|  | 3585 | -c "=> renegotiate" \ | 
|  | 3586 | -s "=> renegotiate" \ | 
|  | 3587 | -s "write hello request" | 
|  | 3588 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3589 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3590 | run_test    "Renegotiation: openssl server, client-initiated" \ | 
| Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 3591 | "$O_SRV -www" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3592 | "$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] | 3593 | 0 \ | 
|  | 3594 | -c "client hello, adding renegotiation extension" \ | 
|  | 3595 | -c "found renegotiation extension" \ | 
|  | 3596 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3597 | -C "ssl_hanshake() returned" \ | 
| Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3598 | -C "error" \ | 
|  | 3599 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 3600 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3601 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3602 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3603 | run_test    "Renegotiation: gnutls server strict, client-initiated" \ | 
|  | 3604 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3605 | "$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] | 3606 | 0 \ | 
|  | 3607 | -c "client hello, adding renegotiation extension" \ | 
|  | 3608 | -c "found renegotiation extension" \ | 
|  | 3609 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3610 | -C "ssl_hanshake() returned" \ | 
| Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3611 | -C "error" \ | 
|  | 3612 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 3613 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3614 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3615 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3616 | run_test    "Renegotiation: gnutls server unsafe, client-initiated default" \ | 
|  | 3617 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 3618 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ | 
|  | 3619 | 1 \ | 
|  | 3620 | -c "client hello, adding renegotiation extension" \ | 
|  | 3621 | -C "found renegotiation extension" \ | 
|  | 3622 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3623 | -c "mbedtls_ssl_handshake() returned" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3624 | -c "error" \ | 
|  | 3625 | -C "HTTP/1.0 200 [Oo][Kk]" | 
|  | 3626 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3627 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3628 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3629 | run_test    "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ | 
|  | 3630 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 3631 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ | 
|  | 3632 | allow_legacy=0" \ | 
|  | 3633 | 1 \ | 
|  | 3634 | -c "client hello, adding renegotiation extension" \ | 
|  | 3635 | -C "found renegotiation extension" \ | 
|  | 3636 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3637 | -c "mbedtls_ssl_handshake() returned" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3638 | -c "error" \ | 
|  | 3639 | -C "HTTP/1.0 200 [Oo][Kk]" | 
|  | 3640 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3641 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3642 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3643 | run_test    "Renegotiation: gnutls server unsafe, client-inititated legacy" \ | 
|  | 3644 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 3645 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ | 
|  | 3646 | allow_legacy=1" \ | 
|  | 3647 | 0 \ | 
|  | 3648 | -c "client hello, adding renegotiation extension" \ | 
|  | 3649 | -C "found renegotiation extension" \ | 
|  | 3650 | -c "=> renegotiate" \ | 
|  | 3651 | -C "ssl_hanshake() returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3652 | -C "error" \ | 
|  | 3653 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 3654 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3655 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 3656 | run_test    "Renegotiation: DTLS, client-initiated" \ | 
|  | 3657 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ | 
|  | 3658 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ | 
|  | 3659 | 0 \ | 
|  | 3660 | -c "client hello, adding renegotiation extension" \ | 
|  | 3661 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3662 | -s "found renegotiation extension" \ | 
|  | 3663 | -s "server hello, secure renegotiation extension" \ | 
|  | 3664 | -c "found renegotiation extension" \ | 
|  | 3665 | -c "=> renegotiate" \ | 
|  | 3666 | -s "=> renegotiate" \ | 
|  | 3667 | -S "write hello request" | 
|  | 3668 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3669 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3670 | run_test    "Renegotiation: DTLS, server-initiated" \ | 
|  | 3671 | "$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] | 3672 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ | 
|  | 3673 | read_timeout=1000 max_resend=2" \ | 
| Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3674 | 0 \ | 
|  | 3675 | -c "client hello, adding renegotiation extension" \ | 
|  | 3676 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3677 | -s "found renegotiation extension" \ | 
|  | 3678 | -s "server hello, secure renegotiation extension" \ | 
|  | 3679 | -c "found renegotiation extension" \ | 
|  | 3680 | -c "=> renegotiate" \ | 
|  | 3681 | -s "=> renegotiate" \ | 
|  | 3682 | -s "write hello request" | 
|  | 3683 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3684 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3685 | run_test    "Renegotiation: DTLS, renego_period overflow" \ | 
|  | 3686 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ | 
|  | 3687 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ | 
|  | 3688 | 0 \ | 
|  | 3689 | -c "client hello, adding renegotiation extension" \ | 
|  | 3690 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3691 | -s "found renegotiation extension" \ | 
|  | 3692 | -s "server hello, secure renegotiation extension" \ | 
|  | 3693 | -s "record counter limit reached: renegotiate" \ | 
|  | 3694 | -c "=> renegotiate" \ | 
|  | 3695 | -s "=> renegotiate" \ | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3696 | -s "write hello request" | 
| Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3697 |  | 
| Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 3698 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3699 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3700 | run_test    "Renegotiation: DTLS, gnutls server, client-initiated" \ | 
|  | 3701 | "$G_SRV -u --mtu 4096" \ | 
|  | 3702 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ | 
|  | 3703 | 0 \ | 
|  | 3704 | -c "client hello, adding renegotiation extension" \ | 
|  | 3705 | -c "found renegotiation extension" \ | 
|  | 3706 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3707 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3708 | -C "error" \ | 
|  | 3709 | -s "Extra-header:" | 
|  | 3710 |  | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3711 | # Test for the "secure renegotation" extension only (no actual renegotiation) | 
|  | 3712 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3713 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3714 | run_test    "Renego ext: gnutls server strict, client default" \ | 
|  | 3715 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ | 
|  | 3716 | "$P_CLI debug_level=3" \ | 
|  | 3717 | 0 \ | 
|  | 3718 | -c "found renegotiation extension" \ | 
|  | 3719 | -C "error" \ | 
|  | 3720 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 3721 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3722 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3723 | run_test    "Renego ext: gnutls server unsafe, client default" \ | 
|  | 3724 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 3725 | "$P_CLI debug_level=3" \ | 
|  | 3726 | 0 \ | 
|  | 3727 | -C "found renegotiation extension" \ | 
|  | 3728 | -C "error" \ | 
|  | 3729 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 3730 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3731 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3732 | run_test    "Renego ext: gnutls server unsafe, client break legacy" \ | 
|  | 3733 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 3734 | "$P_CLI debug_level=3 allow_legacy=-1" \ | 
|  | 3735 | 1 \ | 
|  | 3736 | -C "found renegotiation extension" \ | 
|  | 3737 | -c "error" \ | 
|  | 3738 | -C "HTTP/1.0 200 [Oo][Kk]" | 
|  | 3739 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3740 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3741 | run_test    "Renego ext: gnutls client strict, server default" \ | 
|  | 3742 | "$P_SRV debug_level=3" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3743 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3744 | 0 \ | 
|  | 3745 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ | 
|  | 3746 | -s "server hello, secure renegotiation extension" | 
|  | 3747 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3748 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3749 | run_test    "Renego ext: gnutls client unsafe, server default" \ | 
|  | 3750 | "$P_SRV debug_level=3" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3751 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3752 | 0 \ | 
|  | 3753 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ | 
|  | 3754 | -S "server hello, secure renegotiation extension" | 
|  | 3755 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3756 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3757 | run_test    "Renego ext: gnutls client unsafe, server break legacy" \ | 
|  | 3758 | "$P_SRV debug_level=3 allow_legacy=-1" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3759 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3760 | 1 \ | 
|  | 3761 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ | 
|  | 3762 | -S "server hello, secure renegotiation extension" | 
|  | 3763 |  | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3764 | # Tests for silently dropping trailing extra bytes in .der certificates | 
|  | 3765 |  | 
|  | 3766 | requires_gnutls | 
|  | 3767 | run_test    "DER format: no trailing bytes" \ | 
|  | 3768 | "$P_SRV crt_file=data_files/server5-der0.crt \ | 
|  | 3769 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3770 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3771 | 0 \ | 
|  | 3772 | -c "Handshake was completed" \ | 
|  | 3773 |  | 
|  | 3774 | requires_gnutls | 
|  | 3775 | run_test    "DER format: with a trailing zero byte" \ | 
|  | 3776 | "$P_SRV crt_file=data_files/server5-der1a.crt \ | 
|  | 3777 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3778 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3779 | 0 \ | 
|  | 3780 | -c "Handshake was completed" \ | 
|  | 3781 |  | 
|  | 3782 | requires_gnutls | 
|  | 3783 | run_test    "DER format: with a trailing random byte" \ | 
|  | 3784 | "$P_SRV crt_file=data_files/server5-der1b.crt \ | 
|  | 3785 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3786 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3787 | 0 \ | 
|  | 3788 | -c "Handshake was completed" \ | 
|  | 3789 |  | 
|  | 3790 | requires_gnutls | 
|  | 3791 | run_test    "DER format: with 2 trailing random bytes" \ | 
|  | 3792 | "$P_SRV crt_file=data_files/server5-der2.crt \ | 
|  | 3793 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3794 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3795 | 0 \ | 
|  | 3796 | -c "Handshake was completed" \ | 
|  | 3797 |  | 
|  | 3798 | requires_gnutls | 
|  | 3799 | run_test    "DER format: with 4 trailing random bytes" \ | 
|  | 3800 | "$P_SRV crt_file=data_files/server5-der4.crt \ | 
|  | 3801 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3802 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3803 | 0 \ | 
|  | 3804 | -c "Handshake was completed" \ | 
|  | 3805 |  | 
|  | 3806 | requires_gnutls | 
|  | 3807 | run_test    "DER format: with 8 trailing random bytes" \ | 
|  | 3808 | "$P_SRV crt_file=data_files/server5-der8.crt \ | 
|  | 3809 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3810 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3811 | 0 \ | 
|  | 3812 | -c "Handshake was completed" \ | 
|  | 3813 |  | 
|  | 3814 | requires_gnutls | 
|  | 3815 | run_test    "DER format: with 9 trailing random bytes" \ | 
|  | 3816 | "$P_SRV crt_file=data_files/server5-der9.crt \ | 
|  | 3817 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3818 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3819 | 0 \ | 
|  | 3820 | -c "Handshake was completed" \ | 
|  | 3821 |  | 
| Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 3822 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication | 
|  | 3823 | # When updating these tests, modify the matching authentication tests accordingly | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3824 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3825 | run_test    "Authentication: server badcert, client required" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3826 | "$P_SRV crt_file=data_files/server5-badsign.crt \ | 
|  | 3827 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3828 | "$P_CLI debug_level=1 auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3829 | 1 \ | 
|  | 3830 | -c "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3831 | -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] | 3832 | -c "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3833 | -c "X509 - Certificate verification failed" | 
|  | 3834 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3835 | run_test    "Authentication: server badcert, client optional" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3836 | "$P_SRV crt_file=data_files/server5-badsign.crt \ | 
|  | 3837 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3838 | "$P_CLI debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3839 | 0 \ | 
|  | 3840 | -c "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3841 | -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] | 3842 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3843 | -C "X509 - Certificate verification failed" | 
|  | 3844 |  | 
| Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 3845 | run_test    "Authentication: server goodcert, client optional, no trusted CA" \ | 
|  | 3846 | "$P_SRV" \ | 
|  | 3847 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ | 
|  | 3848 | 0 \ | 
|  | 3849 | -c "x509_verify_cert() returned" \ | 
|  | 3850 | -c "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 3851 | -c "! Certificate verification flags"\ | 
|  | 3852 | -C "! mbedtls_ssl_handshake returned" \ | 
|  | 3853 | -C "X509 - Certificate verification failed" \ | 
|  | 3854 | -C "SSL - No CA Chain is set, but required to operate" | 
|  | 3855 |  | 
|  | 3856 | run_test    "Authentication: server goodcert, client required, no trusted CA" \ | 
|  | 3857 | "$P_SRV" \ | 
|  | 3858 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ | 
|  | 3859 | 1 \ | 
|  | 3860 | -c "x509_verify_cert() returned" \ | 
|  | 3861 | -c "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 3862 | -c "! Certificate verification flags"\ | 
|  | 3863 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 3864 | -c "SSL - No CA Chain is set, but required to operate" | 
|  | 3865 |  | 
|  | 3866 | # The purpose of the next two tests is to test the client's behaviour when receiving a server | 
|  | 3867 | # certificate with an unsupported elliptic curve. This should usually not happen because | 
|  | 3868 | # the client informs the server about the supported curves - it does, though, in the | 
|  | 3869 | # corner case of a static ECDH suite, because the server doesn't check the curve on that | 
|  | 3870 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a | 
|  | 3871 | # different means to have the server ignoring the client's supported curve list. | 
|  | 3872 |  | 
|  | 3873 | requires_config_enabled MBEDTLS_ECP_C | 
|  | 3874 | run_test    "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ | 
|  | 3875 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ | 
|  | 3876 | crt_file=data_files/server5.ku-ka.crt" \ | 
|  | 3877 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ | 
|  | 3878 | 1 \ | 
|  | 3879 | -c "bad certificate (EC key curve)"\ | 
|  | 3880 | -c "! Certificate verification flags"\ | 
|  | 3881 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage | 
|  | 3882 |  | 
|  | 3883 | requires_config_enabled MBEDTLS_ECP_C | 
|  | 3884 | run_test    "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ | 
|  | 3885 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ | 
|  | 3886 | crt_file=data_files/server5.ku-ka.crt" \ | 
|  | 3887 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ | 
|  | 3888 | 1 \ | 
|  | 3889 | -c "bad certificate (EC key curve)"\ | 
|  | 3890 | -c "! Certificate verification flags"\ | 
|  | 3891 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check | 
|  | 3892 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3893 | run_test    "Authentication: server badcert, client none" \ | 
| Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 3894 | "$P_SRV crt_file=data_files/server5-badsign.crt \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3895 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3896 | "$P_CLI debug_level=1 auth_mode=none" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3897 | 0 \ | 
|  | 3898 | -C "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3899 | -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] | 3900 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3901 | -C "X509 - Certificate verification failed" | 
|  | 3902 |  | 
| Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 3903 | run_test    "Authentication: client SHA256, server required" \ | 
|  | 3904 | "$P_SRV auth_mode=required" \ | 
|  | 3905 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ | 
|  | 3906 | key_file=data_files/server6.key \ | 
|  | 3907 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ | 
|  | 3908 | 0 \ | 
|  | 3909 | -c "Supported Signature Algorithm found: 4," \ | 
|  | 3910 | -c "Supported Signature Algorithm found: 5," | 
|  | 3911 |  | 
|  | 3912 | run_test    "Authentication: client SHA384, server required" \ | 
|  | 3913 | "$P_SRV auth_mode=required" \ | 
|  | 3914 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ | 
|  | 3915 | key_file=data_files/server6.key \ | 
|  | 3916 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ | 
|  | 3917 | 0 \ | 
|  | 3918 | -c "Supported Signature Algorithm found: 4," \ | 
|  | 3919 | -c "Supported Signature Algorithm found: 5," | 
|  | 3920 |  | 
| Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 3921 | run_test    "Authentication: client has no cert, server required (TLS)" \ | 
|  | 3922 | "$P_SRV debug_level=3 auth_mode=required" \ | 
|  | 3923 | "$P_CLI debug_level=3 crt_file=none \ | 
|  | 3924 | key_file=data_files/server5.key" \ | 
|  | 3925 | 1 \ | 
|  | 3926 | -S "skip write certificate request" \ | 
|  | 3927 | -C "skip parse certificate request" \ | 
|  | 3928 | -c "got a certificate request" \ | 
|  | 3929 | -c "= write certificate$" \ | 
|  | 3930 | -C "skip write certificate$" \ | 
|  | 3931 | -S "x509_verify_cert() returned" \ | 
|  | 3932 | -s "client has no certificate" \ | 
|  | 3933 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 3934 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 3935 | -s "No client certification received from the client, but required by the authentication mode" | 
|  | 3936 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3937 | run_test    "Authentication: client badcert, server required" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3938 | "$P_SRV debug_level=3 auth_mode=required" \ | 
|  | 3939 | "$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] | 3940 | key_file=data_files/server5.key" \ | 
|  | 3941 | 1 \ | 
|  | 3942 | -S "skip write certificate request" \ | 
|  | 3943 | -C "skip parse certificate request" \ | 
|  | 3944 | -c "got a certificate request" \ | 
|  | 3945 | -C "skip write certificate" \ | 
|  | 3946 | -C "skip write certificate verify" \ | 
|  | 3947 | -S "skip parse certificate verify" \ | 
|  | 3948 | -s "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3949 | -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] | 3950 | -s "! mbedtls_ssl_handshake returned" \ | 
| Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 3951 | -s "send alert level=2 message=48" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3952 | -c "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3953 | -s "X509 - Certificate verification failed" | 
| Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 3954 | # We don't check that the client receives the alert because it might | 
|  | 3955 | # detect that its write end of the connection is closed and abort | 
|  | 3956 | # before reading the alert message. | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3957 |  | 
| Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 3958 | run_test    "Authentication: client cert not trusted, server required" \ | 
|  | 3959 | "$P_SRV debug_level=3 auth_mode=required" \ | 
|  | 3960 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ | 
|  | 3961 | key_file=data_files/server5.key" \ | 
|  | 3962 | 1 \ | 
|  | 3963 | -S "skip write certificate request" \ | 
|  | 3964 | -C "skip parse certificate request" \ | 
|  | 3965 | -c "got a certificate request" \ | 
|  | 3966 | -C "skip write certificate" \ | 
|  | 3967 | -C "skip write certificate verify" \ | 
|  | 3968 | -S "skip parse certificate verify" \ | 
|  | 3969 | -s "x509_verify_cert() returned" \ | 
|  | 3970 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 3971 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 3972 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 3973 | -s "X509 - Certificate verification failed" | 
|  | 3974 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3975 | run_test    "Authentication: client badcert, server optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3976 | "$P_SRV debug_level=3 auth_mode=optional" \ | 
|  | 3977 | "$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] | 3978 | key_file=data_files/server5.key" \ | 
|  | 3979 | 0 \ | 
|  | 3980 | -S "skip write certificate request" \ | 
|  | 3981 | -C "skip parse certificate request" \ | 
|  | 3982 | -c "got a certificate request" \ | 
|  | 3983 | -C "skip write certificate" \ | 
|  | 3984 | -C "skip write certificate verify" \ | 
|  | 3985 | -S "skip parse certificate verify" \ | 
|  | 3986 | -s "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3987 | -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] | 3988 | -S "! mbedtls_ssl_handshake returned" \ | 
|  | 3989 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3990 | -S "X509 - Certificate verification failed" | 
|  | 3991 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3992 | run_test    "Authentication: client badcert, server none" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3993 | "$P_SRV debug_level=3 auth_mode=none" \ | 
|  | 3994 | "$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] | 3995 | key_file=data_files/server5.key" \ | 
|  | 3996 | 0 \ | 
|  | 3997 | -s "skip write certificate request" \ | 
|  | 3998 | -C "skip parse certificate request" \ | 
|  | 3999 | -c "got no certificate request" \ | 
|  | 4000 | -c "skip write certificate" \ | 
|  | 4001 | -c "skip write certificate verify" \ | 
|  | 4002 | -s "skip parse certificate verify" \ | 
|  | 4003 | -S "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4004 | -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] | 4005 | -S "! mbedtls_ssl_handshake returned" \ | 
|  | 4006 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4007 | -S "X509 - Certificate verification failed" | 
|  | 4008 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4009 | run_test    "Authentication: client no cert, server optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4010 | "$P_SRV debug_level=3 auth_mode=optional" \ | 
|  | 4011 | "$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] | 4012 | 0 \ | 
|  | 4013 | -S "skip write certificate request" \ | 
|  | 4014 | -C "skip parse certificate request" \ | 
|  | 4015 | -c "got a certificate request" \ | 
|  | 4016 | -C "skip write certificate$" \ | 
|  | 4017 | -C "got no certificate to send" \ | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4018 | -c "skip write certificate verify" \ | 
|  | 4019 | -s "skip parse certificate verify" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4020 | -s "! Certificate was missing" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4021 | -S "! mbedtls_ssl_handshake returned" \ | 
|  | 4022 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4023 | -S "X509 - Certificate verification failed" | 
|  | 4024 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4025 | run_test    "Authentication: openssl client no cert, server optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4026 | "$P_SRV debug_level=3 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4027 | "$O_CLI" \ | 
|  | 4028 | 0 \ | 
|  | 4029 | -S "skip write certificate request" \ | 
|  | 4030 | -s "skip parse certificate verify" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4031 | -s "! Certificate was missing" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4032 | -S "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4033 | -S "X509 - Certificate verification failed" | 
|  | 4034 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4035 | run_test    "Authentication: client no cert, openssl server optional" \ | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4036 | "$O_SRV -verify 10" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4037 | "$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] | 4038 | 0 \ | 
|  | 4039 | -C "skip parse certificate request" \ | 
|  | 4040 | -c "got a certificate request" \ | 
|  | 4041 | -C "skip write certificate$" \ | 
|  | 4042 | -c "skip write certificate verify" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4043 | -C "! mbedtls_ssl_handshake returned" | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4044 |  | 
| Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4045 | run_test    "Authentication: client no cert, openssl server required" \ | 
|  | 4046 | "$O_SRV -Verify 10" \ | 
|  | 4047 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ | 
|  | 4048 | 1 \ | 
|  | 4049 | -C "skip parse certificate request" \ | 
|  | 4050 | -c "got a certificate request" \ | 
|  | 4051 | -C "skip write certificate$" \ | 
|  | 4052 | -c "skip write certificate verify" \ | 
|  | 4053 | -c "! mbedtls_ssl_handshake returned" | 
|  | 4054 |  | 
| Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4055 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default | 
|  | 4056 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the | 
|  | 4057 | # library is configured with a different value. | 
| Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4058 |  | 
| Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4059 | MAX_IM_CA='8' | 
| Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4060 |  | 
| Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4061 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA | 
|  | 4062 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 | 
|  | 4063 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions | 
|  | 4064 | # 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] | 4065 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4066 | requires_full_size_output_buffer | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4067 | run_test    "Authentication: server max_int chain, client default" \ | 
|  | 4068 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ | 
|  | 4069 | key_file=data_files/dir-maxpath/09.key" \ | 
|  | 4070 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ | 
|  | 4071 | 0 \ | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4072 | -C "X509 - A fatal error occurred" | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4073 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4074 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4075 | requires_full_size_output_buffer | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4076 | run_test    "Authentication: server max_int+1 chain, client default" \ | 
|  | 4077 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 4078 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 4079 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ | 
|  | 4080 | 1 \ | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4081 | -c "X509 - A fatal error occurred" | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4082 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4083 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4084 | requires_full_size_output_buffer | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4085 | run_test    "Authentication: server max_int+1 chain, client optional" \ | 
|  | 4086 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 4087 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 4088 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ | 
|  | 4089 | auth_mode=optional" \ | 
|  | 4090 | 1 \ | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4091 | -c "X509 - A fatal error occurred" | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4092 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4093 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4094 | requires_full_size_output_buffer | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4095 | run_test    "Authentication: server max_int+1 chain, client none" \ | 
|  | 4096 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 4097 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 4098 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ | 
|  | 4099 | auth_mode=none" \ | 
|  | 4100 | 0 \ | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4101 | -C "X509 - A fatal error occurred" | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4102 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4103 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4104 | requires_full_size_output_buffer | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4105 | run_test    "Authentication: client max_int+1 chain, server default" \ | 
|  | 4106 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ | 
|  | 4107 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 4108 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 4109 | 0 \ | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4110 | -S "X509 - A fatal error occurred" | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4111 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4112 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4113 | requires_full_size_output_buffer | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4114 | run_test    "Authentication: client max_int+1 chain, server optional" \ | 
|  | 4115 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ | 
|  | 4116 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 4117 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 4118 | 1 \ | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4119 | -s "X509 - A fatal error occurred" | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4120 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4121 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4122 | requires_full_size_output_buffer | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4123 | run_test    "Authentication: client max_int+1 chain, server required" \ | 
|  | 4124 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ | 
|  | 4125 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 4126 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 4127 | 1 \ | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4128 | -s "X509 - A fatal error occurred" | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4129 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4130 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4131 | requires_full_size_output_buffer | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4132 | run_test    "Authentication: client max_int chain, server required" \ | 
|  | 4133 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ | 
|  | 4134 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ | 
|  | 4135 | key_file=data_files/dir-maxpath/09.key" \ | 
|  | 4136 | 0 \ | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4137 | -S "X509 - A fatal error occurred" | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4138 |  | 
| Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4139 | # Tests for CA list in CertificateRequest messages | 
|  | 4140 |  | 
|  | 4141 | run_test    "Authentication: send CA list in CertificateRequest  (default)" \ | 
|  | 4142 | "$P_SRV debug_level=3 auth_mode=required" \ | 
|  | 4143 | "$P_CLI crt_file=data_files/server6.crt \ | 
|  | 4144 | key_file=data_files/server6.key" \ | 
|  | 4145 | 0 \ | 
|  | 4146 | -s "requested DN" | 
|  | 4147 |  | 
|  | 4148 | run_test    "Authentication: do not send CA list in CertificateRequest" \ | 
|  | 4149 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ | 
|  | 4150 | "$P_CLI crt_file=data_files/server6.crt \ | 
|  | 4151 | key_file=data_files/server6.key" \ | 
|  | 4152 | 0 \ | 
|  | 4153 | -S "requested DN" | 
|  | 4154 |  | 
|  | 4155 | run_test    "Authentication: send CA list in CertificateRequest, client self signed" \ | 
|  | 4156 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ | 
|  | 4157 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ | 
|  | 4158 | key_file=data_files/server5.key" \ | 
|  | 4159 | 1 \ | 
|  | 4160 | -S "requested DN" \ | 
|  | 4161 | -s "x509_verify_cert() returned" \ | 
|  | 4162 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4163 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 4164 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 4165 | -s "X509 - Certificate verification failed" | 
|  | 4166 |  | 
| Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4167 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests | 
|  | 4168 | # When updating these tests, modify the matching authentication tests accordingly | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4169 |  | 
|  | 4170 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 4171 | run_test    "Authentication, CA callback: server badcert, client required" \ | 
|  | 4172 | "$P_SRV crt_file=data_files/server5-badsign.crt \ | 
|  | 4173 | key_file=data_files/server5.key" \ | 
|  | 4174 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ | 
|  | 4175 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4176 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4177 | -c "x509_verify_cert() returned" \ | 
|  | 4178 | -c "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4179 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 4180 | -c "X509 - Certificate verification failed" | 
|  | 4181 |  | 
|  | 4182 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 4183 | run_test    "Authentication, CA callback: server badcert, client optional" \ | 
|  | 4184 | "$P_SRV crt_file=data_files/server5-badsign.crt \ | 
|  | 4185 | key_file=data_files/server5.key" \ | 
|  | 4186 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ | 
|  | 4187 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4188 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4189 | -c "x509_verify_cert() returned" \ | 
|  | 4190 | -c "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4191 | -C "! mbedtls_ssl_handshake returned" \ | 
|  | 4192 | -C "X509 - Certificate verification failed" | 
|  | 4193 |  | 
|  | 4194 | # The purpose of the next two tests is to test the client's behaviour when receiving a server | 
|  | 4195 | # certificate with an unsupported elliptic curve. This should usually not happen because | 
|  | 4196 | # the client informs the server about the supported curves - it does, though, in the | 
|  | 4197 | # corner case of a static ECDH suite, because the server doesn't check the curve on that | 
|  | 4198 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a | 
|  | 4199 | # different means to have the server ignoring the client's supported curve list. | 
|  | 4200 |  | 
|  | 4201 | requires_config_enabled MBEDTLS_ECP_C | 
|  | 4202 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 4203 | run_test    "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ | 
|  | 4204 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ | 
|  | 4205 | crt_file=data_files/server5.ku-ka.crt" \ | 
|  | 4206 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ | 
|  | 4207 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4208 | -c "use CA callback for X.509 CRT verification" \ | 
|  | 4209 | -c "bad certificate (EC key curve)" \ | 
|  | 4210 | -c "! Certificate verification flags" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4211 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage | 
|  | 4212 |  | 
|  | 4213 | requires_config_enabled MBEDTLS_ECP_C | 
|  | 4214 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 4215 | run_test    "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ | 
|  | 4216 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ | 
|  | 4217 | crt_file=data_files/server5.ku-ka.crt" \ | 
|  | 4218 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ | 
|  | 4219 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4220 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4221 | -c "bad certificate (EC key curve)"\ | 
|  | 4222 | -c "! Certificate verification flags"\ | 
|  | 4223 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check | 
|  | 4224 |  | 
|  | 4225 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 4226 | run_test    "Authentication, CA callback: client SHA256, server required" \ | 
|  | 4227 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ | 
|  | 4228 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ | 
|  | 4229 | key_file=data_files/server6.key \ | 
|  | 4230 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ | 
|  | 4231 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4232 | -s "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4233 | -c "Supported Signature Algorithm found: 4," \ | 
|  | 4234 | -c "Supported Signature Algorithm found: 5," | 
|  | 4235 |  | 
|  | 4236 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 4237 | run_test    "Authentication, CA callback: client SHA384, server required" \ | 
|  | 4238 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ | 
|  | 4239 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ | 
|  | 4240 | key_file=data_files/server6.key \ | 
|  | 4241 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ | 
|  | 4242 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4243 | -s "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4244 | -c "Supported Signature Algorithm found: 4," \ | 
|  | 4245 | -c "Supported Signature Algorithm found: 5," | 
|  | 4246 |  | 
|  | 4247 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 4248 | run_test    "Authentication, CA callback: client badcert, server required" \ | 
|  | 4249 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ | 
|  | 4250 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ | 
|  | 4251 | key_file=data_files/server5.key" \ | 
|  | 4252 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4253 | -s "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4254 | -S "skip write certificate request" \ | 
|  | 4255 | -C "skip parse certificate request" \ | 
|  | 4256 | -c "got a certificate request" \ | 
|  | 4257 | -C "skip write certificate" \ | 
|  | 4258 | -C "skip write certificate verify" \ | 
|  | 4259 | -S "skip parse certificate verify" \ | 
|  | 4260 | -s "x509_verify_cert() returned" \ | 
|  | 4261 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4262 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 4263 | -s "send alert level=2 message=48" \ | 
|  | 4264 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 4265 | -s "X509 - Certificate verification failed" | 
|  | 4266 | # We don't check that the client receives the alert because it might | 
|  | 4267 | # detect that its write end of the connection is closed and abort | 
|  | 4268 | # before reading the alert message. | 
|  | 4269 |  | 
|  | 4270 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 4271 | run_test    "Authentication, CA callback: client cert not trusted, server required" \ | 
|  | 4272 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ | 
|  | 4273 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ | 
|  | 4274 | key_file=data_files/server5.key" \ | 
|  | 4275 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4276 | -s "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4277 | -S "skip write certificate request" \ | 
|  | 4278 | -C "skip parse certificate request" \ | 
|  | 4279 | -c "got a certificate request" \ | 
|  | 4280 | -C "skip write certificate" \ | 
|  | 4281 | -C "skip write certificate verify" \ | 
|  | 4282 | -S "skip parse certificate verify" \ | 
|  | 4283 | -s "x509_verify_cert() returned" \ | 
|  | 4284 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4285 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 4286 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 4287 | -s "X509 - Certificate verification failed" | 
|  | 4288 |  | 
|  | 4289 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 4290 | run_test    "Authentication, CA callback: client badcert, server optional" \ | 
|  | 4291 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ | 
|  | 4292 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ | 
|  | 4293 | key_file=data_files/server5.key" \ | 
|  | 4294 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4295 | -s "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4296 | -S "skip write certificate request" \ | 
|  | 4297 | -C "skip parse certificate request" \ | 
|  | 4298 | -c "got a certificate request" \ | 
|  | 4299 | -C "skip write certificate" \ | 
|  | 4300 | -C "skip write certificate verify" \ | 
|  | 4301 | -S "skip parse certificate verify" \ | 
|  | 4302 | -s "x509_verify_cert() returned" \ | 
|  | 4303 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4304 | -S "! mbedtls_ssl_handshake returned" \ | 
|  | 4305 | -C "! mbedtls_ssl_handshake returned" \ | 
|  | 4306 | -S "X509 - Certificate verification failed" | 
|  | 4307 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4308 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4309 | requires_full_size_output_buffer | 
|  | 4310 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 4311 | run_test    "Authentication, CA callback: server max_int chain, client default" \ | 
|  | 4312 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ | 
|  | 4313 | key_file=data_files/dir-maxpath/09.key" \ | 
|  | 4314 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ | 
|  | 4315 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4316 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4317 | -C "X509 - A fatal error occurred" | 
|  | 4318 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4319 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4320 | requires_full_size_output_buffer | 
|  | 4321 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 4322 | run_test    "Authentication, CA callback: server max_int+1 chain, client default" \ | 
|  | 4323 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 4324 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 4325 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ | 
|  | 4326 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4327 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4328 | -c "X509 - A fatal error occurred" | 
|  | 4329 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4330 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4331 | requires_full_size_output_buffer | 
|  | 4332 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 4333 | run_test    "Authentication, CA callback: server max_int+1 chain, client optional" \ | 
|  | 4334 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 4335 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 4336 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ | 
|  | 4337 | debug_level=3 auth_mode=optional" \ | 
|  | 4338 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4339 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4340 | -c "X509 - A fatal error occurred" | 
|  | 4341 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4342 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4343 | requires_full_size_output_buffer | 
|  | 4344 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 4345 | run_test    "Authentication, CA callback: client max_int+1 chain, server optional" \ | 
|  | 4346 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ | 
|  | 4347 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 4348 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 4349 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4350 | -s "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4351 | -s "X509 - A fatal error occurred" | 
|  | 4352 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4353 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4354 | requires_full_size_output_buffer | 
|  | 4355 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 4356 | run_test    "Authentication, CA callback: client max_int+1 chain, server required" \ | 
|  | 4357 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ | 
|  | 4358 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 4359 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 4360 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4361 | -s "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4362 | -s "X509 - A fatal error occurred" | 
|  | 4363 |  | 
| Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4364 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4365 | requires_full_size_output_buffer | 
|  | 4366 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 4367 | run_test    "Authentication, CA callback: client max_int chain, server required" \ | 
|  | 4368 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ | 
|  | 4369 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ | 
|  | 4370 | key_file=data_files/dir-maxpath/09.key" \ | 
|  | 4371 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4372 | -s "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4373 | -S "X509 - A fatal error occurred" | 
|  | 4374 |  | 
| Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4375 | # Tests for certificate selection based on SHA verson | 
|  | 4376 |  | 
| Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4377 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO | 
| Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4378 | run_test    "Certificate hash: client TLS 1.2 -> SHA-2" \ | 
|  | 4379 | "$P_SRV crt_file=data_files/server5.crt \ | 
|  | 4380 | key_file=data_files/server5.key \ | 
|  | 4381 | crt_file2=data_files/server5-sha1.crt \ | 
|  | 4382 | key_file2=data_files/server5.key" \ | 
|  | 4383 | "$P_CLI force_version=tls1_2" \ | 
|  | 4384 | 0 \ | 
|  | 4385 | -c "signed using.*ECDSA with SHA256" \ | 
|  | 4386 | -C "signed using.*ECDSA with SHA1" | 
|  | 4387 |  | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4388 | # tests for SNI | 
|  | 4389 |  | 
| Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4390 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4391 | run_test    "SNI: no SNI callback" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4392 | "$P_SRV debug_level=3 \ | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4393 | 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] | 4394 | "$P_CLI server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4395 | 0 \ | 
|  | 4396 | -S "parse ServerName extension" \ | 
|  | 4397 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ | 
|  | 4398 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4399 |  | 
| Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4400 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4401 | run_test    "SNI: matching cert 1" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4402 | "$P_SRV debug_level=3 \ | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4403 | 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] | 4404 | 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] | 4405 | "$P_CLI server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4406 | 0 \ | 
|  | 4407 | -s "parse ServerName extension" \ | 
|  | 4408 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ | 
|  | 4409 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4410 |  | 
| Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4411 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4412 | run_test    "SNI: matching cert 2" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4413 | "$P_SRV debug_level=3 \ | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4414 | 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] | 4415 | 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] | 4416 | "$P_CLI server_name=polarssl.example" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4417 | 0 \ | 
|  | 4418 | -s "parse ServerName extension" \ | 
|  | 4419 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ | 
|  | 4420 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4421 |  | 
| Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4422 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4423 | run_test    "SNI: no matching cert" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4424 | "$P_SRV debug_level=3 \ | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4425 | 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] | 4426 | 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] | 4427 | "$P_CLI server_name=nonesuch.example" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4428 | 1 \ | 
|  | 4429 | -s "parse ServerName extension" \ | 
|  | 4430 | -s "ssl_sni_wrapper() returned" \ | 
|  | 4431 | -s "mbedtls_ssl_handshake returned" \ | 
|  | 4432 | -c "mbedtls_ssl_handshake returned" \ | 
|  | 4433 | -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] | 4434 |  | 
| Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4435 | run_test    "SNI: client auth no override: optional" \ | 
|  | 4436 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 4437 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4438 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ | 
|  | 4439 | "$P_CLI debug_level=3 server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4440 | 0 \ | 
| Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4441 | -S "skip write certificate request" \ | 
|  | 4442 | -C "skip parse certificate request" \ | 
|  | 4443 | -c "got a certificate request" \ | 
|  | 4444 | -C "skip write certificate" \ | 
|  | 4445 | -C "skip write certificate verify" \ | 
|  | 4446 | -S "skip parse certificate verify" | 
|  | 4447 |  | 
|  | 4448 | run_test    "SNI: client auth override: none -> optional" \ | 
|  | 4449 | "$P_SRV debug_level=3 auth_mode=none \ | 
|  | 4450 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4451 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ | 
|  | 4452 | "$P_CLI debug_level=3 server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4453 | 0 \ | 
| Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4454 | -S "skip write certificate request" \ | 
|  | 4455 | -C "skip parse certificate request" \ | 
|  | 4456 | -c "got a certificate request" \ | 
|  | 4457 | -C "skip write certificate" \ | 
|  | 4458 | -C "skip write certificate verify" \ | 
|  | 4459 | -S "skip parse certificate verify" | 
|  | 4460 |  | 
|  | 4461 | run_test    "SNI: client auth override: optional -> none" \ | 
|  | 4462 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 4463 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4464 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ | 
|  | 4465 | "$P_CLI debug_level=3 server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4466 | 0 \ | 
| Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4467 | -s "skip write certificate request" \ | 
|  | 4468 | -C "skip parse certificate request" \ | 
|  | 4469 | -c "got no certificate request" \ | 
|  | 4470 | -c "skip write certificate" \ | 
|  | 4471 | -c "skip write certificate verify" \ | 
|  | 4472 | -s "skip parse certificate verify" | 
|  | 4473 |  | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4474 | run_test    "SNI: CA no override" \ | 
|  | 4475 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 4476 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4477 | ca_file=data_files/test-ca.crt \ | 
|  | 4478 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ | 
|  | 4479 | "$P_CLI debug_level=3 server_name=localhost \ | 
|  | 4480 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 4481 | 1 \ | 
|  | 4482 | -S "skip write certificate request" \ | 
|  | 4483 | -C "skip parse certificate request" \ | 
|  | 4484 | -c "got a certificate request" \ | 
|  | 4485 | -C "skip write certificate" \ | 
|  | 4486 | -C "skip write certificate verify" \ | 
|  | 4487 | -S "skip parse certificate verify" \ | 
|  | 4488 | -s "x509_verify_cert() returned" \ | 
|  | 4489 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4490 | -S "The certificate has been revoked (is on a CRL)" | 
|  | 4491 |  | 
|  | 4492 | run_test    "SNI: CA override" \ | 
|  | 4493 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 4494 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4495 | ca_file=data_files/test-ca.crt \ | 
|  | 4496 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ | 
|  | 4497 | "$P_CLI debug_level=3 server_name=localhost \ | 
|  | 4498 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 4499 | 0 \ | 
|  | 4500 | -S "skip write certificate request" \ | 
|  | 4501 | -C "skip parse certificate request" \ | 
|  | 4502 | -c "got a certificate request" \ | 
|  | 4503 | -C "skip write certificate" \ | 
|  | 4504 | -C "skip write certificate verify" \ | 
|  | 4505 | -S "skip parse certificate verify" \ | 
|  | 4506 | -S "x509_verify_cert() returned" \ | 
|  | 4507 | -S "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4508 | -S "The certificate has been revoked (is on a CRL)" | 
|  | 4509 |  | 
|  | 4510 | run_test    "SNI: CA override with CRL" \ | 
|  | 4511 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 4512 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4513 | ca_file=data_files/test-ca.crt \ | 
|  | 4514 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ | 
|  | 4515 | "$P_CLI debug_level=3 server_name=localhost \ | 
|  | 4516 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 4517 | 1 \ | 
|  | 4518 | -S "skip write certificate request" \ | 
|  | 4519 | -C "skip parse certificate request" \ | 
|  | 4520 | -c "got a certificate request" \ | 
|  | 4521 | -C "skip write certificate" \ | 
|  | 4522 | -C "skip write certificate verify" \ | 
|  | 4523 | -S "skip parse certificate verify" \ | 
|  | 4524 | -s "x509_verify_cert() returned" \ | 
|  | 4525 | -S "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4526 | -s "The certificate has been revoked (is on a CRL)" | 
|  | 4527 |  | 
| Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4528 | # Tests for SNI and DTLS | 
|  | 4529 |  | 
| Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4530 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO | 
| Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4531 | run_test    "SNI: DTLS, no SNI callback" \ | 
|  | 4532 | "$P_SRV debug_level=3 dtls=1 \ | 
|  | 4533 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ | 
|  | 4534 | "$P_CLI server_name=localhost dtls=1" \ | 
|  | 4535 | 0 \ | 
|  | 4536 | -S "parse ServerName extension" \ | 
|  | 4537 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ | 
|  | 4538 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" | 
|  | 4539 |  | 
| Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4540 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO | 
| Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4541 | run_test    "SNI: DTLS, matching cert 1" \ | 
| Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4542 | "$P_SRV debug_level=3 dtls=1 \ | 
|  | 4543 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4544 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ | 
|  | 4545 | "$P_CLI server_name=localhost dtls=1" \ | 
|  | 4546 | 0 \ | 
|  | 4547 | -s "parse ServerName extension" \ | 
|  | 4548 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ | 
|  | 4549 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" | 
|  | 4550 |  | 
| Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4551 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO | 
| Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4552 | run_test    "SNI: DTLS, matching cert 2" \ | 
|  | 4553 | "$P_SRV debug_level=3 dtls=1 \ | 
|  | 4554 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4555 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ | 
|  | 4556 | "$P_CLI server_name=polarssl.example dtls=1" \ | 
|  | 4557 | 0 \ | 
|  | 4558 | -s "parse ServerName extension" \ | 
|  | 4559 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ | 
|  | 4560 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" | 
|  | 4561 |  | 
|  | 4562 | run_test    "SNI: DTLS, no matching cert" \ | 
|  | 4563 | "$P_SRV debug_level=3 dtls=1 \ | 
|  | 4564 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4565 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ | 
|  | 4566 | "$P_CLI server_name=nonesuch.example dtls=1" \ | 
|  | 4567 | 1 \ | 
|  | 4568 | -s "parse ServerName extension" \ | 
|  | 4569 | -s "ssl_sni_wrapper() returned" \ | 
|  | 4570 | -s "mbedtls_ssl_handshake returned" \ | 
|  | 4571 | -c "mbedtls_ssl_handshake returned" \ | 
|  | 4572 | -c "SSL - A fatal alert message was received from our peer" | 
|  | 4573 |  | 
|  | 4574 | run_test    "SNI: DTLS, client auth no override: optional" \ | 
|  | 4575 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ | 
|  | 4576 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4577 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ | 
|  | 4578 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ | 
|  | 4579 | 0 \ | 
|  | 4580 | -S "skip write certificate request" \ | 
|  | 4581 | -C "skip parse certificate request" \ | 
|  | 4582 | -c "got a certificate request" \ | 
|  | 4583 | -C "skip write certificate" \ | 
|  | 4584 | -C "skip write certificate verify" \ | 
|  | 4585 | -S "skip parse certificate verify" | 
|  | 4586 |  | 
|  | 4587 | run_test    "SNI: DTLS, client auth override: none -> optional" \ | 
|  | 4588 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ | 
|  | 4589 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4590 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ | 
|  | 4591 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ | 
|  | 4592 | 0 \ | 
|  | 4593 | -S "skip write certificate request" \ | 
|  | 4594 | -C "skip parse certificate request" \ | 
|  | 4595 | -c "got a certificate request" \ | 
|  | 4596 | -C "skip write certificate" \ | 
|  | 4597 | -C "skip write certificate verify" \ | 
|  | 4598 | -S "skip parse certificate verify" | 
|  | 4599 |  | 
|  | 4600 | run_test    "SNI: DTLS, client auth override: optional -> none" \ | 
|  | 4601 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ | 
|  | 4602 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4603 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ | 
|  | 4604 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ | 
|  | 4605 | 0 \ | 
|  | 4606 | -s "skip write certificate request" \ | 
|  | 4607 | -C "skip parse certificate request" \ | 
|  | 4608 | -c "got no certificate request" \ | 
|  | 4609 | -c "skip write certificate" \ | 
|  | 4610 | -c "skip write certificate verify" \ | 
|  | 4611 | -s "skip parse certificate verify" | 
|  | 4612 |  | 
|  | 4613 | run_test    "SNI: DTLS, CA no override" \ | 
|  | 4614 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ | 
|  | 4615 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4616 | ca_file=data_files/test-ca.crt \ | 
|  | 4617 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ | 
|  | 4618 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ | 
|  | 4619 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 4620 | 1 \ | 
|  | 4621 | -S "skip write certificate request" \ | 
|  | 4622 | -C "skip parse certificate request" \ | 
|  | 4623 | -c "got a certificate request" \ | 
|  | 4624 | -C "skip write certificate" \ | 
|  | 4625 | -C "skip write certificate verify" \ | 
|  | 4626 | -S "skip parse certificate verify" \ | 
|  | 4627 | -s "x509_verify_cert() returned" \ | 
|  | 4628 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4629 | -S "The certificate has been revoked (is on a CRL)" | 
|  | 4630 |  | 
| Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4631 | run_test    "SNI: DTLS, CA override" \ | 
| Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4632 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ | 
|  | 4633 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4634 | ca_file=data_files/test-ca.crt \ | 
|  | 4635 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ | 
|  | 4636 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ | 
|  | 4637 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 4638 | 0 \ | 
|  | 4639 | -S "skip write certificate request" \ | 
|  | 4640 | -C "skip parse certificate request" \ | 
|  | 4641 | -c "got a certificate request" \ | 
|  | 4642 | -C "skip write certificate" \ | 
|  | 4643 | -C "skip write certificate verify" \ | 
|  | 4644 | -S "skip parse certificate verify" \ | 
|  | 4645 | -S "x509_verify_cert() returned" \ | 
|  | 4646 | -S "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4647 | -S "The certificate has been revoked (is on a CRL)" | 
|  | 4648 |  | 
| Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4649 | run_test    "SNI: DTLS, CA override with CRL" \ | 
| Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4650 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 4651 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ | 
|  | 4652 | ca_file=data_files/test-ca.crt \ | 
|  | 4653 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ | 
|  | 4654 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ | 
|  | 4655 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 4656 | 1 \ | 
|  | 4657 | -S "skip write certificate request" \ | 
|  | 4658 | -C "skip parse certificate request" \ | 
|  | 4659 | -c "got a certificate request" \ | 
|  | 4660 | -C "skip write certificate" \ | 
|  | 4661 | -C "skip write certificate verify" \ | 
|  | 4662 | -S "skip parse certificate verify" \ | 
|  | 4663 | -s "x509_verify_cert() returned" \ | 
|  | 4664 | -S "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4665 | -s "The certificate has been revoked (is on a CRL)" | 
|  | 4666 |  | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4667 | # Tests for non-blocking I/O: exercise a variety of handshake flows | 
|  | 4668 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4669 | run_test    "Non-blocking I/O: basic handshake" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4670 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ | 
|  | 4671 | "$P_CLI nbio=2 tickets=0" \ | 
|  | 4672 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4673 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4674 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4675 | -c "Read from server: .* bytes read" | 
|  | 4676 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4677 | run_test    "Non-blocking I/O: client auth" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4678 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ | 
|  | 4679 | "$P_CLI nbio=2 tickets=0" \ | 
|  | 4680 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4681 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4682 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4683 | -c "Read from server: .* bytes read" | 
|  | 4684 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4685 | run_test    "Non-blocking I/O: ticket" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4686 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ | 
|  | 4687 | "$P_CLI nbio=2 tickets=1" \ | 
|  | 4688 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4689 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4690 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4691 | -c "Read from server: .* bytes read" | 
|  | 4692 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4693 | run_test    "Non-blocking I/O: ticket + client auth" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4694 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ | 
|  | 4695 | "$P_CLI nbio=2 tickets=1" \ | 
|  | 4696 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4697 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4698 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4699 | -c "Read from server: .* bytes read" | 
|  | 4700 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4701 | run_test    "Non-blocking I/O: ticket + client auth + resume" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4702 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ | 
|  | 4703 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ | 
|  | 4704 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4705 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4706 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4707 | -c "Read from server: .* bytes read" | 
|  | 4708 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4709 | run_test    "Non-blocking I/O: ticket + resume" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4710 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ | 
|  | 4711 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ | 
|  | 4712 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4713 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4714 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4715 | -c "Read from server: .* bytes read" | 
|  | 4716 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4717 | run_test    "Non-blocking I/O: session-id resume" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4718 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ | 
|  | 4719 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ | 
|  | 4720 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4721 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4722 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4723 | -c "Read from server: .* bytes read" | 
|  | 4724 |  | 
| Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 4725 | # Tests for event-driven I/O: exercise a variety of handshake flows | 
|  | 4726 |  | 
|  | 4727 | run_test    "Event-driven I/O: basic handshake" \ | 
|  | 4728 | "$P_SRV event=1 tickets=0 auth_mode=none" \ | 
|  | 4729 | "$P_CLI event=1 tickets=0" \ | 
|  | 4730 | 0 \ | 
|  | 4731 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4732 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 4733 | -c "Read from server: .* bytes read" | 
|  | 4734 |  | 
|  | 4735 | run_test    "Event-driven I/O: client auth" \ | 
|  | 4736 | "$P_SRV event=1 tickets=0 auth_mode=required" \ | 
|  | 4737 | "$P_CLI event=1 tickets=0" \ | 
|  | 4738 | 0 \ | 
|  | 4739 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4740 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 4741 | -c "Read from server: .* bytes read" | 
|  | 4742 |  | 
|  | 4743 | run_test    "Event-driven I/O: ticket" \ | 
|  | 4744 | "$P_SRV event=1 tickets=1 auth_mode=none" \ | 
|  | 4745 | "$P_CLI event=1 tickets=1" \ | 
|  | 4746 | 0 \ | 
|  | 4747 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4748 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 4749 | -c "Read from server: .* bytes read" | 
|  | 4750 |  | 
|  | 4751 | run_test    "Event-driven I/O: ticket + client auth" \ | 
|  | 4752 | "$P_SRV event=1 tickets=1 auth_mode=required" \ | 
|  | 4753 | "$P_CLI event=1 tickets=1" \ | 
|  | 4754 | 0 \ | 
|  | 4755 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4756 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 4757 | -c "Read from server: .* bytes read" | 
|  | 4758 |  | 
|  | 4759 | run_test    "Event-driven I/O: ticket + client auth + resume" \ | 
|  | 4760 | "$P_SRV event=1 tickets=1 auth_mode=required" \ | 
|  | 4761 | "$P_CLI event=1 tickets=1 reconnect=1" \ | 
|  | 4762 | 0 \ | 
|  | 4763 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4764 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 4765 | -c "Read from server: .* bytes read" | 
|  | 4766 |  | 
|  | 4767 | run_test    "Event-driven I/O: ticket + resume" \ | 
|  | 4768 | "$P_SRV event=1 tickets=1 auth_mode=none" \ | 
|  | 4769 | "$P_CLI event=1 tickets=1 reconnect=1" \ | 
|  | 4770 | 0 \ | 
|  | 4771 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4772 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 4773 | -c "Read from server: .* bytes read" | 
|  | 4774 |  | 
|  | 4775 | run_test    "Event-driven I/O: session-id resume" \ | 
|  | 4776 | "$P_SRV event=1 tickets=0 auth_mode=none" \ | 
|  | 4777 | "$P_CLI event=1 tickets=0 reconnect=1" \ | 
|  | 4778 | 0 \ | 
|  | 4779 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4780 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 4781 | -c "Read from server: .* bytes read" | 
|  | 4782 |  | 
| Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 4783 | run_test    "Event-driven I/O, DTLS: basic handshake" \ | 
|  | 4784 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ | 
|  | 4785 | "$P_CLI dtls=1 event=1 tickets=0" \ | 
|  | 4786 | 0 \ | 
|  | 4787 | -c "Read from server: .* bytes read" | 
|  | 4788 |  | 
|  | 4789 | run_test    "Event-driven I/O, DTLS: client auth" \ | 
|  | 4790 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ | 
|  | 4791 | "$P_CLI dtls=1 event=1 tickets=0" \ | 
|  | 4792 | 0 \ | 
|  | 4793 | -c "Read from server: .* bytes read" | 
|  | 4794 |  | 
|  | 4795 | run_test    "Event-driven I/O, DTLS: ticket" \ | 
|  | 4796 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ | 
|  | 4797 | "$P_CLI dtls=1 event=1 tickets=1" \ | 
|  | 4798 | 0 \ | 
|  | 4799 | -c "Read from server: .* bytes read" | 
|  | 4800 |  | 
|  | 4801 | run_test    "Event-driven I/O, DTLS: ticket + client auth" \ | 
|  | 4802 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ | 
|  | 4803 | "$P_CLI dtls=1 event=1 tickets=1" \ | 
|  | 4804 | 0 \ | 
|  | 4805 | -c "Read from server: .* bytes read" | 
|  | 4806 |  | 
|  | 4807 | run_test    "Event-driven I/O, DTLS: ticket + client auth + resume" \ | 
|  | 4808 | "$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] | 4809 | "$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] | 4810 | 0 \ | 
|  | 4811 | -c "Read from server: .* bytes read" | 
|  | 4812 |  | 
|  | 4813 | run_test    "Event-driven I/O, DTLS: ticket + resume" \ | 
|  | 4814 | "$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] | 4815 | "$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] | 4816 | 0 \ | 
|  | 4817 | -c "Read from server: .* bytes read" | 
|  | 4818 |  | 
|  | 4819 | run_test    "Event-driven I/O, DTLS: session-id resume" \ | 
|  | 4820 | "$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] | 4821 | "$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] | 4822 | 0 \ | 
|  | 4823 | -c "Read from server: .* bytes read" | 
| Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4824 |  | 
|  | 4825 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. | 
|  | 4826 | # During session resumption, the client will send its ApplicationData record | 
|  | 4827 | # within the same datagram as the Finished messages. In this situation, the | 
|  | 4828 | # server MUST NOT idle on the underlying transport after handshake completion, | 
|  | 4829 | # because the ApplicationData request has already been queued internally. | 
|  | 4830 | run_test    "Event-driven I/O, DTLS: session-id resume, UDP packing" \ | 
| Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 4831 | -p "$P_PXY pack=50" \ | 
| Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4832 | "$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] | 4833 | "$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] | 4834 | 0 \ | 
|  | 4835 | -c "Read from server: .* bytes read" | 
|  | 4836 |  | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4837 | # Tests for version negotiation | 
|  | 4838 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4839 | run_test    "Version check: all -> 1.2" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4840 | "$P_SRV" \ | 
|  | 4841 | "$P_CLI" \ | 
|  | 4842 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4843 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4844 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4845 | -s "Protocol is TLSv1.2" \ | 
|  | 4846 | -c "Protocol is TLSv1.2" | 
|  | 4847 |  | 
| TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 4848 | run_test    "Not supported version check: cli TLS 1.0" \ | 
|  | 4849 | "$P_SRV" \ | 
|  | 4850 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ | 
|  | 4851 | 1 \ | 
|  | 4852 | -s "Handshake protocol not within min/max boundaries" \ | 
|  | 4853 | -c "Error in protocol version" \ | 
|  | 4854 | -S "Protocol is TLSv1.0" \ | 
|  | 4855 | -C "Handshake was completed" | 
|  | 4856 |  | 
|  | 4857 | run_test    "Not supported version check: cli TLS 1.1" \ | 
|  | 4858 | "$P_SRV" \ | 
|  | 4859 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ | 
|  | 4860 | 1 \ | 
|  | 4861 | -s "Handshake protocol not within min/max boundaries" \ | 
|  | 4862 | -c "Error in protocol version" \ | 
|  | 4863 | -S "Protocol is TLSv1.1" \ | 
|  | 4864 | -C "Handshake was completed" | 
|  | 4865 |  | 
|  | 4866 | run_test    "Not supported version check: srv max TLS 1.0" \ | 
|  | 4867 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ | 
|  | 4868 | "$P_CLI" \ | 
|  | 4869 | 1 \ | 
|  | 4870 | -s "Error in protocol version" \ | 
|  | 4871 | -c "Handshake protocol not within min/max boundaries" \ | 
|  | 4872 | -S "Version: TLS1.0" \ | 
|  | 4873 | -C "Protocol is TLSv1.0" | 
|  | 4874 |  | 
|  | 4875 | run_test    "Not supported version check: srv max TLS 1.1" \ | 
|  | 4876 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ | 
|  | 4877 | "$P_CLI" \ | 
|  | 4878 | 1 \ | 
|  | 4879 | -s "Error in protocol version" \ | 
|  | 4880 | -c "Handshake protocol not within min/max boundaries" \ | 
|  | 4881 | -S "Version: TLS1.1" \ | 
|  | 4882 | -C "Protocol is TLSv1.1" | 
|  | 4883 |  | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4884 | # Tests for ALPN extension | 
|  | 4885 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4886 | run_test    "ALPN: none" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4887 | "$P_SRV debug_level=3" \ | 
|  | 4888 | "$P_CLI debug_level=3" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4889 | 0 \ | 
|  | 4890 | -C "client hello, adding alpn extension" \ | 
|  | 4891 | -S "found alpn extension" \ | 
|  | 4892 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 4893 | -S "server hello, adding alpn extension" \ | 
|  | 4894 | -C "found alpn extension " \ | 
|  | 4895 | -C "Application Layer Protocol is" \ | 
|  | 4896 | -S "Application Layer Protocol is" | 
|  | 4897 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4898 | run_test    "ALPN: client only" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4899 | "$P_SRV debug_level=3" \ | 
|  | 4900 | "$P_CLI debug_level=3 alpn=abc,1234" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4901 | 0 \ | 
|  | 4902 | -c "client hello, adding alpn extension" \ | 
|  | 4903 | -s "found alpn extension" \ | 
|  | 4904 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 4905 | -S "server hello, adding alpn extension" \ | 
|  | 4906 | -C "found alpn extension " \ | 
|  | 4907 | -c "Application Layer Protocol is (none)" \ | 
|  | 4908 | -S "Application Layer Protocol is" | 
|  | 4909 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4910 | run_test    "ALPN: server only" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4911 | "$P_SRV debug_level=3 alpn=abc,1234" \ | 
|  | 4912 | "$P_CLI debug_level=3" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4913 | 0 \ | 
|  | 4914 | -C "client hello, adding alpn extension" \ | 
|  | 4915 | -S "found alpn extension" \ | 
|  | 4916 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 4917 | -S "server hello, adding alpn extension" \ | 
|  | 4918 | -C "found alpn extension " \ | 
|  | 4919 | -C "Application Layer Protocol is" \ | 
|  | 4920 | -s "Application Layer Protocol is (none)" | 
|  | 4921 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4922 | run_test    "ALPN: both, common cli1-srv1" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4923 | "$P_SRV debug_level=3 alpn=abc,1234" \ | 
|  | 4924 | "$P_CLI debug_level=3 alpn=abc,1234" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4925 | 0 \ | 
|  | 4926 | -c "client hello, adding alpn extension" \ | 
|  | 4927 | -s "found alpn extension" \ | 
|  | 4928 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 4929 | -s "server hello, adding alpn extension" \ | 
|  | 4930 | -c "found alpn extension" \ | 
|  | 4931 | -c "Application Layer Protocol is abc" \ | 
|  | 4932 | -s "Application Layer Protocol is abc" | 
|  | 4933 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4934 | run_test    "ALPN: both, common cli2-srv1" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4935 | "$P_SRV debug_level=3 alpn=abc,1234" \ | 
|  | 4936 | "$P_CLI debug_level=3 alpn=1234,abc" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4937 | 0 \ | 
|  | 4938 | -c "client hello, adding alpn extension" \ | 
|  | 4939 | -s "found alpn extension" \ | 
|  | 4940 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 4941 | -s "server hello, adding alpn extension" \ | 
|  | 4942 | -c "found alpn extension" \ | 
|  | 4943 | -c "Application Layer Protocol is abc" \ | 
|  | 4944 | -s "Application Layer Protocol is abc" | 
|  | 4945 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4946 | run_test    "ALPN: both, common cli1-srv2" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4947 | "$P_SRV debug_level=3 alpn=abc,1234" \ | 
|  | 4948 | "$P_CLI debug_level=3 alpn=1234,abcde" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4949 | 0 \ | 
|  | 4950 | -c "client hello, adding alpn extension" \ | 
|  | 4951 | -s "found alpn extension" \ | 
|  | 4952 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 4953 | -s "server hello, adding alpn extension" \ | 
|  | 4954 | -c "found alpn extension" \ | 
|  | 4955 | -c "Application Layer Protocol is 1234" \ | 
|  | 4956 | -s "Application Layer Protocol is 1234" | 
|  | 4957 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4958 | run_test    "ALPN: both, no common" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4959 | "$P_SRV debug_level=3 alpn=abc,123" \ | 
|  | 4960 | "$P_CLI debug_level=3 alpn=1234,abcde" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4961 | 1 \ | 
|  | 4962 | -c "client hello, adding alpn extension" \ | 
|  | 4963 | -s "found alpn extension" \ | 
|  | 4964 | -c "got an alert message, type: \\[2:120]" \ | 
|  | 4965 | -S "server hello, adding alpn extension" \ | 
|  | 4966 | -C "found alpn extension" \ | 
|  | 4967 | -C "Application Layer Protocol is 1234" \ | 
|  | 4968 | -S "Application Layer Protocol is 1234" | 
|  | 4969 |  | 
| Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 4970 |  | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4971 | # Tests for keyUsage in leaf certificates, part 1: | 
|  | 4972 | # server-side certificate/suite selection | 
|  | 4973 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4974 | run_test    "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4975 | "$P_SRV key_file=data_files/server2.key \ | 
|  | 4976 | crt_file=data_files/server2.ku-ds.crt" \ | 
|  | 4977 | "$P_CLI" \ | 
|  | 4978 | 0 \ | 
| Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 4979 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4980 |  | 
|  | 4981 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4982 | run_test    "keyUsage srv: RSA, keyEncipherment -> RSA" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4983 | "$P_SRV key_file=data_files/server2.key \ | 
|  | 4984 | crt_file=data_files/server2.ku-ke.crt" \ | 
|  | 4985 | "$P_CLI" \ | 
|  | 4986 | 0 \ | 
|  | 4987 | -c "Ciphersuite is TLS-RSA-WITH-" | 
|  | 4988 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4989 | run_test    "keyUsage srv: RSA, keyAgreement -> fail" \ | 
| Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4990 | "$P_SRV key_file=data_files/server2.key \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4991 | crt_file=data_files/server2.ku-ka.crt" \ | 
| Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4992 | "$P_CLI" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4993 | 1 \ | 
|  | 4994 | -C "Ciphersuite is " | 
|  | 4995 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4996 | run_test    "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4997 | "$P_SRV key_file=data_files/server5.key \ | 
|  | 4998 | crt_file=data_files/server5.ku-ds.crt" \ | 
|  | 4999 | "$P_CLI" \ | 
|  | 5000 | 0 \ | 
|  | 5001 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" | 
|  | 5002 |  | 
|  | 5003 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5004 | run_test    "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5005 | "$P_SRV key_file=data_files/server5.key \ | 
|  | 5006 | crt_file=data_files/server5.ku-ka.crt" \ | 
|  | 5007 | "$P_CLI" \ | 
|  | 5008 | 0 \ | 
|  | 5009 | -c "Ciphersuite is TLS-ECDH-" | 
|  | 5010 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5011 | run_test    "keyUsage srv: ECDSA, keyEncipherment -> fail" \ | 
| Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5012 | "$P_SRV key_file=data_files/server5.key \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5013 | crt_file=data_files/server5.ku-ke.crt" \ | 
| Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5014 | "$P_CLI" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5015 | 1 \ | 
|  | 5016 | -C "Ciphersuite is " | 
|  | 5017 |  | 
|  | 5018 | # Tests for keyUsage in leaf certificates, part 2: | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5019 | # client-side checking of server cert | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5020 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5021 | run_test    "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5022 | "$O_SRV -key data_files/server2.key \ | 
|  | 5023 | -cert data_files/server2.ku-ds_ke.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5024 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5025 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 5026 | 0 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5027 | -C "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5028 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 5029 | -c "Ciphersuite is TLS-" | 
|  | 5030 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5031 | run_test    "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5032 | "$O_SRV -key data_files/server2.key \ | 
|  | 5033 | -cert data_files/server2.ku-ds_ke.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5034 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5035 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 5036 | 0 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5037 | -C "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5038 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 5039 | -c "Ciphersuite is TLS-" | 
|  | 5040 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5041 | run_test    "keyUsage cli: KeyEncipherment, RSA: OK" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5042 | "$O_SRV -key data_files/server2.key \ | 
|  | 5043 | -cert data_files/server2.ku-ke.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5044 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5045 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 5046 | 0 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5047 | -C "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5048 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 5049 | -c "Ciphersuite is TLS-" | 
|  | 5050 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5051 | run_test    "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5052 | "$O_SRV -key data_files/server2.key \ | 
|  | 5053 | -cert data_files/server2.ku-ke.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5054 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5055 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 5056 | 1 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5057 | -c "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5058 | -c "Processing of the Certificate handshake message failed" \ | 
|  | 5059 | -C "Ciphersuite is TLS-" | 
|  | 5060 |  | 
| Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5061 | run_test    "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ | 
|  | 5062 | "$O_SRV -key data_files/server2.key \ | 
|  | 5063 | -cert data_files/server2.ku-ke.crt" \ | 
|  | 5064 | "$P_CLI debug_level=1 auth_mode=optional \ | 
|  | 5065 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 5066 | 0 \ | 
|  | 5067 | -c "bad certificate (usage extensions)" \ | 
|  | 5068 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 5069 | -c "Ciphersuite is TLS-" \ | 
|  | 5070 | -c "! Usage does not match the keyUsage extension" | 
|  | 5071 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5072 | run_test    "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5073 | "$O_SRV -key data_files/server2.key \ | 
|  | 5074 | -cert data_files/server2.ku-ds.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5075 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5076 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 5077 | 0 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5078 | -C "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5079 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 5080 | -c "Ciphersuite is TLS-" | 
|  | 5081 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5082 | run_test    "keyUsage cli: DigitalSignature, RSA: fail" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5083 | "$O_SRV -key data_files/server2.key \ | 
|  | 5084 | -cert data_files/server2.ku-ds.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5085 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5086 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 5087 | 1 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5088 | -c "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5089 | -c "Processing of the Certificate handshake message failed" \ | 
|  | 5090 | -C "Ciphersuite is TLS-" | 
|  | 5091 |  | 
| Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5092 | run_test    "keyUsage cli: DigitalSignature, RSA: fail, soft" \ | 
|  | 5093 | "$O_SRV -key data_files/server2.key \ | 
|  | 5094 | -cert data_files/server2.ku-ds.crt" \ | 
|  | 5095 | "$P_CLI debug_level=1 auth_mode=optional \ | 
|  | 5096 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 5097 | 0 \ | 
|  | 5098 | -c "bad certificate (usage extensions)" \ | 
|  | 5099 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 5100 | -c "Ciphersuite is TLS-" \ | 
|  | 5101 | -c "! Usage does not match the keyUsage extension" | 
|  | 5102 |  | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5103 | # Tests for keyUsage in leaf certificates, part 3: | 
|  | 5104 | # server-side checking of client cert | 
|  | 5105 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5106 | run_test    "keyUsage cli-auth: RSA, DigitalSignature: OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5107 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5108 | "$O_CLI -key data_files/server2.key \ | 
|  | 5109 | -cert data_files/server2.ku-ds.crt" \ | 
|  | 5110 | 0 \ | 
|  | 5111 | -S "bad certificate (usage extensions)" \ | 
|  | 5112 | -S "Processing of the Certificate handshake message failed" | 
|  | 5113 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5114 | run_test    "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5115 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5116 | "$O_CLI -key data_files/server2.key \ | 
|  | 5117 | -cert data_files/server2.ku-ke.crt" \ | 
|  | 5118 | 0 \ | 
|  | 5119 | -s "bad certificate (usage extensions)" \ | 
|  | 5120 | -S "Processing of the Certificate handshake message failed" | 
|  | 5121 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5122 | run_test    "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5123 | "$P_SRV debug_level=1 auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5124 | "$O_CLI -key data_files/server2.key \ | 
|  | 5125 | -cert data_files/server2.ku-ke.crt" \ | 
|  | 5126 | 1 \ | 
|  | 5127 | -s "bad certificate (usage extensions)" \ | 
|  | 5128 | -s "Processing of the Certificate handshake message failed" | 
|  | 5129 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5130 | run_test    "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5131 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5132 | "$O_CLI -key data_files/server5.key \ | 
|  | 5133 | -cert data_files/server5.ku-ds.crt" \ | 
|  | 5134 | 0 \ | 
|  | 5135 | -S "bad certificate (usage extensions)" \ | 
|  | 5136 | -S "Processing of the Certificate handshake message failed" | 
|  | 5137 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5138 | run_test    "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5139 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5140 | "$O_CLI -key data_files/server5.key \ | 
|  | 5141 | -cert data_files/server5.ku-ka.crt" \ | 
|  | 5142 | 0 \ | 
|  | 5143 | -s "bad certificate (usage extensions)" \ | 
|  | 5144 | -S "Processing of the Certificate handshake message failed" | 
|  | 5145 |  | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5146 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection | 
|  | 5147 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5148 | run_test    "extKeyUsage srv: serverAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5149 | "$P_SRV key_file=data_files/server5.key \ | 
|  | 5150 | crt_file=data_files/server5.eku-srv.crt" \ | 
|  | 5151 | "$P_CLI" \ | 
|  | 5152 | 0 | 
|  | 5153 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5154 | run_test    "extKeyUsage srv: serverAuth,clientAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5155 | "$P_SRV key_file=data_files/server5.key \ | 
|  | 5156 | crt_file=data_files/server5.eku-srv.crt" \ | 
|  | 5157 | "$P_CLI" \ | 
|  | 5158 | 0 | 
|  | 5159 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5160 | run_test    "extKeyUsage srv: codeSign,anyEKU -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5161 | "$P_SRV key_file=data_files/server5.key \ | 
|  | 5162 | crt_file=data_files/server5.eku-cs_any.crt" \ | 
|  | 5163 | "$P_CLI" \ | 
|  | 5164 | 0 | 
|  | 5165 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5166 | run_test    "extKeyUsage srv: codeSign -> fail" \ | 
| Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5167 | "$P_SRV key_file=data_files/server5.key \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5168 | crt_file=data_files/server5.eku-cli.crt" \ | 
| Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5169 | "$P_CLI" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5170 | 1 | 
|  | 5171 |  | 
|  | 5172 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert | 
|  | 5173 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5174 | run_test    "extKeyUsage cli: serverAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5175 | "$O_SRV -key data_files/server5.key \ | 
|  | 5176 | -cert data_files/server5.eku-srv.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5177 | "$P_CLI debug_level=1" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5178 | 0 \ | 
|  | 5179 | -C "bad certificate (usage extensions)" \ | 
|  | 5180 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 5181 | -c "Ciphersuite is TLS-" | 
|  | 5182 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5183 | run_test    "extKeyUsage cli: serverAuth,clientAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5184 | "$O_SRV -key data_files/server5.key \ | 
|  | 5185 | -cert data_files/server5.eku-srv_cli.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5186 | "$P_CLI debug_level=1" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5187 | 0 \ | 
|  | 5188 | -C "bad certificate (usage extensions)" \ | 
|  | 5189 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 5190 | -c "Ciphersuite is TLS-" | 
|  | 5191 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5192 | run_test    "extKeyUsage cli: codeSign,anyEKU -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5193 | "$O_SRV -key data_files/server5.key \ | 
|  | 5194 | -cert data_files/server5.eku-cs_any.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5195 | "$P_CLI debug_level=1" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5196 | 0 \ | 
|  | 5197 | -C "bad certificate (usage extensions)" \ | 
|  | 5198 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 5199 | -c "Ciphersuite is TLS-" | 
|  | 5200 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5201 | run_test    "extKeyUsage cli: codeSign -> fail" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5202 | "$O_SRV -key data_files/server5.key \ | 
|  | 5203 | -cert data_files/server5.eku-cs.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5204 | "$P_CLI debug_level=1" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5205 | 1 \ | 
|  | 5206 | -c "bad certificate (usage extensions)" \ | 
|  | 5207 | -c "Processing of the Certificate handshake message failed" \ | 
|  | 5208 | -C "Ciphersuite is TLS-" | 
|  | 5209 |  | 
|  | 5210 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert | 
|  | 5211 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5212 | run_test    "extKeyUsage cli-auth: clientAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5213 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5214 | "$O_CLI -key data_files/server5.key \ | 
|  | 5215 | -cert data_files/server5.eku-cli.crt" \ | 
|  | 5216 | 0 \ | 
|  | 5217 | -S "bad certificate (usage extensions)" \ | 
|  | 5218 | -S "Processing of the Certificate handshake message failed" | 
|  | 5219 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5220 | run_test    "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5221 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5222 | "$O_CLI -key data_files/server5.key \ | 
|  | 5223 | -cert data_files/server5.eku-srv_cli.crt" \ | 
|  | 5224 | 0 \ | 
|  | 5225 | -S "bad certificate (usage extensions)" \ | 
|  | 5226 | -S "Processing of the Certificate handshake message failed" | 
|  | 5227 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5228 | run_test    "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5229 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5230 | "$O_CLI -key data_files/server5.key \ | 
|  | 5231 | -cert data_files/server5.eku-cs_any.crt" \ | 
|  | 5232 | 0 \ | 
|  | 5233 | -S "bad certificate (usage extensions)" \ | 
|  | 5234 | -S "Processing of the Certificate handshake message failed" | 
|  | 5235 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5236 | run_test    "extKeyUsage cli-auth: codeSign -> fail (soft)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5237 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5238 | "$O_CLI -key data_files/server5.key \ | 
|  | 5239 | -cert data_files/server5.eku-cs.crt" \ | 
|  | 5240 | 0 \ | 
|  | 5241 | -s "bad certificate (usage extensions)" \ | 
|  | 5242 | -S "Processing of the Certificate handshake message failed" | 
|  | 5243 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5244 | run_test    "extKeyUsage cli-auth: codeSign -> fail (hard)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5245 | "$P_SRV debug_level=1 auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5246 | "$O_CLI -key data_files/server5.key \ | 
|  | 5247 | -cert data_files/server5.eku-cs.crt" \ | 
|  | 5248 | 1 \ | 
|  | 5249 | -s "bad certificate (usage extensions)" \ | 
|  | 5250 | -s "Processing of the Certificate handshake message failed" | 
|  | 5251 |  | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5252 | # Tests for DHM parameters loading | 
|  | 5253 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5254 | run_test    "DHM parameters: reference" \ | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5255 | "$P_SRV" \ | 
|  | 5256 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 5257 | debug_level=3" \ | 
|  | 5258 | 0 \ | 
|  | 5259 | -c "value of 'DHM: P ' (2048 bits)" \ | 
| Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 5260 | -c "value of 'DHM: G ' (2 bits)" | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5261 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5262 | run_test    "DHM parameters: other parameters" \ | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5263 | "$P_SRV dhm_file=data_files/dhparams.pem" \ | 
|  | 5264 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 5265 | debug_level=3" \ | 
|  | 5266 | 0 \ | 
|  | 5267 | -c "value of 'DHM: P ' (1024 bits)" \ | 
|  | 5268 | -c "value of 'DHM: G ' (2 bits)" | 
|  | 5269 |  | 
| Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5270 | # Tests for DHM client-side size checking | 
|  | 5271 |  | 
|  | 5272 | run_test    "DHM size: server default, client default, OK" \ | 
|  | 5273 | "$P_SRV" \ | 
|  | 5274 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 5275 | debug_level=1" \ | 
|  | 5276 | 0 \ | 
|  | 5277 | -C "DHM prime too short:" | 
|  | 5278 |  | 
|  | 5279 | run_test    "DHM size: server default, client 2048, OK" \ | 
|  | 5280 | "$P_SRV" \ | 
|  | 5281 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 5282 | debug_level=1 dhmlen=2048" \ | 
|  | 5283 | 0 \ | 
|  | 5284 | -C "DHM prime too short:" | 
|  | 5285 |  | 
|  | 5286 | run_test    "DHM size: server 1024, client default, OK" \ | 
|  | 5287 | "$P_SRV dhm_file=data_files/dhparams.pem" \ | 
|  | 5288 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 5289 | debug_level=1" \ | 
|  | 5290 | 0 \ | 
|  | 5291 | -C "DHM prime too short:" | 
|  | 5292 |  | 
| Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5293 | run_test    "DHM size: server 999, client 999, OK" \ | 
|  | 5294 | "$P_SRV dhm_file=data_files/dh.999.pem" \ | 
|  | 5295 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 5296 | debug_level=1 dhmlen=999" \ | 
|  | 5297 | 0 \ | 
|  | 5298 | -C "DHM prime too short:" | 
|  | 5299 |  | 
|  | 5300 | run_test    "DHM size: server 1000, client 1000, OK" \ | 
|  | 5301 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ | 
|  | 5302 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 5303 | debug_level=1 dhmlen=1000" \ | 
|  | 5304 | 0 \ | 
|  | 5305 | -C "DHM prime too short:" | 
|  | 5306 |  | 
| Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5307 | run_test    "DHM size: server 1000, client default, rejected" \ | 
|  | 5308 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ | 
|  | 5309 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 5310 | debug_level=1" \ | 
|  | 5311 | 1 \ | 
|  | 5312 | -c "DHM prime too short:" | 
|  | 5313 |  | 
| Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5314 | run_test    "DHM size: server 1000, client 1001, rejected" \ | 
|  | 5315 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ | 
|  | 5316 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 5317 | debug_level=1 dhmlen=1001" \ | 
|  | 5318 | 1 \ | 
|  | 5319 | -c "DHM prime too short:" | 
|  | 5320 |  | 
|  | 5321 | run_test    "DHM size: server 999, client 1000, rejected" \ | 
|  | 5322 | "$P_SRV dhm_file=data_files/dh.999.pem" \ | 
|  | 5323 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 5324 | debug_level=1 dhmlen=1000" \ | 
|  | 5325 | 1 \ | 
|  | 5326 | -c "DHM prime too short:" | 
|  | 5327 |  | 
|  | 5328 | run_test    "DHM size: server 998, client 999, rejected" \ | 
|  | 5329 | "$P_SRV dhm_file=data_files/dh.998.pem" \ | 
|  | 5330 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 5331 | debug_level=1 dhmlen=999" \ | 
|  | 5332 | 1 \ | 
|  | 5333 | -c "DHM prime too short:" | 
|  | 5334 |  | 
| Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5335 | run_test    "DHM size: server default, client 2049, rejected" \ | 
|  | 5336 | "$P_SRV" \ | 
|  | 5337 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 5338 | debug_level=1 dhmlen=2049" \ | 
|  | 5339 | 1 \ | 
|  | 5340 | -c "DHM prime too short:" | 
|  | 5341 |  | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5342 | # Tests for PSK callback | 
|  | 5343 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5344 | run_test    "PSK callback: psk, no callback" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5345 | "$P_SRV psk=abc123 psk_identity=foo" \ | 
|  | 5346 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5347 | psk_identity=foo psk=abc123" \ | 
|  | 5348 | 0 \ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5349 | -S "SSL - The handshake negotiation failed" \ | 
| Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5350 | -S "SSL - Unknown identity received" \ | 
|  | 5351 | -S "SSL - Verification of the message MAC failed" | 
|  | 5352 |  | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5353 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5354 | run_test    "PSK callback: opaque psk on client, no callback" \ | 
|  | 5355 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ | 
|  | 5356 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
| Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5357 | psk_identity=foo psk=abc123 psk_opaque=1" \ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5358 | 0 \ | 
|  | 5359 | -c "skip PMS generation for opaque PSK"\ | 
|  | 5360 | -S "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5361 | -C "session hash for extended master secret"\ | 
|  | 5362 | -S "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5363 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5364 | -S "SSL - Unknown identity received" \ | 
|  | 5365 | -S "SSL - Verification of the message MAC failed" | 
|  | 5366 |  | 
|  | 5367 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5368 | run_test    "PSK callback: opaque psk on client, no callback, SHA-384" \ | 
|  | 5369 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ | 
|  | 5370 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ | 
| Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5371 | psk_identity=foo psk=abc123 psk_opaque=1" \ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5372 | 0 \ | 
|  | 5373 | -c "skip PMS generation for opaque PSK"\ | 
|  | 5374 | -S "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5375 | -C "session hash for extended master secret"\ | 
|  | 5376 | -S "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5377 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5378 | -S "SSL - Unknown identity received" \ | 
|  | 5379 | -S "SSL - Verification of the message MAC failed" | 
|  | 5380 |  | 
|  | 5381 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5382 | run_test    "PSK callback: opaque psk on client, no callback, EMS" \ | 
|  | 5383 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ | 
|  | 5384 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
| Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5385 | psk_identity=foo psk=abc123 psk_opaque=1" \ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5386 | 0 \ | 
|  | 5387 | -c "skip PMS generation for opaque PSK"\ | 
|  | 5388 | -S "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5389 | -c "session hash for extended master secret"\ | 
|  | 5390 | -s "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5391 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5392 | -S "SSL - Unknown identity received" \ | 
|  | 5393 | -S "SSL - Verification of the message MAC failed" | 
|  | 5394 |  | 
|  | 5395 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5396 | run_test    "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ | 
|  | 5397 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ | 
|  | 5398 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ | 
| Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5399 | psk_identity=foo psk=abc123 psk_opaque=1" \ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5400 | 0 \ | 
|  | 5401 | -c "skip PMS generation for opaque PSK"\ | 
|  | 5402 | -S "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5403 | -c "session hash for extended master secret"\ | 
|  | 5404 | -s "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5405 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5406 | -S "SSL - Unknown identity received" \ | 
|  | 5407 | -S "SSL - Verification of the message MAC failed" | 
|  | 5408 |  | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5409 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5410 | run_test    "PSK callback: raw psk on client, static opaque on server, no callback" \ | 
| Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5411 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5412 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5413 | psk_identity=foo psk=abc123" \ | 
|  | 5414 | 0 \ | 
|  | 5415 | -C "skip PMS generation for opaque PSK"\ | 
|  | 5416 | -s "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5417 | -C "session hash for extended master secret"\ | 
|  | 5418 | -S "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5419 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5420 | -S "SSL - Unknown identity received" \ | 
|  | 5421 | -S "SSL - Verification of the message MAC failed" | 
|  | 5422 |  | 
|  | 5423 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5424 | run_test    "PSK callback: raw psk on client, static opaque on server, no callback, SHA-384" \ | 
| Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5425 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5426 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ | 
|  | 5427 | psk_identity=foo psk=abc123" \ | 
|  | 5428 | 0 \ | 
|  | 5429 | -C "skip PMS generation for opaque PSK"\ | 
|  | 5430 | -s "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5431 | -C "session hash for extended master secret"\ | 
|  | 5432 | -S "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5433 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5434 | -S "SSL - Unknown identity received" \ | 
|  | 5435 | -S "SSL - Verification of the message MAC failed" | 
|  | 5436 |  | 
|  | 5437 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5438 | run_test    "PSK callback: raw psk on client, static opaque on server, no callback, EMS" \ | 
| Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5439 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls1_2 \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5440 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ | 
|  | 5441 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5442 | psk_identity=foo psk=abc123 extended_ms=1" \ | 
|  | 5443 | 0 \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5444 | -c "session hash for extended master secret"\ | 
|  | 5445 | -s "session hash for extended master secret"\ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5446 | -C "skip PMS generation for opaque PSK"\ | 
|  | 5447 | -s "skip PMS generation for opaque PSK"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5448 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5449 | -S "SSL - Unknown identity received" \ | 
|  | 5450 | -S "SSL - Verification of the message MAC failed" | 
|  | 5451 |  | 
|  | 5452 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5453 | run_test    "PSK callback: raw psk on client, static opaque on server, no callback, EMS, SHA384" \ | 
| Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5454 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls1_2 \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5455 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ | 
|  | 5456 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ | 
|  | 5457 | psk_identity=foo psk=abc123 extended_ms=1" \ | 
|  | 5458 | 0 \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5459 | -c "session hash for extended master secret"\ | 
|  | 5460 | -s "session hash for extended master secret"\ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5461 | -C "skip PMS generation for opaque PSK"\ | 
|  | 5462 | -s "skip PMS generation for opaque PSK"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5463 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5464 | -S "SSL - Unknown identity received" \ | 
|  | 5465 | -S "SSL - Verification of the message MAC failed" | 
|  | 5466 |  | 
|  | 5467 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5468 | run_test    "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback" \ | 
| Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5469 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5470 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5471 | psk_identity=def psk=beef" \ | 
|  | 5472 | 0 \ | 
|  | 5473 | -C "skip PMS generation for opaque PSK"\ | 
|  | 5474 | -s "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5475 | -C "session hash for extended master secret"\ | 
|  | 5476 | -S "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5477 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5478 | -S "SSL - Unknown identity received" \ | 
|  | 5479 | -S "SSL - Verification of the message MAC failed" | 
|  | 5480 |  | 
|  | 5481 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5482 | run_test    "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, SHA-384" \ | 
| Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5483 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5484 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ | 
|  | 5485 | psk_identity=def psk=beef" \ | 
|  | 5486 | 0 \ | 
|  | 5487 | -C "skip PMS generation for opaque PSK"\ | 
|  | 5488 | -s "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5489 | -C "session hash for extended master secret"\ | 
|  | 5490 | -S "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5491 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5492 | -S "SSL - Unknown identity received" \ | 
|  | 5493 | -S "SSL - Verification of the message MAC failed" | 
|  | 5494 |  | 
|  | 5495 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5496 | run_test    "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, EMS" \ | 
| Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5497 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls1_2 \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5498 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ | 
|  | 5499 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5500 | psk_identity=abc psk=dead extended_ms=1" \ | 
|  | 5501 | 0 \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5502 | -c "session hash for extended master secret"\ | 
|  | 5503 | -s "session hash for extended master secret"\ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5504 | -C "skip PMS generation for opaque PSK"\ | 
|  | 5505 | -s "skip PMS generation for opaque PSK"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5506 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5507 | -S "SSL - Unknown identity received" \ | 
|  | 5508 | -S "SSL - Verification of the message MAC failed" | 
|  | 5509 |  | 
|  | 5510 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5511 | run_test    "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, EMS, SHA384" \ | 
| Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5512 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls1_2 \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5513 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ | 
|  | 5514 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ | 
|  | 5515 | psk_identity=abc psk=dead extended_ms=1" \ | 
|  | 5516 | 0 \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5517 | -c "session hash for extended master secret"\ | 
|  | 5518 | -s "session hash for extended master secret"\ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5519 | -C "skip PMS generation for opaque PSK"\ | 
|  | 5520 | -s "skip PMS generation for opaque PSK"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5521 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5522 | -S "SSL - Unknown identity received" \ | 
|  | 5523 | -S "SSL - Verification of the message MAC failed" | 
|  | 5524 |  | 
|  | 5525 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5526 | run_test    "PSK callback: raw psk on client, mismatching static raw PSK on server, opaque PSK from callback" \ | 
| Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5527 | "$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=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5528 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5529 | psk_identity=def psk=beef" \ | 
|  | 5530 | 0 \ | 
|  | 5531 | -C "skip PMS generation for opaque PSK"\ | 
|  | 5532 | -s "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5533 | -C "session hash for extended master secret"\ | 
|  | 5534 | -S "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5535 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5536 | -S "SSL - Unknown identity received" \ | 
|  | 5537 | -S "SSL - Verification of the message MAC failed" | 
|  | 5538 |  | 
|  | 5539 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5540 | run_test    "PSK callback: raw psk on client, mismatching static opaque PSK on server, opaque PSK from callback" \ | 
| Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5541 | "$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=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5542 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5543 | psk_identity=def psk=beef" \ | 
|  | 5544 | 0 \ | 
|  | 5545 | -C "skip PMS generation for opaque PSK"\ | 
|  | 5546 | -s "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5547 | -C "session hash for extended master secret"\ | 
|  | 5548 | -S "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5549 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5550 | -S "SSL - Unknown identity received" \ | 
|  | 5551 | -S "SSL - Verification of the message MAC failed" | 
|  | 5552 |  | 
|  | 5553 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5554 | run_test    "PSK callback: raw psk on client, mismatching static opaque PSK on server, raw PSK from callback" \ | 
| Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5555 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=foo psk=abc123 debug_level=3 psk_list=abc,dead,def,beef min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5556 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5557 | psk_identity=def psk=beef" \ | 
|  | 5558 | 0 \ | 
|  | 5559 | -C "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5560 | -C "session hash for extended master secret"\ | 
|  | 5561 | -S "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5562 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5563 | -S "SSL - Unknown identity received" \ | 
|  | 5564 | -S "SSL - Verification of the message MAC failed" | 
|  | 5565 |  | 
|  | 5566 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5567 | run_test    "PSK callback: raw psk on client, id-matching but wrong raw PSK on server, opaque PSK from callback" \ | 
| Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5568 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=def psk=abc123 debug_level=3 psk_list=abc,dead,def,beef min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5569 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5570 | psk_identity=def psk=beef" \ | 
|  | 5571 | 0 \ | 
|  | 5572 | -C "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5573 | -C "session hash for extended master secret"\ | 
|  | 5574 | -S "session hash for extended master secret"\ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5575 | -S "SSL - The handshake negotiation failed" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5576 | -S "SSL - Unknown identity received" \ | 
|  | 5577 | -S "SSL - Verification of the message MAC failed" | 
|  | 5578 |  | 
|  | 5579 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5580 | run_test    "PSK callback: raw psk on client, matching opaque PSK on server, wrong opaque PSK from callback" \ | 
| Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5581 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=def psk=beef debug_level=3 psk_list=abc,dead,def,abc123 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5582 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5583 | psk_identity=def psk=beef" \ | 
|  | 5584 | 1 \ | 
|  | 5585 | -s "SSL - Verification of the message MAC failed" | 
|  | 5586 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5587 | run_test    "PSK callback: no psk, no callback" \ | 
| Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5588 | "$P_SRV" \ | 
|  | 5589 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5590 | psk_identity=foo psk=abc123" \ | 
|  | 5591 | 1 \ | 
| Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 5592 | -s "SSL - The handshake negotiation failed" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5593 | -S "SSL - Unknown identity received" \ | 
|  | 5594 | -S "SSL - Verification of the message MAC failed" | 
|  | 5595 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5596 | run_test    "PSK callback: callback overrides other settings" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5597 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ | 
|  | 5598 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5599 | psk_identity=foo psk=abc123" \ | 
|  | 5600 | 1 \ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5601 | -S "SSL - The handshake negotiation failed" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5602 | -s "SSL - Unknown identity received" \ | 
|  | 5603 | -S "SSL - Verification of the message MAC failed" | 
|  | 5604 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5605 | run_test    "PSK callback: first id matches" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5606 | "$P_SRV psk_list=abc,dead,def,beef" \ | 
|  | 5607 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5608 | psk_identity=abc psk=dead" \ | 
|  | 5609 | 0 \ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5610 | -S "SSL - The handshake negotiation failed" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5611 | -S "SSL - Unknown identity received" \ | 
|  | 5612 | -S "SSL - Verification of the message MAC failed" | 
|  | 5613 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5614 | run_test    "PSK callback: second id matches" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5615 | "$P_SRV psk_list=abc,dead,def,beef" \ | 
|  | 5616 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5617 | psk_identity=def psk=beef" \ | 
|  | 5618 | 0 \ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5619 | -S "SSL - The handshake negotiation failed" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5620 | -S "SSL - Unknown identity received" \ | 
|  | 5621 | -S "SSL - Verification of the message MAC failed" | 
|  | 5622 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5623 | run_test    "PSK callback: no match" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5624 | "$P_SRV psk_list=abc,dead,def,beef" \ | 
|  | 5625 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5626 | psk_identity=ghi psk=beef" \ | 
|  | 5627 | 1 \ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5628 | -S "SSL - The handshake negotiation failed" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5629 | -s "SSL - Unknown identity received" \ | 
|  | 5630 | -S "SSL - Verification of the message MAC failed" | 
|  | 5631 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5632 | run_test    "PSK callback: wrong key" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5633 | "$P_SRV psk_list=abc,dead,def,beef" \ | 
|  | 5634 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5635 | psk_identity=abc psk=beef" \ | 
|  | 5636 | 1 \ | 
| Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5637 | -S "SSL - The handshake negotiation failed" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5638 | -S "SSL - Unknown identity received" \ | 
|  | 5639 | -s "SSL - Verification of the message MAC failed" | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5640 |  | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5641 | # Tests for EC J-PAKE | 
|  | 5642 |  | 
| Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5643 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5644 | run_test    "ECJPAKE: client not configured" \ | 
|  | 5645 | "$P_SRV debug_level=3" \ | 
|  | 5646 | "$P_CLI debug_level=3" \ | 
|  | 5647 | 0 \ | 
| Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5648 | -C "add ciphersuite: 0xc0ff" \ | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5649 | -C "adding ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5650 | -S "found ecjpake kkpp extension" \ | 
|  | 5651 | -S "skip ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5652 | -S "ciphersuite mismatch: ecjpake not configured" \ | 
| Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5653 | -S "server hello, ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5654 | -C "found ecjpake_kkpp extension" \ | 
| Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 5655 | -S "SSL - The handshake negotiation failed" | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5656 |  | 
| Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5657 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5658 | run_test    "ECJPAKE: server not configured" \ | 
|  | 5659 | "$P_SRV debug_level=3" \ | 
|  | 5660 | "$P_CLI debug_level=3 ecjpake_pw=bla \ | 
|  | 5661 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 5662 | 1 \ | 
| Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5663 | -c "add ciphersuite: 0xc0ff" \ | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5664 | -c "adding ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5665 | -s "found ecjpake kkpp extension" \ | 
|  | 5666 | -s "skip ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5667 | -s "ciphersuite mismatch: ecjpake not configured" \ | 
| Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5668 | -S "server hello, ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5669 | -C "found ecjpake_kkpp extension" \ | 
| Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 5670 | -s "SSL - The handshake negotiation failed" | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5671 |  | 
| Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5672 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5673 | run_test    "ECJPAKE: working, TLS" \ | 
|  | 5674 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ | 
|  | 5675 | "$P_CLI debug_level=3 ecjpake_pw=bla \ | 
|  | 5676 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
| Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 5677 | 0 \ | 
| Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5678 | -c "add ciphersuite: 0xc0ff" \ | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5679 | -c "adding ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5680 | -C "re-using cached ecjpake parameters" \ | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5681 | -s "found ecjpake kkpp extension" \ | 
|  | 5682 | -S "skip ecjpake kkpp extension" \ | 
|  | 5683 | -S "ciphersuite mismatch: ecjpake not configured" \ | 
| Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5684 | -s "server hello, ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5685 | -c "found ecjpake_kkpp extension" \ | 
| Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 5686 | -S "SSL - The handshake negotiation failed" \ | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5687 | -S "SSL - Verification of the message MAC failed" | 
|  | 5688 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5689 | server_needs_more_time 1 | 
| Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5690 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5691 | run_test    "ECJPAKE: password mismatch, TLS" \ | 
|  | 5692 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ | 
|  | 5693 | "$P_CLI debug_level=3 ecjpake_pw=bad \ | 
|  | 5694 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 5695 | 1 \ | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5696 | -C "re-using cached ecjpake parameters" \ | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5697 | -s "SSL - Verification of the message MAC failed" | 
|  | 5698 |  | 
| Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5699 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5700 | run_test    "ECJPAKE: working, DTLS" \ | 
|  | 5701 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ | 
|  | 5702 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ | 
|  | 5703 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 5704 | 0 \ | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5705 | -c "re-using cached ecjpake parameters" \ | 
|  | 5706 | -S "SSL - Verification of the message MAC failed" | 
|  | 5707 |  | 
| Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5708 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5709 | run_test    "ECJPAKE: working, DTLS, no cookie" \ | 
|  | 5710 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ | 
|  | 5711 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ | 
|  | 5712 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 5713 | 0 \ | 
|  | 5714 | -C "re-using cached ecjpake parameters" \ | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5715 | -S "SSL - Verification of the message MAC failed" | 
|  | 5716 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5717 | server_needs_more_time 1 | 
| Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5718 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5719 | run_test    "ECJPAKE: password mismatch, DTLS" \ | 
|  | 5720 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ | 
|  | 5721 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ | 
|  | 5722 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 5723 | 1 \ | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5724 | -c "re-using cached ecjpake parameters" \ | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5725 | -s "SSL - Verification of the message MAC failed" | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5726 |  | 
| Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5727 | # for tests with configs/config-thread.h | 
| Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5728 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED | 
| Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5729 | run_test    "ECJPAKE: working, DTLS, nolog" \ | 
|  | 5730 | "$P_SRV dtls=1 ecjpake_pw=bla" \ | 
|  | 5731 | "$P_CLI dtls=1 ecjpake_pw=bla \ | 
|  | 5732 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 5733 | 0 | 
|  | 5734 |  | 
| Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 5735 | # Test for ClientHello without extensions | 
|  | 5736 |  | 
| Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 5737 | requires_gnutls | 
| Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 5738 | run_test    "ClientHello without extensions" \ | 
| Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 5739 | "$P_SRV debug_level=3" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5740 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ | 
| Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 5741 | 0 \ | 
|  | 5742 | -s "dumping 'client hello extensions' (0 bytes)" | 
|  | 5743 |  | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5744 | # Tests for mbedtls_ssl_get_bytes_avail() | 
| Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5745 |  | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5746 | run_test    "mbedtls_ssl_get_bytes_avail: no extra data" \ | 
| Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5747 | "$P_SRV" \ | 
|  | 5748 | "$P_CLI request_size=100" \ | 
|  | 5749 | 0 \ | 
|  | 5750 | -s "Read from client: 100 bytes read$" | 
|  | 5751 |  | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5752 | run_test    "mbedtls_ssl_get_bytes_avail: extra data" \ | 
| Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5753 | "$P_SRV" \ | 
|  | 5754 | "$P_CLI request_size=500" \ | 
|  | 5755 | 0 \ | 
|  | 5756 | -s "Read from client: 500 bytes read (.*+.*)" | 
| Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5757 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5758 | # Tests for small client packets | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5759 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5760 | run_test    "Small client packet TLS 1.2 BlockCipher" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5761 | "$P_SRV" \ | 
|  | 5762 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
|  | 5763 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 5764 | 0 \ | 
|  | 5765 | -s "Read from client: 1 bytes read" | 
|  | 5766 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5767 | 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] | 5768 | "$P_SRV" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5769 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5770 | 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] | 5771 | 0 \ | 
|  | 5772 | -s "Read from client: 1 bytes read" | 
|  | 5773 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5774 | 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] | 5775 | "$P_SRV" \ | 
| Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5776 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
|  | 5777 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5778 | 0 \ | 
|  | 5779 | -s "Read from client: 1 bytes read" | 
|  | 5780 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5781 | run_test    "Small client packet TLS 1.2 AEAD" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5782 | "$P_SRV" \ | 
|  | 5783 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
|  | 5784 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ | 
|  | 5785 | 0 \ | 
|  | 5786 | -s "Read from client: 1 bytes read" | 
|  | 5787 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5788 | 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] | 5789 | "$P_SRV" \ | 
|  | 5790 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
|  | 5791 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ | 
|  | 5792 | 0 \ | 
|  | 5793 | -s "Read from client: 1 bytes read" | 
|  | 5794 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5795 | # Tests for small client packets in DTLS | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5796 |  | 
|  | 5797 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5798 | run_test    "Small client packet DTLS 1.2" \ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5799 | "$P_SRV dtls=1 force_version=dtls1_2" \ | 
|  | 5800 | "$P_CLI dtls=1 request_size=1 \ | 
|  | 5801 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 5802 | 0 \ | 
|  | 5803 | -s "Read from client: 1 bytes read" | 
|  | 5804 |  | 
|  | 5805 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5806 | run_test    "Small client packet DTLS 1.2, without EtM" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5807 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5808 | "$P_CLI dtls=1 request_size=1 \ | 
|  | 5809 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 5810 | 0 \ | 
|  | 5811 | -s "Read from client: 1 bytes read" | 
|  | 5812 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5813 | # Tests for small server packets | 
|  | 5814 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5815 | run_test    "Small server packet TLS 1.2 BlockCipher" \ | 
|  | 5816 | "$P_SRV response_size=1" \ | 
|  | 5817 | "$P_CLI force_version=tls1_2 \ | 
|  | 5818 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 5819 | 0 \ | 
|  | 5820 | -c "Read from server: 1 bytes read" | 
|  | 5821 |  | 
|  | 5822 | run_test    "Small server packet TLS 1.2 BlockCipher, without EtM" \ | 
|  | 5823 | "$P_SRV response_size=1" \ | 
|  | 5824 | "$P_CLI force_version=tls1_2 \ | 
|  | 5825 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ | 
|  | 5826 | 0 \ | 
|  | 5827 | -c "Read from server: 1 bytes read" | 
|  | 5828 |  | 
|  | 5829 | run_test    "Small server packet TLS 1.2 BlockCipher larger MAC" \ | 
|  | 5830 | "$P_SRV response_size=1" \ | 
|  | 5831 | "$P_CLI force_version=tls1_2 \ | 
|  | 5832 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ | 
|  | 5833 | 0 \ | 
|  | 5834 | -c "Read from server: 1 bytes read" | 
|  | 5835 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5836 | run_test    "Small server packet TLS 1.2 AEAD" \ | 
|  | 5837 | "$P_SRV response_size=1" \ | 
|  | 5838 | "$P_CLI force_version=tls1_2 \ | 
|  | 5839 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ | 
|  | 5840 | 0 \ | 
|  | 5841 | -c "Read from server: 1 bytes read" | 
|  | 5842 |  | 
|  | 5843 | run_test    "Small server packet TLS 1.2 AEAD shorter tag" \ | 
|  | 5844 | "$P_SRV response_size=1" \ | 
|  | 5845 | "$P_CLI force_version=tls1_2 \ | 
|  | 5846 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ | 
|  | 5847 | 0 \ | 
|  | 5848 | -c "Read from server: 1 bytes read" | 
|  | 5849 |  | 
|  | 5850 | # Tests for small server packets in DTLS | 
|  | 5851 |  | 
|  | 5852 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5853 | run_test    "Small server packet DTLS 1.2" \ | 
|  | 5854 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2" \ | 
|  | 5855 | "$P_CLI dtls=1 \ | 
|  | 5856 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 5857 | 0 \ | 
|  | 5858 | -c "Read from server: 1 bytes read" | 
|  | 5859 |  | 
|  | 5860 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5861 | run_test    "Small server packet DTLS 1.2, without EtM" \ | 
|  | 5862 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 etm=0" \ | 
|  | 5863 | "$P_CLI dtls=1 \ | 
|  | 5864 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 5865 | 0 \ | 
|  | 5866 | -c "Read from server: 1 bytes read" | 
|  | 5867 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5868 | # Test for large client packets | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5869 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5870 | # How many fragments do we expect to write $1 bytes? | 
|  | 5871 | fragments_for_write() { | 
|  | 5872 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" | 
|  | 5873 | } | 
|  | 5874 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5875 | run_test    "Large client packet TLS 1.2 BlockCipher" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5876 | "$P_SRV" \ | 
|  | 5877 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
|  | 5878 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 5879 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5880 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 5881 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5882 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5883 | run_test    "Large client packet TLS 1.2 BlockCipher, without EtM" \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5884 | "$P_SRV" \ | 
|  | 5885 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ | 
|  | 5886 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 5887 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5888 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5889 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5890 | 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] | 5891 | "$P_SRV" \ | 
| Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5892 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
|  | 5893 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5894 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5895 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 5896 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5897 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5898 | run_test    "Large client packet TLS 1.2 AEAD" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5899 | "$P_SRV" \ | 
|  | 5900 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
|  | 5901 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ | 
|  | 5902 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5903 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 5904 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5905 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5906 | 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] | 5907 | "$P_SRV" \ | 
|  | 5908 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
|  | 5909 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ | 
|  | 5910 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5911 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 5912 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5913 |  | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 5914 | # 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] | 5915 | run_test    "Large server packet TLS 1.2 BlockCipher" \ | 
|  | 5916 | "$P_SRV response_size=16384" \ | 
|  | 5917 | "$P_CLI force_version=tls1_2 \ | 
|  | 5918 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 5919 | 0 \ | 
|  | 5920 | -c "Read from server: 16384 bytes read" | 
|  | 5921 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5922 | run_test    "Large server packet TLS 1.2 BlockCipher, without EtM" \ | 
|  | 5923 | "$P_SRV response_size=16384" \ | 
|  | 5924 | "$P_CLI force_version=tls1_2 etm=0 \ | 
|  | 5925 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 5926 | 0 \ | 
|  | 5927 | -s "16384 bytes written in 1 fragments" \ | 
|  | 5928 | -c "Read from server: 16384 bytes read" | 
|  | 5929 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5930 | run_test    "Large server packet TLS 1.2 BlockCipher larger MAC" \ | 
|  | 5931 | "$P_SRV response_size=16384" \ | 
|  | 5932 | "$P_CLI force_version=tls1_2 \ | 
|  | 5933 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ | 
|  | 5934 | 0 \ | 
|  | 5935 | -c "Read from server: 16384 bytes read" | 
|  | 5936 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5937 | run_test    "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ | 
|  | 5938 | "$P_SRV response_size=16384 trunc_hmac=1" \ | 
|  | 5939 | "$P_CLI force_version=tls1_2 \ | 
|  | 5940 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ | 
|  | 5941 | 0 \ | 
|  | 5942 | -s "16384 bytes written in 1 fragments" \ | 
|  | 5943 | -c "Read from server: 16384 bytes read" | 
|  | 5944 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5945 | run_test    "Large server packet TLS 1.2 AEAD" \ | 
|  | 5946 | "$P_SRV response_size=16384" \ | 
|  | 5947 | "$P_CLI force_version=tls1_2 \ | 
|  | 5948 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ | 
|  | 5949 | 0 \ | 
|  | 5950 | -c "Read from server: 16384 bytes read" | 
|  | 5951 |  | 
|  | 5952 | run_test    "Large server packet TLS 1.2 AEAD shorter tag" \ | 
|  | 5953 | "$P_SRV response_size=16384" \ | 
|  | 5954 | "$P_CLI force_version=tls1_2 \ | 
|  | 5955 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ | 
|  | 5956 | 0 \ | 
|  | 5957 | -c "Read from server: 16384 bytes read" | 
|  | 5958 |  | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5959 | # Tests for restartable ECC | 
|  | 5960 |  | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5961 | # Force the use of a curve that supports restartable ECC (secp256r1). | 
|  | 5962 |  | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5963 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5964 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5965 | run_test    "EC restart: TLS, default" \ | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5966 | "$P_SRV curves=secp256r1 auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5967 | "$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] | 5968 | 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] | 5969 | debug_level=1" \ | 
|  | 5970 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5971 | -C "x509_verify_cert.*4b00" \ | 
|  | 5972 | -C "mbedtls_pk_verify.*4b00" \ | 
|  | 5973 | -C "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 5974 | -C "mbedtls_pk_sign.*4b00" | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5975 |  | 
|  | 5976 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5977 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5978 | run_test    "EC restart: TLS, max_ops=0" \ | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5979 | "$P_SRV curves=secp256r1 auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5980 | "$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] | 5981 | 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] | 5982 | debug_level=1 ec_max_ops=0" \ | 
|  | 5983 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5984 | -C "x509_verify_cert.*4b00" \ | 
|  | 5985 | -C "mbedtls_pk_verify.*4b00" \ | 
|  | 5986 | -C "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 5987 | -C "mbedtls_pk_sign.*4b00" | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5988 |  | 
|  | 5989 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5990 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5991 | run_test    "EC restart: TLS, max_ops=65535" \ | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5992 | "$P_SRV curves=secp256r1 auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5993 | "$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] | 5994 | 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] | 5995 | debug_level=1 ec_max_ops=65535" \ | 
|  | 5996 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5997 | -C "x509_verify_cert.*4b00" \ | 
|  | 5998 | -C "mbedtls_pk_verify.*4b00" \ | 
|  | 5999 | -C "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 6000 | -C "mbedtls_pk_sign.*4b00" | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6001 |  | 
|  | 6002 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6003 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6004 | run_test    "EC restart: TLS, max_ops=1000" \ | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6005 | "$P_SRV curves=secp256r1 auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6006 | "$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] | 6007 | 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] | 6008 | debug_level=1 ec_max_ops=1000" \ | 
|  | 6009 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6010 | -c "x509_verify_cert.*4b00" \ | 
|  | 6011 | -c "mbedtls_pk_verify.*4b00" \ | 
|  | 6012 | -c "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 6013 | -c "mbedtls_pk_sign.*4b00" | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6014 |  | 
|  | 6015 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6016 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
| Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6017 | run_test    "EC restart: TLS, max_ops=1000, badsign" \ | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6018 | "$P_SRV curves=secp256r1 auth_mode=required \ | 
| Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6019 | crt_file=data_files/server5-badsign.crt \ | 
|  | 6020 | key_file=data_files/server5.key" \ | 
|  | 6021 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 6022 | key_file=data_files/server5.key crt_file=data_files/server5.crt  \ | 
|  | 6023 | debug_level=1 ec_max_ops=1000" \ | 
|  | 6024 | 1 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6025 | -c "x509_verify_cert.*4b00" \ | 
|  | 6026 | -C "mbedtls_pk_verify.*4b00" \ | 
|  | 6027 | -C "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 6028 | -C "mbedtls_pk_sign.*4b00" \ | 
| Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6029 | -c "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 6030 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 6031 | -c "X509 - Certificate verification failed" | 
|  | 6032 |  | 
|  | 6033 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6034 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
| Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6035 | run_test    "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6036 | "$P_SRV curves=secp256r1 auth_mode=required \ | 
| Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6037 | crt_file=data_files/server5-badsign.crt \ | 
|  | 6038 | key_file=data_files/server5.key" \ | 
|  | 6039 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 6040 | key_file=data_files/server5.key crt_file=data_files/server5.crt  \ | 
|  | 6041 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ | 
|  | 6042 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6043 | -c "x509_verify_cert.*4b00" \ | 
|  | 6044 | -c "mbedtls_pk_verify.*4b00" \ | 
|  | 6045 | -c "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 6046 | -c "mbedtls_pk_sign.*4b00" \ | 
| Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6047 | -c "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 6048 | -C "! mbedtls_ssl_handshake returned" \ | 
|  | 6049 | -C "X509 - Certificate verification failed" | 
|  | 6050 |  | 
|  | 6051 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6052 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
| Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6053 | run_test    "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6054 | "$P_SRV curves=secp256r1 auth_mode=required \ | 
| Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6055 | crt_file=data_files/server5-badsign.crt \ | 
|  | 6056 | key_file=data_files/server5.key" \ | 
|  | 6057 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 6058 | key_file=data_files/server5.key crt_file=data_files/server5.crt  \ | 
|  | 6059 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ | 
|  | 6060 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6061 | -C "x509_verify_cert.*4b00" \ | 
|  | 6062 | -c "mbedtls_pk_verify.*4b00" \ | 
|  | 6063 | -c "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 6064 | -c "mbedtls_pk_sign.*4b00" \ | 
| Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6065 | -C "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 6066 | -C "! mbedtls_ssl_handshake returned" \ | 
|  | 6067 | -C "X509 - Certificate verification failed" | 
|  | 6068 |  | 
|  | 6069 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6070 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6071 | run_test    "EC restart: DTLS, max_ops=1000" \ | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6072 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6073 | "$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] | 6074 | 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] | 6075 | dtls=1 debug_level=1 ec_max_ops=1000" \ | 
|  | 6076 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6077 | -c "x509_verify_cert.*4b00" \ | 
|  | 6078 | -c "mbedtls_pk_verify.*4b00" \ | 
|  | 6079 | -c "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 6080 | -c "mbedtls_pk_sign.*4b00" | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6081 |  | 
| Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6082 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6083 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
| Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6084 | run_test    "EC restart: TLS, max_ops=1000 no client auth" \ | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6085 | "$P_SRV curves=secp256r1" \ | 
| Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6086 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 6087 | debug_level=1 ec_max_ops=1000" \ | 
|  | 6088 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6089 | -c "x509_verify_cert.*4b00" \ | 
|  | 6090 | -c "mbedtls_pk_verify.*4b00" \ | 
|  | 6091 | -c "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 6092 | -C "mbedtls_pk_sign.*4b00" | 
| Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6093 |  | 
|  | 6094 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6095 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
| Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6096 | run_test    "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ | 
| Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6097 | "$P_SRV curves=secp256r1 psk=abc123" \ | 
| Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6098 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ | 
|  | 6099 | psk=abc123 debug_level=1 ec_max_ops=1000" \ | 
|  | 6100 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6101 | -C "x509_verify_cert.*4b00" \ | 
|  | 6102 | -C "mbedtls_pk_verify.*4b00" \ | 
|  | 6103 | -C "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 6104 | -C "mbedtls_pk_sign.*4b00" | 
| Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6105 |  | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6106 | # Tests of asynchronous private key support in SSL | 
|  | 6107 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6108 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6109 | run_test    "SSL async private: sign, delay=0" \ | 
|  | 6110 | "$P_SRV \ | 
|  | 6111 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6112 | "$P_CLI" \ | 
|  | 6113 | 0 \ | 
|  | 6114 | -s "Async sign callback: using key slot " \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6115 | -s "Async resume (slot [0-9]): sign done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6116 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6117 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6118 | run_test    "SSL async private: sign, delay=1" \ | 
|  | 6119 | "$P_SRV \ | 
|  | 6120 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6121 | "$P_CLI" \ | 
|  | 6122 | 0 \ | 
|  | 6123 | -s "Async sign callback: using key slot " \ | 
|  | 6124 | -s "Async resume (slot [0-9]): call 0 more times." \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6125 | -s "Async resume (slot [0-9]): sign done, status=0" | 
|  | 6126 |  | 
| Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 6127 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
|  | 6128 | run_test    "SSL async private: sign, delay=2" \ | 
|  | 6129 | "$P_SRV \ | 
|  | 6130 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ | 
|  | 6131 | "$P_CLI" \ | 
|  | 6132 | 0 \ | 
|  | 6133 | -s "Async sign callback: using key slot " \ | 
|  | 6134 | -U "Async sign callback: using key slot " \ | 
|  | 6135 | -s "Async resume (slot [0-9]): call 1 more times." \ | 
|  | 6136 | -s "Async resume (slot [0-9]): call 0 more times." \ | 
|  | 6137 | -s "Async resume (slot [0-9]): sign done, status=0" | 
|  | 6138 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6139 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6140 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO | 
| Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 6141 | run_test    "SSL async private: sign, SNI" \ | 
|  | 6142 | "$P_SRV debug_level=3 \ | 
|  | 6143 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ | 
|  | 6144 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 6145 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ | 
|  | 6146 | "$P_CLI server_name=polarssl.example" \ | 
|  | 6147 | 0 \ | 
|  | 6148 | -s "Async sign callback: using key slot " \ | 
|  | 6149 | -s "Async resume (slot [0-9]): sign done, status=0" \ | 
|  | 6150 | -s "parse ServerName extension" \ | 
|  | 6151 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ | 
|  | 6152 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" | 
|  | 6153 |  | 
|  | 6154 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6155 | run_test    "SSL async private: decrypt, delay=0" \ | 
|  | 6156 | "$P_SRV \ | 
|  | 6157 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ | 
|  | 6158 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 6159 | 0 \ | 
|  | 6160 | -s "Async decrypt callback: using key slot " \ | 
|  | 6161 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
|  | 6162 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6163 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6164 | run_test    "SSL async private: decrypt, delay=1" \ | 
|  | 6165 | "$P_SRV \ | 
|  | 6166 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ | 
|  | 6167 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 6168 | 0 \ | 
|  | 6169 | -s "Async decrypt callback: using key slot " \ | 
|  | 6170 | -s "Async resume (slot [0-9]): call 0 more times." \ | 
|  | 6171 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
|  | 6172 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6173 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6174 | run_test    "SSL async private: decrypt RSA-PSK, delay=0" \ | 
|  | 6175 | "$P_SRV psk=abc123 \ | 
|  | 6176 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ | 
|  | 6177 | "$P_CLI psk=abc123 \ | 
|  | 6178 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ | 
|  | 6179 | 0 \ | 
|  | 6180 | -s "Async decrypt callback: using key slot " \ | 
|  | 6181 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
|  | 6182 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6183 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6184 | run_test    "SSL async private: decrypt RSA-PSK, delay=1" \ | 
|  | 6185 | "$P_SRV psk=abc123 \ | 
|  | 6186 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ | 
|  | 6187 | "$P_CLI psk=abc123 \ | 
|  | 6188 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ | 
|  | 6189 | 0 \ | 
|  | 6190 | -s "Async decrypt callback: using key slot " \ | 
|  | 6191 | -s "Async resume (slot [0-9]): call 0 more times." \ | 
|  | 6192 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
|  | 6193 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6194 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6195 | run_test    "SSL async private: sign callback not present" \ | 
|  | 6196 | "$P_SRV \ | 
|  | 6197 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ | 
|  | 6198 | "$P_CLI; [ \$? -eq 1 ] && | 
|  | 6199 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 6200 | 0 \ | 
|  | 6201 | -S "Async sign callback" \ | 
|  | 6202 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 6203 | -s "The own private key or pre-shared key is not set, but needed" \ | 
|  | 6204 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ | 
|  | 6205 | -s "Successful connection" | 
|  | 6206 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6207 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6208 | run_test    "SSL async private: decrypt callback not present" \ | 
|  | 6209 | "$P_SRV debug_level=1 \ | 
|  | 6210 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ | 
|  | 6211 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; | 
|  | 6212 | [ \$? -eq 1 ] && $P_CLI" \ | 
|  | 6213 | 0 \ | 
|  | 6214 | -S "Async decrypt callback" \ | 
|  | 6215 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 6216 | -s "got no RSA private key" \ | 
|  | 6217 | -s "Async resume (slot [0-9]): sign done, status=0" \ | 
|  | 6218 | -s "Successful connection" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6219 |  | 
|  | 6220 | # key1: ECDSA, key2: RSA; use key1 from slot 0 | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6221 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6222 | run_test    "SSL async private: slot 0 used with key1" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6223 | "$P_SRV \ | 
|  | 6224 | async_operations=s async_private_delay1=1 \ | 
|  | 6225 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 6226 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6227 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 6228 | 0 \ | 
|  | 6229 | -s "Async sign callback: using key slot 0," \ | 
|  | 6230 | -s "Async resume (slot 0): call 0 more times." \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6231 | -s "Async resume (slot 0): sign done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6232 |  | 
|  | 6233 | # key1: ECDSA, key2: RSA; use key2 from slot 0 | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6234 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6235 | run_test    "SSL async private: slot 0 used with key2" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6236 | "$P_SRV \ | 
|  | 6237 | async_operations=s async_private_delay2=1 \ | 
|  | 6238 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 6239 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6240 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 6241 | 0 \ | 
|  | 6242 | -s "Async sign callback: using key slot 0," \ | 
|  | 6243 | -s "Async resume (slot 0): call 0 more times." \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6244 | -s "Async resume (slot 0): sign done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6245 |  | 
|  | 6246 | # key1: ECDSA, key2: RSA; use key2 from slot 1 | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6247 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 6248 | run_test    "SSL async private: slot 1 used with key2" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6249 | "$P_SRV \ | 
| Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 6250 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6251 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 6252 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6253 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 6254 | 0 \ | 
|  | 6255 | -s "Async sign callback: using key slot 1," \ | 
|  | 6256 | -s "Async resume (slot 1): call 0 more times." \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6257 | -s "Async resume (slot 1): sign done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6258 |  | 
|  | 6259 | # key1: ECDSA, key2: RSA; use key2 directly | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6260 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6261 | run_test    "SSL async private: fall back to transparent key" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6262 | "$P_SRV \ | 
|  | 6263 | async_operations=s async_private_delay1=1 \ | 
|  | 6264 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 6265 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6266 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 6267 | 0 \ | 
|  | 6268 | -s "Async sign callback: no key matches this certificate." | 
|  | 6269 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6270 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6271 | run_test    "SSL async private: sign, error in start" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6272 | "$P_SRV \ | 
|  | 6273 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
|  | 6274 | async_private_error=1" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6275 | "$P_CLI" \ | 
|  | 6276 | 1 \ | 
|  | 6277 | -s "Async sign callback: injected error" \ | 
|  | 6278 | -S "Async resume" \ | 
| Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6279 | -S "Async cancel" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6280 | -s "! mbedtls_ssl_handshake returned" | 
|  | 6281 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6282 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6283 | run_test    "SSL async private: sign, cancel after start" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6284 | "$P_SRV \ | 
|  | 6285 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
|  | 6286 | async_private_error=2" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6287 | "$P_CLI" \ | 
|  | 6288 | 1 \ | 
|  | 6289 | -s "Async sign callback: using key slot " \ | 
|  | 6290 | -S "Async resume" \ | 
|  | 6291 | -s "Async cancel" | 
|  | 6292 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6293 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6294 | run_test    "SSL async private: sign, error in resume" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6295 | "$P_SRV \ | 
|  | 6296 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
|  | 6297 | async_private_error=3" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6298 | "$P_CLI" \ | 
|  | 6299 | 1 \ | 
|  | 6300 | -s "Async sign callback: using key slot " \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6301 | -s "Async resume callback: sign done but injected error" \ | 
| Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6302 | -S "Async cancel" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6303 | -s "! mbedtls_ssl_handshake returned" | 
|  | 6304 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6305 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6306 | run_test    "SSL async private: decrypt, error in start" \ | 
|  | 6307 | "$P_SRV \ | 
|  | 6308 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ | 
|  | 6309 | async_private_error=1" \ | 
|  | 6310 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 6311 | 1 \ | 
|  | 6312 | -s "Async decrypt callback: injected error" \ | 
|  | 6313 | -S "Async resume" \ | 
|  | 6314 | -S "Async cancel" \ | 
|  | 6315 | -s "! mbedtls_ssl_handshake returned" | 
|  | 6316 |  | 
|  | 6317 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
|  | 6318 | run_test    "SSL async private: decrypt, cancel after start" \ | 
|  | 6319 | "$P_SRV \ | 
|  | 6320 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ | 
|  | 6321 | async_private_error=2" \ | 
|  | 6322 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 6323 | 1 \ | 
|  | 6324 | -s "Async decrypt callback: using key slot " \ | 
|  | 6325 | -S "Async resume" \ | 
|  | 6326 | -s "Async cancel" | 
|  | 6327 |  | 
|  | 6328 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
|  | 6329 | run_test    "SSL async private: decrypt, error in resume" \ | 
|  | 6330 | "$P_SRV \ | 
|  | 6331 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ | 
|  | 6332 | async_private_error=3" \ | 
|  | 6333 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 6334 | 1 \ | 
|  | 6335 | -s "Async decrypt callback: using key slot " \ | 
|  | 6336 | -s "Async resume callback: decrypt done but injected error" \ | 
|  | 6337 | -S "Async cancel" \ | 
|  | 6338 | -s "! mbedtls_ssl_handshake returned" | 
|  | 6339 |  | 
|  | 6340 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6341 | run_test    "SSL async private: cancel after start then operate correctly" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6342 | "$P_SRV \ | 
|  | 6343 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
|  | 6344 | async_private_error=-2" \ | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6345 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ | 
|  | 6346 | 0 \ | 
|  | 6347 | -s "Async cancel" \ | 
|  | 6348 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 6349 | -s "Async resume" \ | 
|  | 6350 | -s "Successful connection" | 
|  | 6351 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6352 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6353 | run_test    "SSL async private: error in resume then operate correctly" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6354 | "$P_SRV \ | 
|  | 6355 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
|  | 6356 | async_private_error=-3" \ | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6357 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ | 
|  | 6358 | 0 \ | 
|  | 6359 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 6360 | -s "Async resume" \ | 
|  | 6361 | -s "Successful connection" | 
|  | 6362 |  | 
|  | 6363 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6364 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6365 | 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] | 6366 | "$P_SRV \ | 
|  | 6367 | async_operations=s async_private_delay1=1 async_private_error=-2 \ | 
|  | 6368 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 6369 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6370 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; | 
|  | 6371 | [ \$? -eq 1 ] && | 
|  | 6372 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 6373 | 0 \ | 
| Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 6374 | -s "Async sign callback: using key slot 0" \ | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6375 | -S "Async resume" \ | 
|  | 6376 | -s "Async cancel" \ | 
|  | 6377 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 6378 | -s "Async sign callback: no key matches this certificate." \ | 
|  | 6379 | -s "Successful connection" | 
|  | 6380 |  | 
|  | 6381 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6382 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6383 | 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] | 6384 | "$P_SRV \ | 
|  | 6385 | async_operations=s async_private_delay1=1 async_private_error=-3 \ | 
|  | 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 | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6388 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; | 
|  | 6389 | [ \$? -eq 1 ] && | 
|  | 6390 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 6391 | 0 \ | 
|  | 6392 | -s "Async resume" \ | 
|  | 6393 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 6394 | -s "Async sign callback: no key matches this certificate." \ | 
|  | 6395 | -s "Successful connection" | 
|  | 6396 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6397 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6398 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6399 | run_test    "SSL async private: renegotiation: client-initiated, sign" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6400 | "$P_SRV \ | 
|  | 6401 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6402 | exchanges=2 renegotiation=1" \ | 
|  | 6403 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ | 
|  | 6404 | 0 \ | 
|  | 6405 | -s "Async sign callback: using key slot " \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6406 | -s "Async resume (slot [0-9]): sign done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6407 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6408 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6409 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6410 | run_test    "SSL async private: renegotiation: server-initiated, sign" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6411 | "$P_SRV \ | 
|  | 6412 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6413 | exchanges=2 renegotiation=1 renegotiate=1" \ | 
|  | 6414 | "$P_CLI exchanges=2 renegotiation=1" \ | 
|  | 6415 | 0 \ | 
|  | 6416 | -s "Async sign callback: using key slot " \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6417 | -s "Async resume (slot [0-9]): sign done, status=0" | 
|  | 6418 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6419 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6420 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6421 | run_test    "SSL async private: renegotiation: client-initiated, decrypt" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6422 | "$P_SRV \ | 
|  | 6423 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ | 
|  | 6424 | exchanges=2 renegotiation=1" \ | 
|  | 6425 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ | 
|  | 6426 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 6427 | 0 \ | 
|  | 6428 | -s "Async decrypt callback: using key slot " \ | 
|  | 6429 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
|  | 6430 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6431 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6432 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6433 | run_test    "SSL async private: renegotiation: server-initiated, decrypt" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6434 | "$P_SRV \ | 
|  | 6435 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ | 
|  | 6436 | exchanges=2 renegotiation=1 renegotiate=1" \ | 
|  | 6437 | "$P_CLI exchanges=2 renegotiation=1 \ | 
|  | 6438 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 6439 | 0 \ | 
|  | 6440 | -s "Async decrypt callback: using key slot " \ | 
|  | 6441 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6442 |  | 
| Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6443 | # Tests for ECC extensions (rfc 4492) | 
|  | 6444 |  | 
| Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6445 | requires_config_enabled MBEDTLS_AES_C | 
|  | 6446 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC | 
|  | 6447 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 6448 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED | 
| Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6449 | run_test    "Force a non ECC ciphersuite in the client side" \ | 
|  | 6450 | "$P_SRV debug_level=3" \ | 
| Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6451 | "$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] | 6452 | 0 \ | 
|  | 6453 | -C "client hello, adding supported_elliptic_curves extension" \ | 
|  | 6454 | -C "client hello, adding supported_point_formats extension" \ | 
|  | 6455 | -S "found supported elliptic curves extension" \ | 
|  | 6456 | -S "found supported point formats extension" | 
|  | 6457 |  | 
| Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6458 | requires_config_enabled MBEDTLS_AES_C | 
|  | 6459 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC | 
|  | 6460 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 6461 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED | 
| Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6462 | run_test    "Force a non ECC ciphersuite in the server side" \ | 
| Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6463 | "$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] | 6464 | "$P_CLI debug_level=3" \ | 
|  | 6465 | 0 \ | 
|  | 6466 | -C "found supported_point_formats extension" \ | 
|  | 6467 | -S "server hello, supported_point_formats extension" | 
|  | 6468 |  | 
| Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6469 | requires_config_enabled MBEDTLS_AES_C | 
|  | 6470 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC | 
|  | 6471 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 6472 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6473 | run_test    "Force an ECC ciphersuite in the client side" \ | 
|  | 6474 | "$P_SRV debug_level=3" \ | 
|  | 6475 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 6476 | 0 \ | 
|  | 6477 | -c "client hello, adding supported_elliptic_curves extension" \ | 
|  | 6478 | -c "client hello, adding supported_point_formats extension" \ | 
|  | 6479 | -s "found supported elliptic curves extension" \ | 
|  | 6480 | -s "found supported point formats extension" | 
|  | 6481 |  | 
| Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6482 | requires_config_enabled MBEDTLS_AES_C | 
|  | 6483 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC | 
|  | 6484 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 6485 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6486 | run_test    "Force an ECC ciphersuite in the server side" \ | 
|  | 6487 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 6488 | "$P_CLI debug_level=3" \ | 
|  | 6489 | 0 \ | 
|  | 6490 | -c "found supported_point_formats extension" \ | 
|  | 6491 | -s "server hello, supported_point_formats extension" | 
|  | 6492 |  | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6493 | # Tests for DTLS HelloVerifyRequest | 
|  | 6494 |  | 
|  | 6495 | run_test    "DTLS cookie: enabled" \ | 
|  | 6496 | "$P_SRV dtls=1 debug_level=2" \ | 
|  | 6497 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 6498 | 0 \ | 
|  | 6499 | -s "cookie verification failed" \ | 
|  | 6500 | -s "cookie verification passed" \ | 
|  | 6501 | -S "cookie verification skipped" \ | 
|  | 6502 | -c "received hello verify request" \ | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6503 | -s "hello verification requested" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6504 | -S "SSL - The requested feature is not available" | 
|  | 6505 |  | 
|  | 6506 | run_test    "DTLS cookie: disabled" \ | 
|  | 6507 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ | 
|  | 6508 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 6509 | 0 \ | 
|  | 6510 | -S "cookie verification failed" \ | 
|  | 6511 | -S "cookie verification passed" \ | 
|  | 6512 | -s "cookie verification skipped" \ | 
|  | 6513 | -C "received hello verify request" \ | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6514 | -S "hello verification requested" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6515 | -S "SSL - The requested feature is not available" | 
|  | 6516 |  | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6517 | run_test    "DTLS cookie: default (failing)" \ | 
|  | 6518 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ | 
|  | 6519 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ | 
|  | 6520 | 1 \ | 
|  | 6521 | -s "cookie verification failed" \ | 
|  | 6522 | -S "cookie verification passed" \ | 
|  | 6523 | -S "cookie verification skipped" \ | 
|  | 6524 | -C "received hello verify request" \ | 
|  | 6525 | -S "hello verification requested" \ | 
|  | 6526 | -s "SSL - The requested feature is not available" | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6527 |  | 
|  | 6528 | requires_ipv6 | 
|  | 6529 | run_test    "DTLS cookie: enabled, IPv6" \ | 
|  | 6530 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ | 
|  | 6531 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ | 
|  | 6532 | 0 \ | 
|  | 6533 | -s "cookie verification failed" \ | 
|  | 6534 | -s "cookie verification passed" \ | 
|  | 6535 | -S "cookie verification skipped" \ | 
|  | 6536 | -c "received hello verify request" \ | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6537 | -s "hello verification requested" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6538 | -S "SSL - The requested feature is not available" | 
|  | 6539 |  | 
| Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6540 | run_test    "DTLS cookie: enabled, nbio" \ | 
|  | 6541 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ | 
|  | 6542 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ | 
|  | 6543 | 0 \ | 
|  | 6544 | -s "cookie verification failed" \ | 
|  | 6545 | -s "cookie verification passed" \ | 
|  | 6546 | -S "cookie verification skipped" \ | 
|  | 6547 | -c "received hello verify request" \ | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6548 | -s "hello verification requested" \ | 
| Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6549 | -S "SSL - The requested feature is not available" | 
|  | 6550 |  | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6551 | # Tests for client reconnecting from the same port with DTLS | 
|  | 6552 |  | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6553 | not_with_valgrind # spurious resend | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6554 | run_test    "DTLS client reconnect from same port: reference" \ | 
| Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 6555 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ | 
|  | 6556 | "$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] | 6557 | 0 \ | 
|  | 6558 | -C "resend" \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6559 | -S "The operation timed out" \ | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6560 | -S "Client initiated reconnection from same port" | 
|  | 6561 |  | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6562 | not_with_valgrind # spurious resend | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6563 | run_test    "DTLS client reconnect from same port: reconnect" \ | 
| Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 6564 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ | 
|  | 6565 | "$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] | 6566 | 0 \ | 
|  | 6567 | -C "resend" \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6568 | -S "The operation timed out" \ | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6569 | -s "Client initiated reconnection from same port" | 
|  | 6570 |  | 
| Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6571 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) | 
|  | 6572 | 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] | 6573 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ | 
|  | 6574 | "$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] | 6575 | 0 \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6576 | -S "The operation timed out" \ | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6577 | -s "Client initiated reconnection from same port" | 
|  | 6578 |  | 
| Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6579 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout | 
|  | 6580 | run_test    "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ | 
|  | 6581 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ | 
|  | 6582 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ | 
|  | 6583 | 0 \ | 
|  | 6584 | -S "The operation timed out" \ | 
|  | 6585 | -s "Client initiated reconnection from same port" | 
|  | 6586 |  | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6587 | run_test    "DTLS client reconnect from same port: no cookies" \ | 
|  | 6588 | "$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] | 6589 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ | 
|  | 6590 | 0 \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6591 | -s "The operation timed out" \ | 
|  | 6592 | -S "Client initiated reconnection from same port" | 
|  | 6593 |  | 
| Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 6594 | run_test    "DTLS client reconnect from same port: attacker-injected" \ | 
|  | 6595 | -p "$P_PXY inject_clihlo=1" \ | 
|  | 6596 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ | 
|  | 6597 | "$P_CLI dtls=1 exchanges=2" \ | 
|  | 6598 | 0 \ | 
|  | 6599 | -s "possible client reconnect from the same port" \ | 
|  | 6600 | -S "Client initiated reconnection from same port" | 
|  | 6601 |  | 
| Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6602 | # Tests for various cases of client authentication with DTLS | 
|  | 6603 | # (focused on handshake flows and message parsing) | 
|  | 6604 |  | 
|  | 6605 | run_test    "DTLS client auth: required" \ | 
|  | 6606 | "$P_SRV dtls=1 auth_mode=required" \ | 
|  | 6607 | "$P_CLI dtls=1" \ | 
|  | 6608 | 0 \ | 
|  | 6609 | -s "Verifying peer X.509 certificate... ok" | 
|  | 6610 |  | 
|  | 6611 | run_test    "DTLS client auth: optional, client has no cert" \ | 
|  | 6612 | "$P_SRV dtls=1 auth_mode=optional" \ | 
|  | 6613 | "$P_CLI dtls=1 crt_file=none key_file=none" \ | 
|  | 6614 | 0 \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6615 | -s "! Certificate was missing" | 
| Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6616 |  | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6617 | run_test    "DTLS client auth: none, client has no cert" \ | 
| Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6618 | "$P_SRV dtls=1 auth_mode=none" \ | 
|  | 6619 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ | 
|  | 6620 | 0 \ | 
|  | 6621 | -c "skip write certificate$" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6622 | -s "! Certificate verification was skipped" | 
| Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6623 |  | 
| Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 6624 | run_test    "DTLS wrong PSK: badmac alert" \ | 
|  | 6625 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ | 
|  | 6626 | "$P_CLI dtls=1 psk=abc124" \ | 
|  | 6627 | 1 \ | 
|  | 6628 | -s "SSL - Verification of the message MAC failed" \ | 
|  | 6629 | -c "SSL - A fatal alert message was received from our peer" | 
|  | 6630 |  | 
| Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 6631 | # Tests for receiving fragmented handshake messages with DTLS | 
|  | 6632 |  | 
|  | 6633 | requires_gnutls | 
|  | 6634 | run_test    "DTLS reassembly: no fragmentation (gnutls server)" \ | 
|  | 6635 | "$G_SRV -u --mtu 2048 -a" \ | 
|  | 6636 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 6637 | 0 \ | 
|  | 6638 | -C "found fragmented DTLS handshake message" \ | 
|  | 6639 | -C "error" | 
|  | 6640 |  | 
|  | 6641 | requires_gnutls | 
|  | 6642 | run_test    "DTLS reassembly: some fragmentation (gnutls server)" \ | 
|  | 6643 | "$G_SRV -u --mtu 512" \ | 
|  | 6644 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 6645 | 0 \ | 
|  | 6646 | -c "found fragmented DTLS handshake message" \ | 
|  | 6647 | -C "error" | 
|  | 6648 |  | 
|  | 6649 | requires_gnutls | 
|  | 6650 | run_test    "DTLS reassembly: more fragmentation (gnutls server)" \ | 
|  | 6651 | "$G_SRV -u --mtu 128" \ | 
|  | 6652 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 6653 | 0 \ | 
|  | 6654 | -c "found fragmented DTLS handshake message" \ | 
|  | 6655 | -C "error" | 
|  | 6656 |  | 
|  | 6657 | requires_gnutls | 
|  | 6658 | run_test    "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ | 
|  | 6659 | "$G_SRV -u --mtu 128" \ | 
|  | 6660 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ | 
|  | 6661 | 0 \ | 
|  | 6662 | -c "found fragmented DTLS handshake message" \ | 
|  | 6663 | -C "error" | 
|  | 6664 |  | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6665 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6666 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6667 | run_test    "DTLS reassembly: fragmentation, renego (gnutls server)" \ | 
|  | 6668 | "$G_SRV -u --mtu 256" \ | 
|  | 6669 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ | 
|  | 6670 | 0 \ | 
|  | 6671 | -c "found fragmented DTLS handshake message" \ | 
|  | 6672 | -c "client hello, adding renegotiation extension" \ | 
|  | 6673 | -c "found renegotiation extension" \ | 
|  | 6674 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6675 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6676 | -C "error" \ | 
|  | 6677 | -s "Extra-header:" | 
|  | 6678 |  | 
|  | 6679 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6680 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6681 | run_test    "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ | 
|  | 6682 | "$G_SRV -u --mtu 256" \ | 
|  | 6683 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ | 
|  | 6684 | 0 \ | 
|  | 6685 | -c "found fragmented DTLS handshake message" \ | 
|  | 6686 | -c "client hello, adding renegotiation extension" \ | 
|  | 6687 | -c "found renegotiation extension" \ | 
|  | 6688 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6689 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6690 | -C "error" \ | 
|  | 6691 | -s "Extra-header:" | 
|  | 6692 |  | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 6693 | run_test    "DTLS reassembly: no fragmentation (openssl server)" \ | 
|  | 6694 | "$O_SRV -dtls -mtu 2048" \ | 
|  | 6695 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 6696 | 0 \ | 
|  | 6697 | -C "found fragmented DTLS handshake message" \ | 
|  | 6698 | -C "error" | 
|  | 6699 |  | 
|  | 6700 | run_test    "DTLS reassembly: some fragmentation (openssl server)" \ | 
|  | 6701 | "$O_SRV -dtls -mtu 768" \ | 
|  | 6702 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 6703 | 0 \ | 
|  | 6704 | -c "found fragmented DTLS handshake message" \ | 
|  | 6705 | -C "error" | 
|  | 6706 |  | 
|  | 6707 | run_test    "DTLS reassembly: more fragmentation (openssl server)" \ | 
|  | 6708 | "$O_SRV -dtls -mtu 256" \ | 
|  | 6709 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 6710 | 0 \ | 
|  | 6711 | -c "found fragmented DTLS handshake message" \ | 
|  | 6712 | -C "error" | 
|  | 6713 |  | 
|  | 6714 | run_test    "DTLS reassembly: fragmentation, nbio (openssl server)" \ | 
|  | 6715 | "$O_SRV -dtls -mtu 256" \ | 
|  | 6716 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ | 
|  | 6717 | 0 \ | 
|  | 6718 | -c "found fragmented DTLS handshake message" \ | 
|  | 6719 | -C "error" | 
|  | 6720 |  | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6721 | # Tests for sending fragmented handshake messages with DTLS | 
|  | 6722 | # | 
|  | 6723 | # Use client auth when we need the client to send large messages, | 
|  | 6724 | # and use large cert chains on both sides too (the long chains we have all use | 
|  | 6725 | # both RSA and ECDSA, but ideally we should have long chains with either). | 
|  | 6726 | # Sizes reached (UDP payload): | 
|  | 6727 | # - 2037B for server certificate | 
|  | 6728 | # - 1542B for client certificate | 
|  | 6729 | # - 1013B for newsessionticket | 
|  | 6730 | # - all others below 512B | 
|  | 6731 | # All those tests assume MAX_CONTENT_LEN is at least 2048 | 
|  | 6732 |  | 
|  | 6733 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 6734 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 6735 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 6736 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6737 | requires_max_content_len 4096 | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6738 | run_test    "DTLS fragmenting: none (for reference)" \ | 
|  | 6739 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 6740 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 6741 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6742 | hs_timeout=2500-60000 \ | 
| Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6743 | max_frag_len=4096" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6744 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 6745 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 6746 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6747 | hs_timeout=2500-60000 \ | 
| Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6748 | max_frag_len=4096" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6749 | 0 \ | 
|  | 6750 | -S "found fragmented DTLS handshake message" \ | 
|  | 6751 | -C "found fragmented DTLS handshake message" \ | 
|  | 6752 | -C "error" | 
|  | 6753 |  | 
|  | 6754 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 6755 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 6756 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 6757 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6758 | requires_max_content_len 2048 | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6759 | run_test    "DTLS fragmenting: server only (max_frag_len)" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6760 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 6761 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 6762 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6763 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6764 | max_frag_len=1024" \ | 
|  | 6765 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 6766 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 6767 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6768 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6769 | max_frag_len=2048" \ | 
|  | 6770 | 0 \ | 
|  | 6771 | -S "found fragmented DTLS handshake message" \ | 
|  | 6772 | -c "found fragmented DTLS handshake message" \ | 
|  | 6773 | -C "error" | 
|  | 6774 |  | 
| Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6775 | # With the MFL extension, the server has no way of forcing | 
|  | 6776 | # the client to not exceed a certain MTU; hence, the following | 
|  | 6777 | # test can't be replicated with an MTU proxy such as the one | 
|  | 6778 | # `client-initiated, server only (max_frag_len)` below. | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6779 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 6780 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 6781 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 6782 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6783 | requires_max_content_len 4096 | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6784 | run_test    "DTLS fragmenting: server only (more) (max_frag_len)" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6785 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 6786 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 6787 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6788 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6789 | max_frag_len=512" \ | 
|  | 6790 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 6791 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 6792 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6793 | hs_timeout=2500-60000 \ | 
| Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6794 | max_frag_len=4096" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6795 | 0 \ | 
|  | 6796 | -S "found fragmented DTLS handshake message" \ | 
|  | 6797 | -c "found fragmented DTLS handshake message" \ | 
|  | 6798 | -C "error" | 
|  | 6799 |  | 
|  | 6800 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 6801 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 6802 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 6803 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6804 | requires_max_content_len 2048 | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6805 | 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] | 6806 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ | 
|  | 6807 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 6808 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6809 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6810 | max_frag_len=2048" \ | 
|  | 6811 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 6812 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 6813 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6814 | hs_timeout=2500-60000 \ | 
|  | 6815 | max_frag_len=1024" \ | 
|  | 6816 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6817 | -S "found fragmented DTLS handshake message" \ | 
|  | 6818 | -c "found fragmented DTLS handshake message" \ | 
|  | 6819 | -C "error" | 
|  | 6820 |  | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6821 | # While not required by the standard defining the MFL extension | 
|  | 6822 | # (according to which it only applies to records, not to datagrams), | 
|  | 6823 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, | 
|  | 6824 | # as otherwise there wouldn't be any means to communicate MTU restrictions | 
|  | 6825 | # to the peer. | 
|  | 6826 | # The next test checks that no datagrams significantly larger than the | 
|  | 6827 | # negotiated MFL are sent. | 
|  | 6828 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 6829 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 6830 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 6831 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6832 | requires_max_content_len 2048 | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6833 | 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] | 6834 | -p "$P_PXY mtu=1110" \ | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6835 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ | 
|  | 6836 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 6837 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6838 | hs_timeout=2500-60000 \ | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6839 | max_frag_len=2048" \ | 
|  | 6840 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 6841 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 6842 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6843 | hs_timeout=2500-60000 \ | 
|  | 6844 | max_frag_len=1024" \ | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6845 | 0 \ | 
|  | 6846 | -S "found fragmented DTLS handshake message" \ | 
|  | 6847 | -c "found fragmented DTLS handshake message" \ | 
|  | 6848 | -C "error" | 
|  | 6849 |  | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6850 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 6851 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 6852 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 6853 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6854 | requires_max_content_len 2048 | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6855 | run_test    "DTLS fragmenting: client-initiated, both (max_frag_len)" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6856 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 6857 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 6858 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6859 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6860 | max_frag_len=2048" \ | 
|  | 6861 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 6862 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 6863 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6864 | hs_timeout=2500-60000 \ | 
|  | 6865 | max_frag_len=1024" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6866 | 0 \ | 
|  | 6867 | -s "found fragmented DTLS handshake message" \ | 
|  | 6868 | -c "found fragmented DTLS handshake message" \ | 
|  | 6869 | -C "error" | 
|  | 6870 |  | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6871 | # While not required by the standard defining the MFL extension | 
|  | 6872 | # (according to which it only applies to records, not to datagrams), | 
|  | 6873 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, | 
|  | 6874 | # as otherwise there wouldn't be any means to communicate MTU restrictions | 
|  | 6875 | # to the peer. | 
|  | 6876 | # The next test checks that no datagrams significantly larger than the | 
|  | 6877 | # negotiated MFL are sent. | 
|  | 6878 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 6879 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 6880 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 6881 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6882 | requires_max_content_len 2048 | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6883 | run_test    "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ | 
| Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 6884 | -p "$P_PXY mtu=1110" \ | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6885 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 6886 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 6887 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6888 | hs_timeout=2500-60000 \ | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6889 | max_frag_len=2048" \ | 
|  | 6890 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 6891 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 6892 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6893 | hs_timeout=2500-60000 \ | 
|  | 6894 | max_frag_len=1024" \ | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6895 | 0 \ | 
|  | 6896 | -s "found fragmented DTLS handshake message" \ | 
|  | 6897 | -c "found fragmented DTLS handshake message" \ | 
|  | 6898 | -C "error" | 
|  | 6899 |  | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6900 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 6901 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 6902 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6903 | requires_max_content_len 4096 | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6904 | run_test    "DTLS fragmenting: none (for reference) (MTU)" \ | 
|  | 6905 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 6906 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 6907 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6908 | hs_timeout=2500-60000 \ | 
| Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6909 | mtu=4096" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6910 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 6911 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 6912 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6913 | hs_timeout=2500-60000 \ | 
| Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6914 | mtu=4096" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6915 | 0 \ | 
|  | 6916 | -S "found fragmented DTLS handshake message" \ | 
|  | 6917 | -C "found fragmented DTLS handshake message" \ | 
|  | 6918 | -C "error" | 
|  | 6919 |  | 
|  | 6920 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 6921 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 6922 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6923 | requires_max_content_len 4096 | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6924 | run_test    "DTLS fragmenting: client (MTU)" \ | 
|  | 6925 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 6926 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 6927 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6928 | hs_timeout=3500-60000 \ | 
| Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6929 | mtu=4096" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6930 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 6931 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 6932 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6933 | hs_timeout=3500-60000 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6934 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6935 | 0 \ | 
|  | 6936 | -s "found fragmented DTLS handshake message" \ | 
|  | 6937 | -C "found fragmented DTLS handshake message" \ | 
|  | 6938 | -C "error" | 
|  | 6939 |  | 
|  | 6940 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 6941 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 6942 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6943 | requires_max_content_len 2048 | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6944 | run_test    "DTLS fragmenting: server (MTU)" \ | 
|  | 6945 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 6946 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 6947 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6948 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6949 | mtu=512" \ | 
|  | 6950 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 6951 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 6952 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6953 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6954 | mtu=2048" \ | 
|  | 6955 | 0 \ | 
|  | 6956 | -S "found fragmented DTLS handshake message" \ | 
|  | 6957 | -c "found fragmented DTLS handshake message" \ | 
|  | 6958 | -C "error" | 
|  | 6959 |  | 
|  | 6960 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 6961 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 6962 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6963 | requires_max_content_len 2048 | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6964 | run_test    "DTLS fragmenting: both (MTU=1024)" \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6965 | -p "$P_PXY mtu=1024" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6966 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 6967 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 6968 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6969 | hs_timeout=2500-60000 \ | 
| Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 6970 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6971 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 6972 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 6973 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6974 | hs_timeout=2500-60000 \ | 
|  | 6975 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6976 | 0 \ | 
|  | 6977 | -s "found fragmented DTLS handshake message" \ | 
|  | 6978 | -c "found fragmented DTLS handshake message" \ | 
|  | 6979 | -C "error" | 
|  | 6980 |  | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6981 | # 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] | 6982 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 6983 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 6984 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 6985 | requires_config_enabled MBEDTLS_SHA256_C | 
| Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 6986 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6987 | requires_config_enabled MBEDTLS_AES_C | 
|  | 6988 | requires_config_enabled MBEDTLS_GCM_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6989 | requires_max_content_len 2048 | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6990 | run_test    "DTLS fragmenting: both (MTU=512)" \ | 
| Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 6991 | -p "$P_PXY mtu=512" \ | 
| Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 6992 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 6993 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 6994 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6995 | hs_timeout=2500-60000 \ | 
| Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 6996 | mtu=512" \ | 
|  | 6997 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 6998 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 6999 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7000 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 7001 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7002 | mtu=512" \ | 
| Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7003 | 0 \ | 
| Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7004 | -s "found fragmented DTLS handshake message" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7005 | -c "found fragmented DTLS handshake message" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7006 | -C "error" | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7007 |  | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7008 | # Test for automatic MTU reduction on repeated resend. | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7009 | # 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] | 7010 | # The ratio of max/min timeout should ideally equal 4 to accept two | 
|  | 7011 | # retransmissions, but in some cases (like both the server and client using | 
|  | 7012 | # fragmentation and auto-reduction) an extra retransmission might occur, | 
|  | 7013 | # hence the ratio of 8. | 
| Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 7014 | not_with_valgrind | 
| Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7015 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7016 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7017 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7018 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7019 | requires_config_enabled MBEDTLS_AES_C | 
|  | 7020 | requires_config_enabled MBEDTLS_GCM_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7021 | requires_max_content_len 2048 | 
| Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7022 | run_test    "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ | 
| Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7023 | -p "$P_PXY mtu=508" \ | 
|  | 7024 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7025 | crt_file=data_files/server7_int-ca.crt \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7026 | key_file=data_files/server7.key \ | 
|  | 7027 | hs_timeout=400-3200" \ | 
| Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7028 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7029 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7030 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7031 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 7032 | hs_timeout=400-3200" \ | 
| Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7033 | 0 \ | 
|  | 7034 | -s "found fragmented DTLS handshake message" \ | 
|  | 7035 | -c "found fragmented DTLS handshake message" \ | 
|  | 7036 | -C "error" | 
|  | 7037 |  | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7038 | # 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] | 7039 | only_with_valgrind | 
|  | 7040 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7041 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7042 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7043 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7044 | requires_config_enabled MBEDTLS_AES_C | 
|  | 7045 | requires_config_enabled MBEDTLS_GCM_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7046 | requires_max_content_len 2048 | 
| Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7047 | run_test    "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ | 
| Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7048 | -p "$P_PXY mtu=508" \ | 
|  | 7049 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7050 | crt_file=data_files/server7_int-ca.crt \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7051 | key_file=data_files/server7.key \ | 
| Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7052 | hs_timeout=250-10000" \ | 
|  | 7053 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7054 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7055 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7056 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
| Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7057 | hs_timeout=250-10000" \ | 
|  | 7058 | 0 \ | 
|  | 7059 | -s "found fragmented DTLS handshake message" \ | 
|  | 7060 | -c "found fragmented DTLS handshake message" \ | 
|  | 7061 | -C "error" | 
|  | 7062 |  | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7063 | # 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] | 7064 | # OTOH the client might resend if the server is to slow to reset after sending | 
|  | 7065 | # a HelloVerifyRequest, so only check for no retransmission server-side | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7066 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7067 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7068 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7069 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7070 | requires_max_content_len 2048 | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7071 | run_test    "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7072 | -p "$P_PXY mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7073 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7074 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7075 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7076 | hs_timeout=10000-60000 \ | 
|  | 7077 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7078 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7079 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7080 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7081 | hs_timeout=10000-60000 \ | 
|  | 7082 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7083 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7084 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7085 | -s "found fragmented DTLS handshake message" \ | 
|  | 7086 | -c "found fragmented DTLS handshake message" \ | 
|  | 7087 | -C "error" | 
|  | 7088 |  | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7089 | # 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] | 7090 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend | 
|  | 7091 | # OTOH the client might resend if the server is to slow to reset after sending | 
|  | 7092 | # a HelloVerifyRequest, so only check for no retransmission server-side | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7093 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7094 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7095 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7096 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7097 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7098 | requires_config_enabled MBEDTLS_AES_C | 
|  | 7099 | requires_config_enabled MBEDTLS_GCM_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7100 | requires_max_content_len 2048 | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7101 | run_test    "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7102 | -p "$P_PXY mtu=512" \ | 
|  | 7103 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7104 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7105 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7106 | hs_timeout=10000-60000 \ | 
|  | 7107 | mtu=512" \ | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7108 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7109 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7110 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7111 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 7112 | hs_timeout=10000-60000 \ | 
|  | 7113 | mtu=512" \ | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7114 | 0 \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7115 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7116 | -s "found fragmented DTLS handshake message" \ | 
|  | 7117 | -c "found fragmented DTLS handshake message" \ | 
|  | 7118 | -C "error" | 
|  | 7119 |  | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7120 | not_with_valgrind # spurious autoreduction due to timeout | 
|  | 7121 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7122 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7123 | requires_config_enabled MBEDTLS_ECDSA_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: proxy MTU, simple handshake, nbio (MTU=1024)" \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7126 | -p "$P_PXY mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7127 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7128 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7129 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7130 | hs_timeout=10000-60000 \ | 
|  | 7131 | mtu=1024 nbio=2" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 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 | hs_timeout=10000-60000 \ | 
|  | 7136 | mtu=1024 nbio=2" \ | 
|  | 7137 | 0 \ | 
|  | 7138 | -S "autoreduction" \ | 
|  | 7139 | -s "found fragmented DTLS handshake message" \ | 
|  | 7140 | -c "found fragmented DTLS handshake message" \ | 
|  | 7141 | -C "error" | 
|  | 7142 |  | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7143 | # 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] | 7144 | not_with_valgrind # spurious autoreduction due to timeout | 
|  | 7145 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7146 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7147 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7148 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7149 | requires_config_enabled MBEDTLS_AES_C | 
|  | 7150 | requires_config_enabled MBEDTLS_GCM_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7151 | requires_max_content_len 2048 | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7152 | run_test    "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ | 
|  | 7153 | -p "$P_PXY mtu=512" \ | 
|  | 7154 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7155 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7156 | key_file=data_files/server7.key \ | 
|  | 7157 | hs_timeout=10000-60000 \ | 
|  | 7158 | mtu=512 nbio=2" \ | 
|  | 7159 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7160 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7161 | key_file=data_files/server8.key \ | 
|  | 7162 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 7163 | hs_timeout=10000-60000 \ | 
|  | 7164 | mtu=512 nbio=2" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7165 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7166 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7167 | -s "found fragmented DTLS handshake message" \ | 
|  | 7168 | -c "found fragmented DTLS handshake message" \ | 
|  | 7169 | -C "error" | 
|  | 7170 |  | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7171 | # 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] | 7172 | # This ensures things still work after session_reset(). | 
|  | 7173 | # It also exercises the "resumed handshake" flow. | 
| Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7174 | # Since we don't support reading fragmented ClientHello yet, | 
|  | 7175 | # up the MTU to 1450 (larger than ClientHello with session ticket, | 
|  | 7176 | # but still smaller than client's Certificate to ensure fragmentation). | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7177 | # An autoreduction on the client-side might happen if the server is | 
|  | 7178 | # slow to reset, therefore omitting '-C "autoreduction"' below. | 
| Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 7179 | # reco_delay avoids races where the client reconnects before the server has | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7180 | # resumed listening, which would result in a spurious autoreduction. | 
|  | 7181 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7182 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7183 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7184 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7185 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7186 | requires_config_enabled MBEDTLS_AES_C | 
|  | 7187 | requires_config_enabled MBEDTLS_GCM_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7188 | requires_max_content_len 2048 | 
| Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7189 | run_test    "DTLS fragmenting: proxy MTU, resumed handshake" \ | 
|  | 7190 | -p "$P_PXY mtu=1450" \ | 
|  | 7191 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7192 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7193 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7194 | hs_timeout=10000-60000 \ | 
| Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7195 | mtu=1450" \ | 
|  | 7196 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7197 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7198 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7199 | hs_timeout=10000-60000 \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7200 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 7201 | 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] | 7202 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7203 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7204 | -s "found fragmented DTLS handshake message" \ | 
|  | 7205 | -c "found fragmented DTLS handshake message" \ | 
|  | 7206 | -C "error" | 
|  | 7207 |  | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7208 | # An autoreduction on the client-side might happen if the server is | 
|  | 7209 | # slow to reset, therefore omitting '-C "autoreduction"' below. | 
|  | 7210 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7211 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7212 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7213 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7214 | requires_config_enabled MBEDTLS_SHA256_C | 
| Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7215 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7216 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 7217 | requires_config_enabled MBEDTLS_CHACHAPOLY_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7218 | requires_max_content_len 2048 | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7219 | run_test    "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ | 
|  | 7220 | -p "$P_PXY mtu=512" \ | 
|  | 7221 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7222 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7223 | key_file=data_files/server7.key \ | 
|  | 7224 | exchanges=2 renegotiation=1 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7225 | hs_timeout=10000-60000 \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7226 | mtu=512" \ | 
|  | 7227 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7228 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7229 | key_file=data_files/server8.key \ | 
|  | 7230 | exchanges=2 renegotiation=1 renegotiate=1 \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7231 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7232 | hs_timeout=10000-60000 \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7233 | mtu=512" \ | 
|  | 7234 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7235 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7236 | -s "found fragmented DTLS handshake message" \ | 
|  | 7237 | -c "found fragmented DTLS handshake message" \ | 
|  | 7238 | -C "error" | 
|  | 7239 |  | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7240 | # An autoreduction on the client-side might happen if the server is | 
|  | 7241 | # slow to reset, therefore omitting '-C "autoreduction"' below. | 
|  | 7242 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7243 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7244 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7245 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7246 | requires_config_enabled MBEDTLS_SHA256_C | 
| Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7247 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7248 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 7249 | requires_config_enabled MBEDTLS_AES_C | 
|  | 7250 | requires_config_enabled MBEDTLS_GCM_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7251 | requires_max_content_len 2048 | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7252 | run_test    "DTLS fragmenting: proxy MTU, AES-GCM renego" \ | 
|  | 7253 | -p "$P_PXY mtu=512" \ | 
|  | 7254 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7255 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7256 | key_file=data_files/server7.key \ | 
|  | 7257 | exchanges=2 renegotiation=1 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7258 | hs_timeout=10000-60000 \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7259 | mtu=512" \ | 
|  | 7260 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7261 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7262 | key_file=data_files/server8.key \ | 
|  | 7263 | exchanges=2 renegotiation=1 renegotiate=1 \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7264 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7265 | hs_timeout=10000-60000 \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7266 | mtu=512" \ | 
|  | 7267 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7268 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7269 | -s "found fragmented DTLS handshake message" \ | 
|  | 7270 | -c "found fragmented DTLS handshake message" \ | 
|  | 7271 | -C "error" | 
|  | 7272 |  | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7273 | # An autoreduction on the client-side might happen if the server is | 
|  | 7274 | # slow to reset, therefore omitting '-C "autoreduction"' below. | 
|  | 7275 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7276 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7277 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7278 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7279 | requires_config_enabled MBEDTLS_SHA256_C | 
| Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7280 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7281 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 7282 | requires_config_enabled MBEDTLS_AES_C | 
|  | 7283 | requires_config_enabled MBEDTLS_CCM_C | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7284 | requires_max_content_len 2048 | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7285 | run_test    "DTLS fragmenting: proxy MTU, AES-CCM renego" \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7286 | -p "$P_PXY mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7287 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7288 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7289 | key_file=data_files/server7.key \ | 
|  | 7290 | exchanges=2 renegotiation=1 \ | 
|  | 7291 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7292 | hs_timeout=10000-60000 \ | 
|  | 7293 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 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 | exchanges=2 renegotiation=1 renegotiate=1 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7298 | hs_timeout=10000-60000 \ | 
|  | 7299 | mtu=1024" \ | 
| 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 | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7306 | # An autoreduction on the client-side might happen if the server is | 
|  | 7307 | # slow to reset, therefore omitting '-C "autoreduction"' below. | 
|  | 7308 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7309 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7310 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7311 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7312 | requires_config_enabled MBEDTLS_SHA256_C | 
| Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7313 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7314 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 7315 | requires_config_enabled MBEDTLS_AES_C | 
|  | 7316 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC | 
|  | 7317 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7318 | requires_max_content_len 2048 | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7319 | run_test    "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7320 | -p "$P_PXY mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7321 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7322 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7323 | key_file=data_files/server7.key \ | 
|  | 7324 | exchanges=2 renegotiation=1 \ | 
|  | 7325 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7326 | hs_timeout=10000-60000 \ | 
|  | 7327 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7328 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7329 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7330 | key_file=data_files/server8.key \ | 
|  | 7331 | exchanges=2 renegotiation=1 renegotiate=1 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7332 | hs_timeout=10000-60000 \ | 
|  | 7333 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7334 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7335 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7336 | -s "found fragmented DTLS handshake message" \ | 
|  | 7337 | -c "found fragmented DTLS handshake message" \ | 
|  | 7338 | -C "error" | 
|  | 7339 |  | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7340 | # An autoreduction on the client-side might happen if the server is | 
|  | 7341 | # slow to reset, therefore omitting '-C "autoreduction"' below. | 
|  | 7342 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7343 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7344 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7345 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7346 | requires_config_enabled MBEDTLS_SHA256_C | 
| Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7347 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7348 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 7349 | requires_config_enabled MBEDTLS_AES_C | 
|  | 7350 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7351 | requires_max_content_len 2048 | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7352 | run_test    "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7353 | -p "$P_PXY mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7354 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7355 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7356 | key_file=data_files/server7.key \ | 
|  | 7357 | exchanges=2 renegotiation=1 \ | 
|  | 7358 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7359 | hs_timeout=10000-60000 \ | 
|  | 7360 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7361 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7362 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7363 | key_file=data_files/server8.key \ | 
|  | 7364 | exchanges=2 renegotiation=1 renegotiate=1 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7365 | hs_timeout=10000-60000 \ | 
|  | 7366 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7367 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7368 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7369 | -s "found fragmented DTLS handshake message" \ | 
|  | 7370 | -c "found fragmented DTLS handshake message" \ | 
|  | 7371 | -C "error" | 
|  | 7372 |  | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7373 | # 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] | 7374 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7375 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7376 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7377 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7378 | requires_config_enabled MBEDTLS_AES_C | 
|  | 7379 | requires_config_enabled MBEDTLS_GCM_C | 
| Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7380 | client_needs_more_time 2 | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7381 | requires_max_content_len 2048 | 
| Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7382 | run_test    "DTLS fragmenting: proxy MTU + 3d" \ | 
|  | 7383 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7384 | "$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] | 7385 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7386 | key_file=data_files/server7.key \ | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7387 | hs_timeout=250-10000 mtu=512" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7388 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7389 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7390 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7391 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7392 | hs_timeout=250-10000 mtu=512" \ | 
| Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7393 | 0 \ | 
|  | 7394 | -s "found fragmented DTLS handshake message" \ | 
|  | 7395 | -c "found fragmented DTLS handshake message" \ | 
|  | 7396 | -C "error" | 
|  | 7397 |  | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7398 | # 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] | 7399 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7400 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7401 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7402 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7403 | requires_config_enabled MBEDTLS_AES_C | 
|  | 7404 | requires_config_enabled MBEDTLS_GCM_C | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7405 | client_needs_more_time 2 | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7406 | requires_max_content_len 2048 | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7407 | run_test    "DTLS fragmenting: proxy MTU + 3d, nbio" \ | 
|  | 7408 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ | 
|  | 7409 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7410 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7411 | key_file=data_files/server7.key \ | 
|  | 7412 | hs_timeout=250-10000 mtu=512 nbio=2" \ | 
|  | 7413 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7414 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7415 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7416 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7417 | hs_timeout=250-10000 mtu=512 nbio=2" \ | 
|  | 7418 | 0 \ | 
|  | 7419 | -s "found fragmented DTLS handshake message" \ | 
|  | 7420 | -c "found fragmented DTLS handshake message" \ | 
|  | 7421 | -C "error" | 
|  | 7422 |  | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7423 | # interop tests for DTLS fragmentating with reliable connection | 
|  | 7424 | # | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7425 | # here and below we just want to test that the we fragment in a way that | 
|  | 7426 | # pleases other implementations, so we don't need the peer to fragment | 
|  | 7427 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7428 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7429 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7430 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7431 | requires_gnutls | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7432 | requires_max_content_len 2048 | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7433 | run_test    "DTLS fragmenting: gnutls server, DTLS 1.2" \ | 
|  | 7434 | "$G_SRV -u" \ | 
|  | 7435 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7436 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7437 | key_file=data_files/server8.key \ | 
|  | 7438 | mtu=512 force_version=dtls1_2" \ | 
|  | 7439 | 0 \ | 
|  | 7440 | -c "fragmenting handshake message" \ | 
|  | 7441 | -C "error" | 
|  | 7442 |  | 
| Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 7443 | # We use --insecure for the GnuTLS client because it expects | 
|  | 7444 | # the hostname / IP it connects to to be the name used in the | 
|  | 7445 | # certificate obtained from the server. Here, however, it | 
|  | 7446 | # connects to 127.0.0.1 while our test certificates use 'localhost' | 
|  | 7447 | # as the server name in the certificate. This will make the | 
|  | 7448 | # certifiate validation fail, but passing --insecure makes | 
|  | 7449 | # GnuTLS continue the connection nonetheless. | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7450 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7451 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7452 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7453 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7454 | requires_gnutls | 
| Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 7455 | requires_not_i686 | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7456 | requires_max_content_len 2048 | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7457 | run_test    "DTLS fragmenting: gnutls client, DTLS 1.2" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7458 | "$P_SRV dtls=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7459 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7460 | key_file=data_files/server7.key \ | 
|  | 7461 | mtu=512 force_version=dtls1_2" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7462 | "$G_CLI -u --insecure 127.0.0.1" \ | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7463 | 0 \ | 
|  | 7464 | -s "fragmenting handshake message" | 
|  | 7465 |  | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7466 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7467 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7468 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7469 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7470 | requires_max_content_len 2048 | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7471 | run_test    "DTLS fragmenting: openssl server, DTLS 1.2" \ | 
|  | 7472 | "$O_SRV -dtls1_2 -verify 10" \ | 
|  | 7473 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7474 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7475 | key_file=data_files/server8.key \ | 
|  | 7476 | mtu=512 force_version=dtls1_2" \ | 
|  | 7477 | 0 \ | 
|  | 7478 | -c "fragmenting handshake message" \ | 
|  | 7479 | -C "error" | 
|  | 7480 |  | 
|  | 7481 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7482 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7483 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7484 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7485 | requires_max_content_len 2048 | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7486 | run_test    "DTLS fragmenting: openssl client, DTLS 1.2" \ | 
|  | 7487 | "$P_SRV dtls=1 debug_level=2 \ | 
|  | 7488 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7489 | key_file=data_files/server7.key \ | 
|  | 7490 | mtu=512 force_version=dtls1_2" \ | 
|  | 7491 | "$O_CLI -dtls1_2" \ | 
|  | 7492 | 0 \ | 
|  | 7493 | -s "fragmenting handshake message" | 
|  | 7494 |  | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7495 | # interop tests for DTLS fragmentating with unreliable connection | 
|  | 7496 | # | 
|  | 7497 | # again we just want to test that the we fragment in a way that | 
|  | 7498 | # pleases other implementations, so we don't need the peer to fragment | 
|  | 7499 | requires_gnutls_next | 
|  | 7500 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7501 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7502 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7503 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7504 | client_needs_more_time 4 | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7505 | requires_max_content_len 2048 | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7506 | run_test    "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ | 
|  | 7507 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ | 
|  | 7508 | "$G_NEXT_SRV -u" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7509 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7510 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7511 | key_file=data_files/server8.key \ | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7512 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7513 | 0 \ | 
|  | 7514 | -c "fragmenting handshake message" \ | 
|  | 7515 | -C "error" | 
|  | 7516 |  | 
|  | 7517 | requires_gnutls_next | 
|  | 7518 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7519 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7520 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7521 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
|  | 7522 | client_needs_more_time 4 | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7523 | requires_max_content_len 2048 | 
| Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7524 | run_test    "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ | 
|  | 7525 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ | 
|  | 7526 | "$P_SRV dtls=1 debug_level=2 \ | 
|  | 7527 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7528 | key_file=data_files/server7.key \ | 
|  | 7529 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ | 
| k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 7530 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ | 
| Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7531 | 0 \ | 
|  | 7532 | -s "fragmenting handshake message" | 
|  | 7533 |  | 
| Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7534 | ## Interop test with OpenSSL might trigger a bug in recent versions (including | 
|  | 7535 | ## all versions installed on the CI machines), reported here: | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7536 | ## Bug report: https://github.com/openssl/openssl/issues/6902 | 
| Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7537 | ## They should be re-enabled once a fixed version of OpenSSL is available | 
|  | 7538 | ## (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] | 7539 | skip_next_test | 
|  | 7540 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7541 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7542 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7543 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
|  | 7544 | client_needs_more_time 4 | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7545 | requires_max_content_len 2048 | 
| Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7546 | run_test    "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ | 
|  | 7547 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ | 
|  | 7548 | "$O_SRV -dtls1_2 -verify 10" \ | 
|  | 7549 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7550 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7551 | key_file=data_files/server8.key \ | 
|  | 7552 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ | 
|  | 7553 | 0 \ | 
|  | 7554 | -c "fragmenting handshake message" \ | 
|  | 7555 | -C "error" | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7556 |  | 
| Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7557 | skip_next_test | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7558 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7559 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7560 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7561 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
|  | 7562 | client_needs_more_time 4 | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7563 | requires_max_content_len 2048 | 
| Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7564 | run_test    "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ | 
|  | 7565 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ | 
|  | 7566 | "$P_SRV dtls=1 debug_level=2 \ | 
|  | 7567 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7568 | key_file=data_files/server7.key \ | 
|  | 7569 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ | 
|  | 7570 | "$O_CLI -dtls1_2" \ | 
|  | 7571 | 0 \ | 
|  | 7572 | -s "fragmenting handshake message" | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7573 |  | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7574 | # Tests for DTLS-SRTP (RFC 5764) | 
|  | 7575 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 7576 | run_test  "DTLS-SRTP all profiles supported" \ | 
|  | 7577 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 7578 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 7579 | 0 \ | 
|  | 7580 | -s "found use_srtp extension" \ | 
|  | 7581 | -s "found srtp profile" \ | 
|  | 7582 | -s "selected srtp profile" \ | 
|  | 7583 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7584 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7585 | -c "client hello, adding use_srtp extension" \ | 
|  | 7586 | -c "found use_srtp extension" \ | 
|  | 7587 | -c "found srtp profile" \ | 
|  | 7588 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7589 | -c "DTLS-SRTP key material is"\ | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7590 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7591 | -C "error" | 
|  | 7592 |  | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7593 |  | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7594 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 7595 | run_test  "DTLS-SRTP server supports all profiles. Client supports one profile." \ | 
|  | 7596 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7597 | "$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] | 7598 | 0 \ | 
|  | 7599 | -s "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7600 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ | 
|  | 7601 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7602 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7603 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7604 | -c "client hello, adding use_srtp extension" \ | 
|  | 7605 | -c "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7606 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7607 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7608 | -c "DTLS-SRTP key material is"\ | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7609 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7610 | -C "error" | 
|  | 7611 |  | 
|  | 7612 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7613 | run_test  "DTLS-SRTP server supports one profile. Client supports all profiles." \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7614 | "$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] | 7615 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 7616 | 0 \ | 
|  | 7617 | -s "found use_srtp extension" \ | 
|  | 7618 | -s "found srtp profile" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7619 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7620 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7621 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7622 | -c "client hello, adding use_srtp extension" \ | 
|  | 7623 | -c "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7624 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7625 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7626 | -c "DTLS-SRTP key material is"\ | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7627 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7628 | -C "error" | 
|  | 7629 |  | 
|  | 7630 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 7631 | run_test  "DTLS-SRTP server and Client support only one matching profile." \ | 
|  | 7632 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ | 
|  | 7633 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ | 
|  | 7634 | 0 \ | 
|  | 7635 | -s "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7636 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
|  | 7637 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7638 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7639 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7640 | -c "client hello, adding use_srtp extension" \ | 
|  | 7641 | -c "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7642 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7643 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7644 | -c "DTLS-SRTP key material is"\ | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7645 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7646 | -C "error" | 
|  | 7647 |  | 
|  | 7648 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 7649 | run_test  "DTLS-SRTP server and Client support only one different profile." \ | 
|  | 7650 | "$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] | 7651 | "$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] | 7652 | 0 \ | 
|  | 7653 | -s "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7654 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7655 | -S "selected srtp profile" \ | 
|  | 7656 | -S "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7657 | -S "DTLS-SRTP key material is"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7658 | -c "client hello, adding use_srtp extension" \ | 
|  | 7659 | -C "found use_srtp extension" \ | 
|  | 7660 | -C "found srtp profile" \ | 
|  | 7661 | -C "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7662 | -C "DTLS-SRTP key material is"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7663 | -C "error" | 
|  | 7664 |  | 
|  | 7665 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 7666 | run_test  "DTLS-SRTP server doesn't support use_srtp extension." \ | 
|  | 7667 | "$P_SRV dtls=1 debug_level=3" \ | 
|  | 7668 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 7669 | 0 \ | 
|  | 7670 | -s "found use_srtp extension" \ | 
|  | 7671 | -S "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7672 | -S "DTLS-SRTP key material is"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7673 | -c "client hello, adding use_srtp extension" \ | 
|  | 7674 | -C "found use_srtp extension" \ | 
|  | 7675 | -C "found srtp profile" \ | 
|  | 7676 | -C "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7677 | -C "DTLS-SRTP key material is"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7678 | -C "error" | 
|  | 7679 |  | 
|  | 7680 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 7681 | run_test  "DTLS-SRTP all profiles supported. mki used" \ | 
|  | 7682 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ | 
|  | 7683 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ | 
|  | 7684 | 0 \ | 
|  | 7685 | -s "found use_srtp extension" \ | 
|  | 7686 | -s "found srtp profile" \ | 
|  | 7687 | -s "selected srtp profile" \ | 
|  | 7688 | -s "server hello, adding use_srtp extension" \ | 
|  | 7689 | -s "dumping 'using mki' (8 bytes)" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7690 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7691 | -c "client hello, adding use_srtp extension" \ | 
|  | 7692 | -c "found use_srtp extension" \ | 
|  | 7693 | -c "found srtp profile" \ | 
|  | 7694 | -c "selected srtp profile" \ | 
|  | 7695 | -c "dumping 'sending mki' (8 bytes)" \ | 
|  | 7696 | -c "dumping 'received mki' (8 bytes)" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7697 | -c "DTLS-SRTP key material is"\ | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7698 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
| Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 7699 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7700 | -C "error" | 
|  | 7701 |  | 
|  | 7702 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 7703 | run_test  "DTLS-SRTP all profiles supported. server doesn't support mki." \ | 
|  | 7704 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 7705 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ | 
|  | 7706 | 0 \ | 
|  | 7707 | -s "found use_srtp extension" \ | 
|  | 7708 | -s "found srtp profile" \ | 
|  | 7709 | -s "selected srtp profile" \ | 
|  | 7710 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7711 | -s "DTLS-SRTP key material is"\ | 
| Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 7712 | -s "DTLS-SRTP no mki value negotiated"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7713 | -S "dumping 'using mki' (8 bytes)" \ | 
|  | 7714 | -c "client hello, adding use_srtp extension" \ | 
|  | 7715 | -c "found use_srtp extension" \ | 
|  | 7716 | -c "found srtp profile" \ | 
|  | 7717 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7718 | -c "DTLS-SRTP key material is"\ | 
| Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 7719 | -c "DTLS-SRTP no mki value negotiated"\ | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7720 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7721 | -c "dumping 'sending mki' (8 bytes)" \ | 
|  | 7722 | -C "dumping 'received mki' (8 bytes)" \ | 
|  | 7723 | -C "error" | 
|  | 7724 |  | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7725 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 7726 | run_test  "DTLS-SRTP all profiles supported. openssl client." \ | 
|  | 7727 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 7728 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 7729 | 0 \ | 
|  | 7730 | -s "found use_srtp extension" \ | 
|  | 7731 | -s "found srtp profile" \ | 
|  | 7732 | -s "selected srtp profile" \ | 
|  | 7733 | -s "server hello, adding use_srtp extension" \ | 
|  | 7734 | -s "DTLS-SRTP key material is"\ | 
|  | 7735 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
|  | 7736 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" | 
|  | 7737 |  | 
|  | 7738 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 7739 | run_test  "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ | 
|  | 7740 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 7741 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 7742 | 0 \ | 
|  | 7743 | -s "found use_srtp extension" \ | 
|  | 7744 | -s "found srtp profile" \ | 
|  | 7745 | -s "selected srtp profile" \ | 
|  | 7746 | -s "server hello, adding use_srtp extension" \ | 
|  | 7747 | -s "DTLS-SRTP key material is"\ | 
|  | 7748 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
|  | 7749 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" | 
|  | 7750 |  | 
|  | 7751 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 7752 | run_test  "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ | 
|  | 7753 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 7754 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 7755 | 0 \ | 
|  | 7756 | -s "found use_srtp extension" \ | 
|  | 7757 | -s "found srtp profile" \ | 
|  | 7758 | -s "selected srtp profile" \ | 
|  | 7759 | -s "server hello, adding use_srtp extension" \ | 
|  | 7760 | -s "DTLS-SRTP key material is"\ | 
|  | 7761 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
|  | 7762 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" | 
|  | 7763 |  | 
|  | 7764 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 7765 | run_test  "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ | 
|  | 7766 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ | 
|  | 7767 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 7768 | 0 \ | 
|  | 7769 | -s "found use_srtp extension" \ | 
|  | 7770 | -s "found srtp profile" \ | 
|  | 7771 | -s "selected srtp profile" \ | 
|  | 7772 | -s "server hello, adding use_srtp extension" \ | 
|  | 7773 | -s "DTLS-SRTP key material is"\ | 
|  | 7774 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
|  | 7775 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" | 
|  | 7776 |  | 
|  | 7777 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 7778 | run_test  "DTLS-SRTP server and Client support only one matching profile. openssl client." \ | 
|  | 7779 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ | 
|  | 7780 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 7781 | 0 \ | 
|  | 7782 | -s "found use_srtp extension" \ | 
|  | 7783 | -s "found srtp profile" \ | 
|  | 7784 | -s "selected srtp profile" \ | 
|  | 7785 | -s "server hello, adding use_srtp extension" \ | 
|  | 7786 | -s "DTLS-SRTP key material is"\ | 
|  | 7787 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
|  | 7788 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" | 
|  | 7789 |  | 
|  | 7790 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 7791 | run_test  "DTLS-SRTP server and Client support only one different profile. openssl client." \ | 
|  | 7792 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ | 
|  | 7793 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 7794 | 0 \ | 
|  | 7795 | -s "found use_srtp extension" \ | 
|  | 7796 | -s "found srtp profile" \ | 
|  | 7797 | -S "selected srtp profile" \ | 
|  | 7798 | -S "server hello, adding use_srtp extension" \ | 
|  | 7799 | -S "DTLS-SRTP key material is"\ | 
|  | 7800 | -C "SRTP Extension negotiated, profile" | 
|  | 7801 |  | 
|  | 7802 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 7803 | run_test  "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ | 
|  | 7804 | "$P_SRV dtls=1 debug_level=3" \ | 
|  | 7805 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 7806 | 0 \ | 
|  | 7807 | -s "found use_srtp extension" \ | 
|  | 7808 | -S "server hello, adding use_srtp extension" \ | 
|  | 7809 | -S "DTLS-SRTP key material is"\ | 
|  | 7810 | -C "SRTP Extension negotiated, profile" | 
|  | 7811 |  | 
|  | 7812 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 7813 | run_test  "DTLS-SRTP all profiles supported. openssl server" \ | 
|  | 7814 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 7815 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 7816 | 0 \ | 
|  | 7817 | -c "client hello, adding use_srtp extension" \ | 
|  | 7818 | -c "found use_srtp extension" \ | 
|  | 7819 | -c "found srtp profile" \ | 
|  | 7820 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ | 
|  | 7821 | -c "DTLS-SRTP key material is"\ | 
|  | 7822 | -C "error" | 
|  | 7823 |  | 
|  | 7824 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 7825 | run_test  "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ | 
|  | 7826 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 7827 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 7828 | 0 \ | 
|  | 7829 | -c "client hello, adding use_srtp extension" \ | 
|  | 7830 | -c "found use_srtp extension" \ | 
|  | 7831 | -c "found srtp profile" \ | 
|  | 7832 | -c "selected srtp profile" \ | 
|  | 7833 | -c "DTLS-SRTP key material is"\ | 
|  | 7834 | -C "error" | 
|  | 7835 |  | 
|  | 7836 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 7837 | run_test  "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ | 
|  | 7838 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 7839 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ | 
|  | 7840 | 0 \ | 
|  | 7841 | -c "client hello, adding use_srtp extension" \ | 
|  | 7842 | -c "found use_srtp extension" \ | 
|  | 7843 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
|  | 7844 | -c "selected srtp profile" \ | 
|  | 7845 | -c "DTLS-SRTP key material is"\ | 
|  | 7846 | -C "error" | 
|  | 7847 |  | 
|  | 7848 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 7849 | run_test  "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ | 
|  | 7850 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 7851 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 7852 | 0 \ | 
|  | 7853 | -c "client hello, adding use_srtp extension" \ | 
|  | 7854 | -c "found use_srtp extension" \ | 
|  | 7855 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
|  | 7856 | -c "selected srtp profile" \ | 
|  | 7857 | -c "DTLS-SRTP key material is"\ | 
|  | 7858 | -C "error" | 
|  | 7859 |  | 
|  | 7860 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 7861 | run_test  "DTLS-SRTP server and Client support only one matching profile. openssl server." \ | 
|  | 7862 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 7863 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ | 
|  | 7864 | 0 \ | 
|  | 7865 | -c "client hello, adding use_srtp extension" \ | 
|  | 7866 | -c "found use_srtp extension" \ | 
|  | 7867 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
|  | 7868 | -c "selected srtp profile" \ | 
|  | 7869 | -c "DTLS-SRTP key material is"\ | 
|  | 7870 | -C "error" | 
|  | 7871 |  | 
|  | 7872 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 7873 | run_test  "DTLS-SRTP server and Client support only one different profile. openssl server." \ | 
|  | 7874 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 7875 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ | 
|  | 7876 | 0 \ | 
|  | 7877 | -c "client hello, adding use_srtp extension" \ | 
|  | 7878 | -C "found use_srtp extension" \ | 
|  | 7879 | -C "found srtp profile" \ | 
|  | 7880 | -C "selected srtp profile" \ | 
|  | 7881 | -C "DTLS-SRTP key material is"\ | 
|  | 7882 | -C "error" | 
|  | 7883 |  | 
|  | 7884 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 7885 | run_test  "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ | 
|  | 7886 | "$O_SRV -dtls" \ | 
|  | 7887 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 7888 | 0 \ | 
|  | 7889 | -c "client hello, adding use_srtp extension" \ | 
|  | 7890 | -C "found use_srtp extension" \ | 
|  | 7891 | -C "found srtp profile" \ | 
|  | 7892 | -C "selected srtp profile" \ | 
|  | 7893 | -C "DTLS-SRTP key material is"\ | 
|  | 7894 | -C "error" | 
|  | 7895 |  | 
|  | 7896 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 7897 | run_test  "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ | 
|  | 7898 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
|  | 7899 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ | 
|  | 7900 | 0 \ | 
|  | 7901 | -c "client hello, adding use_srtp extension" \ | 
|  | 7902 | -c "found use_srtp extension" \ | 
|  | 7903 | -c "found srtp profile" \ | 
|  | 7904 | -c "selected srtp profile" \ | 
|  | 7905 | -c "DTLS-SRTP key material is"\ | 
|  | 7906 | -c "DTLS-SRTP no mki value negotiated"\ | 
|  | 7907 | -c "dumping 'sending mki' (8 bytes)" \ | 
|  | 7908 | -C "dumping 'received mki' (8 bytes)" \ | 
|  | 7909 | -C "error" | 
|  | 7910 |  | 
|  | 7911 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7912 | requires_gnutls | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7913 | run_test  "DTLS-SRTP all profiles supported. gnutls client." \ | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7914 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 7915 | "$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] | 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" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7921 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7922 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" | 
|  | 7923 |  | 
|  | 7924 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7925 | requires_gnutls | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7926 | 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] | 7927 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 7928 | "$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] | 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" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7934 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7935 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" | 
|  | 7936 |  | 
|  | 7937 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7938 | requires_gnutls | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7939 | 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] | 7940 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 7941 | "$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] | 7942 | 0 \ | 
|  | 7943 | -s "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7944 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
|  | 7945 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7946 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7947 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7948 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" | 
|  | 7949 |  | 
|  | 7950 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7951 | requires_gnutls | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7952 | 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] | 7953 | "$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] | 7954 | "$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] | 7955 | 0 \ | 
|  | 7956 | -s "found use_srtp extension" \ | 
|  | 7957 | -s "found srtp profile" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7958 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7959 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7960 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7961 | -c "SRTP profile: SRTP_NULL_SHA1_32" | 
|  | 7962 |  | 
|  | 7963 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7964 | requires_gnutls | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7965 | 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] | 7966 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ | 
|  | 7967 | "$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] | 7968 | 0 \ | 
|  | 7969 | -s "found use_srtp extension" \ | 
|  | 7970 | -s "found srtp profile" \ | 
|  | 7971 | -s "selected srtp profile" \ | 
|  | 7972 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7973 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7974 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" | 
|  | 7975 |  | 
|  | 7976 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7977 | requires_gnutls | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7978 | 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] | 7979 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ | 
|  | 7980 | "$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] | 7981 | 0 \ | 
|  | 7982 | -s "found use_srtp extension" \ | 
|  | 7983 | -s "found srtp profile" \ | 
|  | 7984 | -S "selected srtp profile" \ | 
|  | 7985 | -S "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7986 | -S "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7987 | -C "SRTP profile:" | 
|  | 7988 |  | 
|  | 7989 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7990 | requires_gnutls | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7991 | 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] | 7992 | "$P_SRV dtls=1 debug_level=3" \ | 
|  | 7993 | "$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] | 7994 | 0 \ | 
|  | 7995 | -s "found use_srtp extension" \ | 
|  | 7996 | -S "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7997 | -S "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7998 | -C "SRTP profile:" | 
|  | 7999 |  | 
|  | 8000 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8001 | requires_gnutls | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8002 | run_test  "DTLS-SRTP all profiles supported. gnutls server" \ | 
|  | 8003 | "$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" \ | 
|  | 8004 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 8005 | 0 \ | 
|  | 8006 | -c "client hello, adding use_srtp extension" \ | 
|  | 8007 | -c "found use_srtp extension" \ | 
|  | 8008 | -c "found srtp profile" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8009 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8010 | -c "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8011 | -C "error" | 
|  | 8012 |  | 
|  | 8013 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8014 | requires_gnutls | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8015 | run_test  "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ | 
|  | 8016 | "$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" \ | 
|  | 8017 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 8018 | 0 \ | 
|  | 8019 | -c "client hello, adding use_srtp extension" \ | 
|  | 8020 | -c "found use_srtp extension" \ | 
|  | 8021 | -c "found srtp profile" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8022 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8023 | -c "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8024 | -C "error" | 
|  | 8025 |  | 
|  | 8026 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8027 | requires_gnutls | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8028 | run_test  "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ | 
|  | 8029 | "$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" \ | 
|  | 8030 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ | 
|  | 8031 | 0 \ | 
|  | 8032 | -c "client hello, adding use_srtp extension" \ | 
|  | 8033 | -c "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8034 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8035 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8036 | -c "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8037 | -C "error" | 
|  | 8038 |  | 
|  | 8039 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8040 | requires_gnutls | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8041 | run_test  "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ | 
|  | 8042 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8043 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8044 | 0 \ | 
|  | 8045 | -c "client hello, adding use_srtp extension" \ | 
|  | 8046 | -c "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8047 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8048 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8049 | -c "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8050 | -C "error" | 
|  | 8051 |  | 
|  | 8052 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8053 | requires_gnutls | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8054 | run_test  "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ | 
|  | 8055 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ | 
|  | 8056 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ | 
|  | 8057 | 0 \ | 
|  | 8058 | -c "client hello, adding use_srtp extension" \ | 
|  | 8059 | -c "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8060 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8061 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8062 | -c "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8063 | -C "error" | 
|  | 8064 |  | 
|  | 8065 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8066 | requires_gnutls | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8067 | run_test  "DTLS-SRTP server and Client support only one different profile. gnutls server." \ | 
|  | 8068 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8069 | "$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] | 8070 | 0 \ | 
|  | 8071 | -c "client hello, adding use_srtp extension" \ | 
|  | 8072 | -C "found use_srtp extension" \ | 
|  | 8073 | -C "found srtp profile" \ | 
|  | 8074 | -C "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8075 | -C "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8076 | -C "error" | 
|  | 8077 |  | 
|  | 8078 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8079 | requires_gnutls | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8080 | run_test  "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ | 
|  | 8081 | "$G_SRV -u" \ | 
|  | 8082 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 8083 | 0 \ | 
|  | 8084 | -c "client hello, adding use_srtp extension" \ | 
|  | 8085 | -C "found use_srtp extension" \ | 
|  | 8086 | -C "found srtp profile" \ | 
|  | 8087 | -C "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8088 | -C "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8089 | -C "error" | 
|  | 8090 |  | 
|  | 8091 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8092 | requires_gnutls | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8093 | run_test  "DTLS-SRTP all profiles supported. mki used. gnutls server." \ | 
|  | 8094 | "$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" \ | 
|  | 8095 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ | 
|  | 8096 | 0 \ | 
|  | 8097 | -c "client hello, adding use_srtp extension" \ | 
|  | 8098 | -c "found use_srtp extension" \ | 
|  | 8099 | -c "found srtp profile" \ | 
|  | 8100 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8101 | -c "DTLS-SRTP key material is"\ | 
| Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 8102 | -c "DTLS-SRTP mki value:"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8103 | -c "dumping 'sending mki' (8 bytes)" \ | 
|  | 8104 | -c "dumping 'received mki' (8 bytes)" \ | 
|  | 8105 | -C "error" | 
|  | 8106 |  | 
| Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 8107 | # Tests for specific things with "unreliable" UDP connection | 
|  | 8108 |  | 
|  | 8109 | not_with_valgrind # spurious resend due to timeout | 
|  | 8110 | run_test    "DTLS proxy: reference" \ | 
|  | 8111 | -p "$P_PXY" \ | 
| Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8112 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ | 
|  | 8113 | "$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] | 8114 | 0 \ | 
|  | 8115 | -C "replayed record" \ | 
|  | 8116 | -S "replayed record" \ | 
| Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 8117 | -C "Buffer record from epoch" \ | 
|  | 8118 | -S "Buffer record from epoch" \ | 
|  | 8119 | -C "ssl_buffer_message" \ | 
|  | 8120 | -S "ssl_buffer_message" \ | 
| Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8121 | -C "discarding invalid record" \ | 
| Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8122 | -S "discarding invalid record" \ | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8123 | -S "resend" \ | 
| Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8124 | -s "Extra-header:" \ | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8125 | -c "HTTP/1.0 200 OK" | 
|  | 8126 |  | 
|  | 8127 | not_with_valgrind # spurious resend due to timeout | 
| Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8128 | run_test    "DTLS proxy: duplicate every packet" \ | 
|  | 8129 | -p "$P_PXY duplicate=1" \ | 
| Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8130 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ | 
|  | 8131 | "$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] | 8132 | 0 \ | 
|  | 8133 | -c "replayed record" \ | 
|  | 8134 | -s "replayed record" \ | 
|  | 8135 | -c "record from another epoch" \ | 
|  | 8136 | -s "record from another epoch" \ | 
|  | 8137 | -S "resend" \ | 
|  | 8138 | -s "Extra-header:" \ | 
|  | 8139 | -c "HTTP/1.0 200 OK" | 
|  | 8140 |  | 
|  | 8141 | run_test    "DTLS proxy: duplicate every packet, server anti-replay off" \ | 
|  | 8142 | -p "$P_PXY duplicate=1" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8143 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ | 
|  | 8144 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8145 | 0 \ | 
|  | 8146 | -c "replayed record" \ | 
|  | 8147 | -S "replayed record" \ | 
|  | 8148 | -c "record from another epoch" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8149 | -s "record from another epoch" \ | 
|  | 8150 | -c "resend" \ | 
|  | 8151 | -s "resend" \ | 
| Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8152 | -s "Extra-header:" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8153 | -c "HTTP/1.0 200 OK" | 
|  | 8154 |  | 
|  | 8155 | run_test    "DTLS proxy: multiple records in same datagram" \ | 
|  | 8156 | -p "$P_PXY pack=50" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8157 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ | 
|  | 8158 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8159 | 0 \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8160 | -c "next record in same datagram" \ | 
|  | 8161 | -s "next record in same datagram" | 
|  | 8162 |  | 
|  | 8163 | run_test    "DTLS proxy: multiple records in same datagram, duplicate every packet" \ | 
|  | 8164 | -p "$P_PXY pack=50 duplicate=1" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8165 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ | 
|  | 8166 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8167 | 0 \ | 
|  | 8168 | -c "next record in same datagram" \ | 
|  | 8169 | -s "next record in same datagram" | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8170 |  | 
| Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8171 | run_test    "DTLS proxy: inject invalid AD record, default badmac_limit" \ | 
|  | 8172 | -p "$P_PXY bad_ad=1" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8173 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ | 
|  | 8174 | "$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] | 8175 | 0 \ | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8176 | -c "discarding invalid record (mac)" \ | 
|  | 8177 | -s "discarding invalid record (mac)" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8178 | -s "Extra-header:" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8179 | -c "HTTP/1.0 200 OK" \ | 
|  | 8180 | -S "too many records with bad MAC" \ | 
|  | 8181 | -S "Verification of the message MAC failed" | 
|  | 8182 |  | 
|  | 8183 | run_test    "DTLS proxy: inject invalid AD record, badmac_limit 1" \ | 
|  | 8184 | -p "$P_PXY bad_ad=1" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8185 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ | 
|  | 8186 | "$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] | 8187 | 1 \ | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8188 | -C "discarding invalid record (mac)" \ | 
|  | 8189 | -S "discarding invalid record (mac)" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8190 | -S "Extra-header:" \ | 
|  | 8191 | -C "HTTP/1.0 200 OK" \ | 
|  | 8192 | -s "too many records with bad MAC" \ | 
|  | 8193 | -s "Verification of the message MAC failed" | 
|  | 8194 |  | 
|  | 8195 | run_test    "DTLS proxy: inject invalid AD record, badmac_limit 2" \ | 
|  | 8196 | -p "$P_PXY bad_ad=1" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8197 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ | 
|  | 8198 | "$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] | 8199 | 0 \ | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8200 | -c "discarding invalid record (mac)" \ | 
|  | 8201 | -s "discarding invalid record (mac)" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8202 | -s "Extra-header:" \ | 
|  | 8203 | -c "HTTP/1.0 200 OK" \ | 
|  | 8204 | -S "too many records with bad MAC" \ | 
|  | 8205 | -S "Verification of the message MAC failed" | 
|  | 8206 |  | 
|  | 8207 | run_test    "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ | 
|  | 8208 | -p "$P_PXY bad_ad=1" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8209 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ | 
|  | 8210 | "$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] | 8211 | 1 \ | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8212 | -c "discarding invalid record (mac)" \ | 
|  | 8213 | -s "discarding invalid record (mac)" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8214 | -s "Extra-header:" \ | 
|  | 8215 | -c "HTTP/1.0 200 OK" \ | 
|  | 8216 | -s "too many records with bad MAC" \ | 
|  | 8217 | -s "Verification of the message MAC failed" | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8218 |  | 
|  | 8219 | run_test    "DTLS proxy: delay ChangeCipherSpec" \ | 
|  | 8220 | -p "$P_PXY delay_ccs=1" \ | 
| Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 8221 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ | 
|  | 8222 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8223 | 0 \ | 
|  | 8224 | -c "record from another epoch" \ | 
|  | 8225 | -s "record from another epoch" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8226 | -s "Extra-header:" \ | 
|  | 8227 | -c "HTTP/1.0 200 OK" | 
|  | 8228 |  | 
| Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8229 | # Tests for reordering support with DTLS | 
|  | 8230 |  | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8231 | run_test    "DTLS reordering: Buffer out-of-order handshake message on client" \ | 
|  | 8232 | -p "$P_PXY delay_srv=ServerHello" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8233 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ | 
|  | 8234 | hs_timeout=2500-60000" \ | 
|  | 8235 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 8236 | hs_timeout=2500-60000" \ | 
| Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8237 | 0 \ | 
|  | 8238 | -c "Buffering HS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8239 | -c "Next handshake message has been buffered - load"\ | 
|  | 8240 | -S "Buffering HS message" \ | 
|  | 8241 | -S "Next handshake message has been buffered - load"\ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8242 | -C "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8243 | -C "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8244 | -S "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8245 | -S "Remember CCS message" | 
| Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8246 |  | 
| Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8247 | run_test    "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ | 
|  | 8248 | -p "$P_PXY delay_srv=ServerHello" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8249 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ | 
|  | 8250 | hs_timeout=2500-60000" \ | 
|  | 8251 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 8252 | hs_timeout=2500-60000" \ | 
| Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8253 | 0 \ | 
|  | 8254 | -c "Buffering HS message" \ | 
|  | 8255 | -c "found fragmented DTLS handshake message"\ | 
|  | 8256 | -c "Next handshake message 1 not or only partially bufffered" \ | 
|  | 8257 | -c "Next handshake message has been buffered - load"\ | 
|  | 8258 | -S "Buffering HS message" \ | 
|  | 8259 | -S "Next handshake message has been buffered - load"\ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8260 | -C "Injecting buffered CCS message" \ | 
| Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8261 | -C "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8262 | -S "Injecting buffered CCS message" \ | 
| Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8263 | -S "Remember CCS message" | 
|  | 8264 |  | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8265 | # The client buffers the ServerKeyExchange before receiving the fragmented | 
|  | 8266 | # Certificate message; at the time of writing, together these are aroudn 1200b | 
|  | 8267 | # in size, so that the bound below ensures that the certificate can be reassembled | 
|  | 8268 | # while keeping the ServerKeyExchange. | 
|  | 8269 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 | 
|  | 8270 | 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] | 8271 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8272 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ | 
|  | 8273 | hs_timeout=2500-60000" \ | 
|  | 8274 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 8275 | hs_timeout=2500-60000" \ | 
| Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8276 | 0 \ | 
|  | 8277 | -c "Buffering HS message" \ | 
|  | 8278 | -c "Next handshake message has been buffered - load"\ | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8279 | -C "attempt to make space by freeing buffered messages" \ | 
|  | 8280 | -S "Buffering HS message" \ | 
|  | 8281 | -S "Next handshake message has been buffered - load"\ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8282 | -C "Injecting buffered CCS message" \ | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8283 | -C "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8284 | -S "Injecting buffered CCS message" \ | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8285 | -S "Remember CCS message" | 
|  | 8286 |  | 
|  | 8287 | # The size constraints ensure that the delayed certificate message can't | 
|  | 8288 | # be reassembled while keeping the ServerKeyExchange message, but it can | 
|  | 8289 | # when dropping it first. | 
|  | 8290 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 | 
|  | 8291 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 | 
|  | 8292 | run_test    "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ | 
|  | 8293 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8294 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ | 
|  | 8295 | hs_timeout=2500-60000" \ | 
|  | 8296 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 8297 | hs_timeout=2500-60000" \ | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8298 | 0 \ | 
|  | 8299 | -c "Buffering HS message" \ | 
|  | 8300 | -c "attempt to make space by freeing buffered future messages" \ | 
|  | 8301 | -c "Enough space available after freeing buffered HS messages" \ | 
| Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8302 | -S "Buffering HS message" \ | 
|  | 8303 | -S "Next handshake message has been buffered - load"\ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8304 | -C "Injecting buffered CCS message" \ | 
| Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8305 | -C "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8306 | -S "Injecting buffered CCS message" \ | 
| Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8307 | -S "Remember CCS message" | 
|  | 8308 |  | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8309 | run_test    "DTLS reordering: Buffer out-of-order handshake message on server" \ | 
|  | 8310 | -p "$P_PXY delay_cli=Certificate" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8311 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ | 
|  | 8312 | hs_timeout=2500-60000" \ | 
|  | 8313 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 8314 | hs_timeout=2500-60000" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8315 | 0 \ | 
|  | 8316 | -C "Buffering HS message" \ | 
|  | 8317 | -C "Next handshake message has been buffered - load"\ | 
|  | 8318 | -s "Buffering HS message" \ | 
|  | 8319 | -s "Next handshake message has been buffered - load" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8320 | -C "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8321 | -C "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8322 | -S "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8323 | -S "Remember CCS message" | 
|  | 8324 |  | 
|  | 8325 | run_test    "DTLS reordering: Buffer out-of-order CCS message on client"\ | 
|  | 8326 | -p "$P_PXY delay_srv=NewSessionTicket" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8327 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ | 
|  | 8328 | hs_timeout=2500-60000" \ | 
|  | 8329 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 8330 | hs_timeout=2500-60000" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8331 | 0 \ | 
|  | 8332 | -C "Buffering HS message" \ | 
|  | 8333 | -C "Next handshake message has been buffered - load"\ | 
|  | 8334 | -S "Buffering HS message" \ | 
|  | 8335 | -S "Next handshake message has been buffered - load" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8336 | -c "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8337 | -c "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8338 | -S "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8339 | -S "Remember CCS message" | 
|  | 8340 |  | 
|  | 8341 | run_test    "DTLS reordering: Buffer out-of-order CCS message on server"\ | 
|  | 8342 | -p "$P_PXY delay_cli=ClientKeyExchange" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8343 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ | 
|  | 8344 | hs_timeout=2500-60000" \ | 
|  | 8345 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 8346 | hs_timeout=2500-60000" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8347 | 0 \ | 
|  | 8348 | -C "Buffering HS message" \ | 
|  | 8349 | -C "Next handshake message has been buffered - load"\ | 
|  | 8350 | -S "Buffering HS message" \ | 
|  | 8351 | -S "Next handshake message has been buffered - load" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8352 | -C "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8353 | -C "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8354 | -s "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8355 | -s "Remember CCS message" | 
|  | 8356 |  | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8357 | run_test    "DTLS reordering: Buffer encrypted Finished message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8358 | -p "$P_PXY delay_ccs=1" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8359 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ | 
|  | 8360 | hs_timeout=2500-60000" \ | 
|  | 8361 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 8362 | hs_timeout=2500-60000" \ | 
| Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 8363 | 0 \ | 
|  | 8364 | -s "Buffer record from epoch 1" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8365 | -s "Found buffered record from current epoch - load" \ | 
|  | 8366 | -c "Buffer record from epoch 1" \ | 
|  | 8367 | -c "Found buffered record from current epoch - load" | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8368 |  | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8369 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec | 
|  | 8370 | # from the server are delayed, so that the encrypted Finished message | 
|  | 8371 | # is received and buffered. When the fragmented NewSessionTicket comes | 
|  | 8372 | # in afterwards, the encrypted Finished message must be freed in order | 
|  | 8373 | # to make space for the NewSessionTicket to be reassembled. | 
|  | 8374 | # This works only in very particular circumstances: | 
|  | 8375 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering | 
|  | 8376 | #   of the NewSessionTicket, but small enough to also allow buffering of | 
|  | 8377 | #   the encrypted Finished message. | 
|  | 8378 | # - The MTU setting on the server must be so small that the NewSessionTicket | 
|  | 8379 | #   needs to be fragmented. | 
|  | 8380 | # - All messages sent by the server must be small enough to be either sent | 
|  | 8381 | #   without fragmentation or be reassembled within the bounds of | 
|  | 8382 | #   MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based | 
|  | 8383 | #   handshake, omitting CRTs. | 
| Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 8384 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 | 
|  | 8385 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8386 | run_test    "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ | 
|  | 8387 | -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] | 8388 | "$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] | 8389 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ | 
|  | 8390 | 0 \ | 
|  | 8391 | -s "Buffer record from epoch 1" \ | 
|  | 8392 | -s "Found buffered record from current epoch - load" \ | 
|  | 8393 | -c "Buffer record from epoch 1" \ | 
|  | 8394 | -C "Found buffered record from current epoch - load" \ | 
|  | 8395 | -c "Enough space available after freeing future epoch record" | 
|  | 8396 |  | 
| Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 8397 | # Tests for "randomly unreliable connection": try a variety of flows and peers | 
|  | 8398 |  | 
|  | 8399 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8400 | run_test    "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ | 
|  | 8401 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8402 | "$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] | 8403 | psk=abc123" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8404 | "$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] | 8405 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 8406 | 0 \ | 
|  | 8407 | -s "Extra-header:" \ | 
|  | 8408 | -c "HTTP/1.0 200 OK" | 
|  | 8409 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8410 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8411 | run_test    "DTLS proxy: 3d, \"short\" RSA handshake" \ | 
|  | 8412 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8413 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ | 
|  | 8414 | "$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] | 8415 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 8416 | 0 \ | 
|  | 8417 | -s "Extra-header:" \ | 
|  | 8418 | -c "HTTP/1.0 200 OK" | 
|  | 8419 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8420 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8421 | run_test    "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ | 
|  | 8422 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8423 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ | 
|  | 8424 | "$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] | 8425 | 0 \ | 
|  | 8426 | -s "Extra-header:" \ | 
|  | 8427 | -c "HTTP/1.0 200 OK" | 
|  | 8428 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8429 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8430 | run_test    "DTLS proxy: 3d, FS, client auth" \ | 
|  | 8431 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8432 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ | 
|  | 8433 | "$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] | 8434 | 0 \ | 
|  | 8435 | -s "Extra-header:" \ | 
|  | 8436 | -c "HTTP/1.0 200 OK" | 
|  | 8437 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8438 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8439 | run_test    "DTLS proxy: 3d, FS, ticket" \ | 
|  | 8440 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8441 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ | 
|  | 8442 | "$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] | 8443 | 0 \ | 
|  | 8444 | -s "Extra-header:" \ | 
|  | 8445 | -c "HTTP/1.0 200 OK" | 
|  | 8446 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8447 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8448 | run_test    "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ | 
|  | 8449 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8450 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ | 
|  | 8451 | "$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] | 8452 | 0 \ | 
|  | 8453 | -s "Extra-header:" \ | 
|  | 8454 | -c "HTTP/1.0 200 OK" | 
|  | 8455 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8456 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8457 | run_test    "DTLS proxy: 3d, max handshake, nbio" \ | 
|  | 8458 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8459 | "$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] | 8460 | auth_mode=required" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8461 | "$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] | 8462 | 0 \ | 
|  | 8463 | -s "Extra-header:" \ | 
|  | 8464 | -c "HTTP/1.0 200 OK" | 
|  | 8465 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8466 | client_needs_more_time 4 | 
| Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 8467 | run_test    "DTLS proxy: 3d, min handshake, resumption" \ | 
|  | 8468 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8469 | "$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] | 8470 | psk=abc123 debug_level=3" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8471 | "$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] | 8472 | 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] | 8473 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 8474 | 0 \ | 
|  | 8475 | -s "a session has been resumed" \ | 
|  | 8476 | -c "a session has been resumed" \ | 
|  | 8477 | -s "Extra-header:" \ | 
|  | 8478 | -c "HTTP/1.0 200 OK" | 
|  | 8479 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8480 | client_needs_more_time 4 | 
| Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 8481 | run_test    "DTLS proxy: 3d, min handshake, resumption, nbio" \ | 
|  | 8482 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8483 | "$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] | 8484 | psk=abc123 debug_level=3 nbio=2" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8485 | "$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] | 8486 | 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] | 8487 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ | 
|  | 8488 | 0 \ | 
|  | 8489 | -s "a session has been resumed" \ | 
|  | 8490 | -c "a session has been resumed" \ | 
|  | 8491 | -s "Extra-header:" \ | 
|  | 8492 | -c "HTTP/1.0 200 OK" | 
|  | 8493 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8494 | client_needs_more_time 4 | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8495 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8496 | run_test    "DTLS proxy: 3d, min handshake, client-initiated renego" \ | 
| Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8497 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8498 | "$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] | 8499 | psk=abc123 renegotiation=1 debug_level=2" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8500 | "$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] | 8501 | renegotiate=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8502 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 8503 | 0 \ | 
|  | 8504 | -c "=> renegotiate" \ | 
|  | 8505 | -s "=> renegotiate" \ | 
|  | 8506 | -s "Extra-header:" \ | 
|  | 8507 | -c "HTTP/1.0 200 OK" | 
|  | 8508 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8509 | client_needs_more_time 4 | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8510 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8511 | run_test    "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ | 
|  | 8512 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8513 | "$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] | 8514 | psk=abc123 renegotiation=1 debug_level=2" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8515 | "$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] | 8516 | renegotiate=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8517 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 8518 | 0 \ | 
|  | 8519 | -c "=> renegotiate" \ | 
|  | 8520 | -s "=> renegotiate" \ | 
|  | 8521 | -s "Extra-header:" \ | 
|  | 8522 | -c "HTTP/1.0 200 OK" | 
|  | 8523 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8524 | client_needs_more_time 4 | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8525 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8526 | run_test    "DTLS proxy: 3d, min handshake, server-initiated renego" \ | 
| Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 8527 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8528 | "$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] | 8529 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8530 | debug_level=2" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8531 | "$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] | 8532 | renegotiation=1 exchanges=4 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8533 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 8534 | 0 \ | 
|  | 8535 | -c "=> renegotiate" \ | 
|  | 8536 | -s "=> renegotiate" \ | 
|  | 8537 | -s "Extra-header:" \ | 
|  | 8538 | -c "HTTP/1.0 200 OK" | 
|  | 8539 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8540 | client_needs_more_time 4 | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8541 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8542 | 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] | 8543 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8544 | "$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] | 8545 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8546 | debug_level=2 nbio=2" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8547 | "$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] | 8548 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8549 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 8550 | 0 \ | 
|  | 8551 | -c "=> renegotiate" \ | 
|  | 8552 | -s "=> renegotiate" \ | 
|  | 8553 | -s "Extra-header:" \ | 
|  | 8554 | -c "HTTP/1.0 200 OK" | 
|  | 8555 |  | 
| Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8556 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including | 
|  | 8557 | ## all versions installed on the CI machines), reported here: | 
|  | 8558 | ## Bug report: https://github.com/openssl/openssl/issues/6902 | 
|  | 8559 | ## They should be re-enabled once a fixed version of OpenSSL is available | 
|  | 8560 | ## (this should happen in some 1.1.1_ release according to the ticket). | 
|  | 8561 | skip_next_test | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8562 | client_needs_more_time 6 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8563 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8564 | run_test    "DTLS proxy: 3d, openssl server" \ | 
| Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8565 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ | 
|  | 8566 | "$O_SRV -dtls1 -mtu 2048" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8567 | "$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] | 8568 | 0 \ | 
| Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8569 | -c "HTTP/1.0 200 OK" | 
|  | 8570 |  | 
| Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8571 | skip_next_test # see above | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8572 | client_needs_more_time 8 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8573 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8574 | run_test    "DTLS proxy: 3d, openssl server, fragmentation" \ | 
|  | 8575 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ | 
|  | 8576 | "$O_SRV -dtls1 -mtu 768" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8577 | "$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] | 8578 | 0 \ | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8579 | -c "HTTP/1.0 200 OK" | 
|  | 8580 |  | 
| Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8581 | skip_next_test # see above | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8582 | client_needs_more_time 8 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8583 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8584 | run_test    "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ | 
|  | 8585 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ | 
|  | 8586 | "$O_SRV -dtls1 -mtu 768" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8587 | "$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] | 8588 | 0 \ | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8589 | -c "HTTP/1.0 200 OK" | 
|  | 8590 |  | 
| Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 8591 | requires_gnutls | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8592 | client_needs_more_time 6 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8593 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8594 | run_test    "DTLS proxy: 3d, gnutls server" \ | 
|  | 8595 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
|  | 8596 | "$G_SRV -u --mtu 2048 -a" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8597 | "$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] | 8598 | 0 \ | 
|  | 8599 | -s "Extra-header:" \ | 
|  | 8600 | -c "Extra-header:" | 
|  | 8601 |  | 
| k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8602 | requires_gnutls_next | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8603 | client_needs_more_time 8 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8604 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8605 | run_test    "DTLS proxy: 3d, gnutls server, fragmentation" \ | 
|  | 8606 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8607 | "$G_NEXT_SRV -u --mtu 512" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8608 | "$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] | 8609 | 0 \ | 
|  | 8610 | -s "Extra-header:" \ | 
|  | 8611 | -c "Extra-header:" | 
|  | 8612 |  | 
| k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8613 | requires_gnutls_next | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8614 | client_needs_more_time 8 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8615 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8616 | run_test    "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ | 
|  | 8617 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8618 | "$G_NEXT_SRV -u --mtu 512" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8619 | "$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] | 8620 | 0 \ | 
|  | 8621 | -s "Extra-header:" \ | 
|  | 8622 | -c "Extra-header:" | 
|  | 8623 |  | 
| Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8624 | requires_config_enabled MBEDTLS_SSL_EXPORT_KEYS | 
|  | 8625 | run_test    "export keys functionality" \ | 
|  | 8626 | "$P_SRV eap_tls=1 debug_level=3" \ | 
|  | 8627 | "$P_CLI eap_tls=1 debug_level=3" \ | 
|  | 8628 | 0 \ | 
| Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 8629 | -c "EAP-TLS key material is:"\ | 
|  | 8630 | -s "EAP-TLS key material is:"\ | 
|  | 8631 | -c "EAP-TLS IV is:" \ | 
|  | 8632 | -s "EAP-TLS IV is:" | 
| Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8633 |  | 
| Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 8634 | # openssl feature tests: check if tls1.3 exists. | 
|  | 8635 | requires_openssl_tls1_3 | 
|  | 8636 | run_test    "TLS1.3: Test openssl tls1_3 feature" \ | 
|  | 8637 | "$O_NEXT_SRV -tls1_3 -msg" \ | 
|  | 8638 | "$O_NEXT_CLI -tls1_3 -msg" \ | 
|  | 8639 | 0 \ | 
|  | 8640 | -c "TLS 1.3" \ | 
|  | 8641 | -s "TLS 1.3" | 
|  | 8642 |  | 
| Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 8643 | # 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] | 8644 | requires_gnutls_tls1_3 | 
| Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 8645 | requires_gnutls_next_no_ticket | 
|  | 8646 | requires_gnutls_next_disable_tls13_compat | 
| Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 8647 | run_test    "TLS1.3: Test gnutls tls1_3 feature" \ | 
| Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 8648 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \ | 
|  | 8649 | "$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] | 8650 | 0 \ | 
|  | 8651 | -s "Version: TLS1.3" \ | 
|  | 8652 | -c "Version: TLS1.3" | 
|  | 8653 |  | 
| Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 8654 | # TLS1.3 test cases | 
|  | 8655 | # TODO: remove or rewrite this test case if #4832 is resolved. | 
|  | 8656 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
|  | 8657 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL | 
|  | 8658 | skip_handshake_stage_check | 
|  | 8659 | run_test    "TLS1.3: Not supported version check: tls1_2 and tls1_3" \ | 
|  | 8660 | "$P_SRV debug_level=1 min_version=tls1_2 max_version=tls1_3" \ | 
|  | 8661 | "$P_CLI debug_level=1 min_version=tls1_2 max_version=tls1_3" \ | 
|  | 8662 | 1 \ | 
|  | 8663 | -s "SSL - The requested feature is not available" \ | 
|  | 8664 | -c "SSL - The requested feature is not available" \ | 
|  | 8665 | -s "Hybrid TLS 1.2 + TLS 1.3 configurations are not yet supported" \ | 
|  | 8666 | -c "Hybrid TLS 1.2 + TLS 1.3 configurations are not yet supported" | 
|  | 8667 |  | 
| Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 8668 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
|  | 8669 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL | 
|  | 8670 | run_test    "TLS1.3: handshake dispatch test: tls1_3 only" \ | 
| Jerry Yu | 3523a3b | 2021-09-14 16:29:49 +0800 | [diff] [blame] | 8671 | "$P_SRV debug_level=2 min_version=tls1_3 max_version=tls1_3" \ | 
|  | 8672 | "$P_CLI debug_level=2 min_version=tls1_3 max_version=tls1_3" \ | 
| Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 8673 | 1 \ | 
| Jerry Yu | 6e81b27 | 2021-09-27 11:16:17 +0800 | [diff] [blame] | 8674 | -s "tls1_3 server state: 0"     \ | 
|  | 8675 | -c "tls1_3 client state: 0" | 
| Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 8676 |  | 
| Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 8677 | requires_openssl_tls1_3 | 
|  | 8678 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL | 
| Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 8679 | run_test    "TLS1.3: Test client hello msg work - openssl" \ | 
| Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 8680 | "$O_NEXT_SRV -tls1_3 -msg" \ | 
| Jerry Yu | 6e81b27 | 2021-09-27 11:16:17 +0800 | [diff] [blame] | 8681 | "$P_CLI debug_level=2 min_version=tls1_3 max_version=tls1_3" \ | 
| Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 8682 | 1 \ | 
|  | 8683 | -c "SSL - The requested feature is not available" \ | 
| Jerry Yu | 6e81b27 | 2021-09-27 11:16:17 +0800 | [diff] [blame] | 8684 | -s "ServerHello"                \ | 
|  | 8685 | -c "tls1_3 client state: 0"     \ | 
|  | 8686 | -c "tls1_3 client state: 2"     \ | 
|  | 8687 | -c "tls1_3 client state: 19"    \ | 
|  | 8688 | -c "tls1_3 client state: 5"     \ | 
|  | 8689 | -c "tls1_3 client state: 3"     \ | 
|  | 8690 | -c "tls1_3 client state: 9"     \ | 
|  | 8691 | -c "tls1_3 client state: 13"    \ | 
|  | 8692 | -c "tls1_3 client state: 7"     \ | 
|  | 8693 | -c "tls1_3 client state: 20"    \ | 
|  | 8694 | -c "tls1_3 client state: 11"    \ | 
|  | 8695 | -c "tls1_3 client state: 14"    \ | 
|  | 8696 | -c "tls1_3 client state: 15" | 
| Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 8697 |  | 
| Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 8698 | requires_gnutls_tls1_3 | 
|  | 8699 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL | 
|  | 8700 | run_test    "TLS1.3: Test client hello msg work - gnutls" \ | 
|  | 8701 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 --debug=4" \ | 
| Jerry Yu | 6e81b27 | 2021-09-27 11:16:17 +0800 | [diff] [blame] | 8702 | "$P_CLI debug_level=2 min_version=tls1_3 max_version=tls1_3" \ | 
| Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 8703 | 1 \ | 
|  | 8704 | -c "SSL - The requested feature is not available" \ | 
| Jerry Yu | 6e81b27 | 2021-09-27 11:16:17 +0800 | [diff] [blame] | 8705 | -s "SERVER HELLO was queued"    \ | 
|  | 8706 | -c "tls1_3 client state: 0"     \ | 
|  | 8707 | -c "tls1_3 client state: 2"     \ | 
|  | 8708 | -c "tls1_3 client state: 19"    \ | 
|  | 8709 | -c "tls1_3 client state: 5"     \ | 
|  | 8710 | -c "tls1_3 client state: 3"     \ | 
|  | 8711 | -c "tls1_3 client state: 9"     \ | 
|  | 8712 | -c "tls1_3 client state: 13"    \ | 
|  | 8713 | -c "tls1_3 client state: 7"     \ | 
|  | 8714 | -c "tls1_3 client state: 20"    \ | 
|  | 8715 | -c "tls1_3 client state: 11"    \ | 
|  | 8716 | -c "tls1_3 client state: 14"    \ | 
|  | 8717 | -c "tls1_3 client state: 15" | 
| Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 8718 |  | 
| Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 8719 | # Test heap memory usage after handshake | 
|  | 8720 | requires_config_enabled MBEDTLS_MEMORY_DEBUG | 
|  | 8721 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C | 
|  | 8722 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8723 | requires_max_content_len 16384 | 
| Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 8724 | run_tests_memory_after_hanshake | 
|  | 8725 |  | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 8726 | # Final report | 
|  | 8727 |  | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8728 | echo "------------------------------------------------------------------------" | 
|  | 8729 |  | 
|  | 8730 | if [ $FAILS = 0 ]; then | 
| Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8731 | printf "PASSED" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8732 | else | 
| Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8733 | printf "FAILED" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8734 | fi | 
| Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 8735 | PASSES=$(( $TESTS - $FAILS )) | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 8736 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8737 |  | 
|  | 8738 | exit $FAILS |