Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 3 | # ssl-opt.sh |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 4 | # |
Bence Szépkúti | 1e14827 | 2020-08-07 13:07:28 +0200 | [diff] [blame] | 5 | # Copyright The Mbed TLS Contributors |
Bence Szépkúti | c7da1fe | 2020-05-26 01:54:15 +0200 | [diff] [blame] | 6 | # SPDX-License-Identifier: Apache-2.0 |
| 7 | # |
| 8 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 9 | # not use this file except in compliance with the License. |
| 10 | # You may obtain a copy of the License at |
| 11 | # |
| 12 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 13 | # |
| 14 | # Unless required by applicable law or agreed to in writing, software |
| 15 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 16 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 17 | # See the License for the specific language governing permissions and |
| 18 | # limitations under the License. |
| 19 | # |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 20 | # Purpose |
| 21 | # |
| 22 | # Executes tests to prove various TLS/SSL options and extensions. |
| 23 | # |
| 24 | # The goal is not to cover every ciphersuite/version, but instead to cover |
| 25 | # specific options (max fragment length, truncated hmac, etc) or procedures |
| 26 | # (session resumption from cache or ticket, renego, etc). |
| 27 | # |
| 28 | # The tests assume a build with default options, with exceptions expressed |
| 29 | # with a dependency. The tests focus on functionality and do not consider |
| 30 | # performance. |
| 31 | # |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 32 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 33 | set -u |
| 34 | |
Jaeden Amero | 6e70eb2 | 2019-07-03 13:51:04 +0100 | [diff] [blame] | 35 | # Limit the size of each log to 10 GiB, in case of failures with this script |
| 36 | # where it may output seemingly unlimited length error logs. |
| 37 | ulimit -f 20971520 |
| 38 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 39 | ORIGINAL_PWD=$PWD |
| 40 | if ! cd "$(dirname "$0")"; then |
| 41 | exit 125 |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 42 | fi |
| 43 | |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 44 | # default values, can be overridden by the environment |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 45 | : ${P_SRV:=../programs/ssl/ssl_server2} |
| 46 | : ${P_CLI:=../programs/ssl/ssl_client2} |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 47 | : ${P_PXY:=../programs/test/udp_proxy} |
Jerry Yu | d04fd35 | 2021-12-06 16:52:57 +0800 | [diff] [blame] | 48 | : ${P_QUERY:=../programs/test/query_compile_time_config} |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 49 | : ${OPENSSL_CMD:=openssl} # OPENSSL would conflict with the build system |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 50 | : ${GNUTLS_CLI:=gnutls-cli} |
| 51 | : ${GNUTLS_SERV:=gnutls-serv} |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 52 | : ${PERL:=perl} |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 53 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 54 | guess_config_name() { |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 55 | if git diff --quiet ../include/mbedtls/mbedtls_config.h 2>/dev/null; then |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 56 | echo "default" |
| 57 | else |
| 58 | echo "unknown" |
| 59 | fi |
| 60 | } |
| 61 | : ${MBEDTLS_TEST_OUTCOME_FILE=} |
| 62 | : ${MBEDTLS_TEST_CONFIGURATION:="$(guess_config_name)"} |
| 63 | : ${MBEDTLS_TEST_PLATFORM:="$(uname -s | tr -c \\n0-9A-Za-z _)-$(uname -m | tr -c \\n0-9A-Za-z _)"} |
| 64 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 65 | O_SRV="$OPENSSL_CMD s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 66 | O_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_CMD s_client" |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 67 | G_SRV="$GNUTLS_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 68 | G_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_CLI --x509cafile data_files/test-ca_cat12.crt" |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 69 | TCP_CLIENT="$PERL scripts/tcp_client.pl" |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 70 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 71 | # alternative versions of OpenSSL and GnuTLS (no default path) |
| 72 | |
| 73 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 74 | O_LEGACY_SRV="$OPENSSL_LEGACY s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
| 75 | O_LEGACY_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_LEGACY s_client" |
| 76 | else |
| 77 | O_LEGACY_SRV=false |
| 78 | O_LEGACY_CLI=false |
| 79 | fi |
| 80 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 81 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
XiaokangQian | 30f5560 | 2021-11-24 01:54:50 +0000 | [diff] [blame] | 82 | O_NEXT_SRV="$OPENSSL_NEXT s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 83 | O_NEXT_SRV_NO_CERT="$OPENSSL_NEXT s_server -www " |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 84 | O_NEXT_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_NEXT s_client" |
| 85 | else |
| 86 | O_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 87 | O_NEXT_SRV_NO_CERT=false |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 88 | O_NEXT_CLI=false |
| 89 | fi |
| 90 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 91 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 92 | G_NEXT_SRV="$GNUTLS_NEXT_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 93 | G_NEXT_SRV_NO_CERT="$GNUTLS_NEXT_SERV" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 94 | else |
| 95 | G_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 96 | G_NEXT_SRV_NO_CERT=false |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 97 | fi |
| 98 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 99 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 100 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile data_files/test-ca_cat12.crt" |
| 101 | else |
| 102 | G_NEXT_CLI=false |
| 103 | fi |
| 104 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 105 | TESTS=0 |
| 106 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 107 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 108 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 109 | CONFIG_H='../include/mbedtls/mbedtls_config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 110 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 111 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 112 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 113 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 114 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 115 | SHOW_TEST_NUMBER=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 116 | RUN_TEST_NUMBER='' |
| 117 | |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 118 | PRESERVE_LOGS=0 |
| 119 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 120 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 121 | # port which is this plus 10000. Each port number may be independently |
| 122 | # overridden by a command line option. |
| 123 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 124 | PXY_PORT=$((SRV_PORT + 10000)) |
| 125 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 126 | print_usage() { |
| 127 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 128 | printf " -h|--help\tPrint this help.\n" |
| 129 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 130 | printf " -f|--filter\tOnly matching tests are executed (substring or BRE)\n" |
| 131 | printf " -e|--exclude\tMatching tests are excluded (substring or BRE)\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 132 | printf " -n|--number\tExecute only numbered test (comma-separated, e.g. '245,256')\n" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 133 | printf " -s|--show-numbers\tShow test numbers in front of test names\n" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 134 | printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 135 | printf " --outcome-file\tFile where test outcomes are written\n" |
| 136 | printf " \t(default: \$MBEDTLS_TEST_OUTCOME_FILE, none if empty)\n" |
| 137 | printf " --port \tTCP/UDP port (default: randomish 1xxxx)\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 138 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 139 | printf " --seed \tInteger seed value to use for this test run\n" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 140 | } |
| 141 | |
| 142 | get_options() { |
| 143 | while [ $# -gt 0 ]; do |
| 144 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 145 | -f|--filter) |
| 146 | shift; FILTER=$1 |
| 147 | ;; |
| 148 | -e|--exclude) |
| 149 | shift; EXCLUDE=$1 |
| 150 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 151 | -m|--memcheck) |
| 152 | MEMCHECK=1 |
| 153 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 154 | -n|--number) |
| 155 | shift; RUN_TEST_NUMBER=$1 |
| 156 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 157 | -s|--show-numbers) |
| 158 | SHOW_TEST_NUMBER=1 |
| 159 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 160 | -p|--preserve-logs) |
| 161 | PRESERVE_LOGS=1 |
| 162 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 163 | --port) |
| 164 | shift; SRV_PORT=$1 |
| 165 | ;; |
| 166 | --proxy-port) |
| 167 | shift; PXY_PORT=$1 |
| 168 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 169 | --seed) |
| 170 | shift; SEED="$1" |
| 171 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 172 | -h|--help) |
| 173 | print_usage |
| 174 | exit 0 |
| 175 | ;; |
| 176 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 177 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 178 | print_usage |
| 179 | exit 1 |
| 180 | ;; |
| 181 | esac |
| 182 | shift |
| 183 | done |
| 184 | } |
| 185 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 186 | # Make the outcome file path relative to the original directory, not |
| 187 | # to .../tests |
| 188 | case "$MBEDTLS_TEST_OUTCOME_FILE" in |
| 189 | [!/]*) |
| 190 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" |
| 191 | ;; |
| 192 | esac |
| 193 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 194 | # Read boolean configuration options from mbedtls_config.h for easy and quick |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 195 | # testing. Skip non-boolean options (with something other than spaces |
| 196 | # and a comment after "#define SYMBOL"). The variable contains a |
| 197 | # space-separated list of symbols. |
Jerry Yu | d0fcf7f | 2021-12-10 18:45:51 +0800 | [diff] [blame] | 198 | CONFIGS_ENABLED=" $(echo `$P_QUERY -l` )" |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 199 | # Skip next test; use this macro to skip tests which are legitimate |
| 200 | # in theory and expected to be re-introduced at some point, but |
| 201 | # aren't expected to succeed at the moment due to problems outside |
| 202 | # our control (such as bugs in other TLS implementations). |
| 203 | skip_next_test() { |
| 204 | SKIP_NEXT="YES" |
| 205 | } |
| 206 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 207 | # skip next test if the flag is not enabled in mbedtls_config.h |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 208 | requires_config_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 209 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 210 | *" $1"[\ =]*) :;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 211 | *) SKIP_NEXT="YES";; |
| 212 | esac |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 213 | } |
| 214 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 215 | # skip next test if the flag is enabled in mbedtls_config.h |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 216 | requires_config_disabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 217 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 218 | *" $1"[\ =]*) SKIP_NEXT="YES";; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 219 | esac |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 220 | } |
| 221 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 222 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 223 | # This function uses the query_config command line option to query the |
| 224 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 225 | # program. The command will always return a success value if the |
| 226 | # configuration is defined and the value will be printed to stdout. |
| 227 | # |
| 228 | # Note that if the configuration is not defined or is defined to nothing, |
| 229 | # the output of this function will be an empty string. |
| 230 | ${P_SRV} "query_config=${1}" |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 231 | } |
| 232 | |
| 233 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 234 | VAL="$( get_config_value_or_default "$1" )" |
| 235 | if [ -z "$VAL" ]; then |
| 236 | # Should never happen |
| 237 | echo "Mbed TLS configuration $1 is not defined" |
| 238 | exit 1 |
| 239 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 240 | SKIP_NEXT="YES" |
| 241 | fi |
| 242 | } |
| 243 | |
| 244 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 245 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 246 | if [ -z "$VAL" ]; then |
| 247 | # Should never happen |
| 248 | echo "Mbed TLS configuration $1 is not defined" |
| 249 | exit 1 |
| 250 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 251 | SKIP_NEXT="YES" |
| 252 | fi |
| 253 | } |
| 254 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 255 | requires_config_value_equals() { |
| 256 | VAL=$( get_config_value_or_default "$1" ) |
| 257 | if [ -z "$VAL" ]; then |
| 258 | # Should never happen |
| 259 | echo "Mbed TLS configuration $1 is not defined" |
| 260 | exit 1 |
| 261 | elif [ "$VAL" -ne "$2" ]; then |
| 262 | SKIP_NEXT="YES" |
| 263 | fi |
| 264 | } |
| 265 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 266 | # Space-separated list of ciphersuites supported by this build of |
| 267 | # Mbed TLS. |
| 268 | P_CIPHERSUITES=" $($P_CLI --help 2>/dev/null | |
XiaokangQian | 4b82ca1 | 2021-11-18 08:27:17 +0000 | [diff] [blame] | 269 | grep 'TLS-\|TLS1-3' | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 270 | tr -s ' \n' ' ')" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 271 | requires_ciphersuite_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 272 | case $P_CIPHERSUITES in |
| 273 | *" $1 "*) :;; |
| 274 | *) SKIP_NEXT="YES";; |
| 275 | esac |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 276 | } |
| 277 | |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 278 | # maybe_requires_ciphersuite_enabled CMD [RUN_TEST_OPTION...] |
| 279 | # If CMD (call to a TLS client or server program) requires a specific |
| 280 | # ciphersuite, arrange to only run the test case if this ciphersuite is |
Dave Rodgman | c424098 | 2021-06-29 19:53:16 +0100 | [diff] [blame] | 281 | # enabled. |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 282 | maybe_requires_ciphersuite_enabled() { |
| 283 | case "$1" in |
| 284 | *\ force_ciphersuite=*) :;; |
| 285 | *) return;; # No specific required ciphersuite |
| 286 | esac |
| 287 | ciphersuite="${1##*\ force_ciphersuite=}" |
| 288 | ciphersuite="${ciphersuite%%[!-0-9A-Z_a-z]*}" |
| 289 | shift |
| 290 | |
Dave Rodgman | c424098 | 2021-06-29 19:53:16 +0100 | [diff] [blame] | 291 | requires_ciphersuite_enabled "$ciphersuite" |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 292 | |
| 293 | unset ciphersuite |
| 294 | } |
| 295 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 296 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 297 | requires_openssl_with_fallback_scsv() { |
| 298 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 299 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 300 | then |
| 301 | OPENSSL_HAS_FBSCSV="YES" |
| 302 | else |
| 303 | OPENSSL_HAS_FBSCSV="NO" |
| 304 | fi |
| 305 | fi |
| 306 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 307 | SKIP_NEXT="YES" |
| 308 | fi |
| 309 | } |
| 310 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 311 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 312 | requires_max_content_len() { |
| 313 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 314 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 315 | } |
| 316 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 317 | # skip next test if GnuTLS isn't available |
| 318 | requires_gnutls() { |
| 319 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 320 | if ( which "$GNUTLS_CLI" && which "$GNUTLS_SERV" ) >/dev/null 2>&1; then |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 321 | GNUTLS_AVAILABLE="YES" |
| 322 | else |
| 323 | GNUTLS_AVAILABLE="NO" |
| 324 | fi |
| 325 | fi |
| 326 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 327 | SKIP_NEXT="YES" |
| 328 | fi |
| 329 | } |
| 330 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 331 | # skip next test if GnuTLS-next isn't available |
| 332 | requires_gnutls_next() { |
| 333 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 334 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 335 | GNUTLS_NEXT_AVAILABLE="YES" |
| 336 | else |
| 337 | GNUTLS_NEXT_AVAILABLE="NO" |
| 338 | fi |
| 339 | fi |
| 340 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 341 | SKIP_NEXT="YES" |
| 342 | fi |
| 343 | } |
| 344 | |
| 345 | # skip next test if OpenSSL-legacy isn't available |
| 346 | requires_openssl_legacy() { |
| 347 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 348 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 349 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 350 | else |
| 351 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 352 | fi |
| 353 | fi |
| 354 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 355 | SKIP_NEXT="YES" |
| 356 | fi |
| 357 | } |
| 358 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 359 | requires_openssl_next() { |
| 360 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then |
| 361 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then |
| 362 | OPENSSL_NEXT_AVAILABLE="YES" |
| 363 | else |
| 364 | OPENSSL_NEXT_AVAILABLE="NO" |
| 365 | fi |
| 366 | fi |
| 367 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 368 | SKIP_NEXT="YES" |
| 369 | fi |
| 370 | } |
| 371 | |
| 372 | # skip next test if tls1_3 is not available |
| 373 | requires_openssl_tls1_3() { |
| 374 | requires_openssl_next |
| 375 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 376 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 377 | fi |
| 378 | if [ -z "${OPENSSL_TLS1_3_AVAILABLE:-}" ]; then |
| 379 | if $OPENSSL_NEXT s_client -help 2>&1 | grep tls1_3 >/dev/null |
| 380 | then |
| 381 | OPENSSL_TLS1_3_AVAILABLE="YES" |
| 382 | else |
| 383 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 384 | fi |
| 385 | fi |
| 386 | if [ "$OPENSSL_TLS1_3_AVAILABLE" = "NO" ]; then |
| 387 | SKIP_NEXT="YES" |
| 388 | fi |
| 389 | } |
| 390 | |
| 391 | # skip next test if tls1_3 is not available |
| 392 | requires_gnutls_tls1_3() { |
| 393 | requires_gnutls_next |
| 394 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 395 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 396 | fi |
| 397 | if [ -z "${GNUTLS_TLS1_3_AVAILABLE:-}" ]; then |
| 398 | if $GNUTLS_NEXT_CLI -l 2>&1 | grep VERS-TLS1.3 >/dev/null |
| 399 | then |
| 400 | GNUTLS_TLS1_3_AVAILABLE="YES" |
| 401 | else |
| 402 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 403 | fi |
| 404 | fi |
| 405 | if [ "$GNUTLS_TLS1_3_AVAILABLE" = "NO" ]; then |
| 406 | SKIP_NEXT="YES" |
| 407 | fi |
| 408 | } |
| 409 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 410 | # Check %NO_TICKETS option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 411 | requires_gnutls_next_no_ticket() { |
| 412 | requires_gnutls_next |
| 413 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 414 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 415 | fi |
| 416 | if [ -z "${GNUTLS_NO_TICKETS_AVAILABLE:-}" ]; then |
| 417 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep NO_TICKETS >/dev/null |
| 418 | then |
| 419 | GNUTLS_NO_TICKETS_AVAILABLE="YES" |
| 420 | else |
| 421 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 422 | fi |
| 423 | fi |
| 424 | if [ "$GNUTLS_NO_TICKETS_AVAILABLE" = "NO" ]; then |
| 425 | SKIP_NEXT="YES" |
| 426 | fi |
| 427 | } |
| 428 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 429 | # Check %DISABLE_TLS13_COMPAT_MODE option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 430 | requires_gnutls_next_disable_tls13_compat() { |
| 431 | requires_gnutls_next |
| 432 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 433 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 434 | fi |
| 435 | if [ -z "${GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE:-}" ]; then |
| 436 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep DISABLE_TLS13_COMPAT_MODE >/dev/null |
| 437 | then |
| 438 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="YES" |
| 439 | else |
| 440 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 441 | fi |
| 442 | fi |
| 443 | if [ "$GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE" = "NO" ]; then |
| 444 | SKIP_NEXT="YES" |
| 445 | fi |
| 446 | } |
| 447 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 448 | # skip next test if IPv6 isn't available on this host |
| 449 | requires_ipv6() { |
| 450 | if [ -z "${HAS_IPV6:-}" ]; then |
| 451 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 452 | SRV_PID=$! |
| 453 | sleep 1 |
| 454 | kill $SRV_PID >/dev/null 2>&1 |
| 455 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 456 | HAS_IPV6="NO" |
| 457 | else |
| 458 | HAS_IPV6="YES" |
| 459 | fi |
| 460 | rm -r $SRV_OUT |
| 461 | fi |
| 462 | |
| 463 | if [ "$HAS_IPV6" = "NO" ]; then |
| 464 | SKIP_NEXT="YES" |
| 465 | fi |
| 466 | } |
| 467 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 468 | # skip next test if it's i686 or uname is not available |
| 469 | requires_not_i686() { |
| 470 | if [ -z "${IS_I686:-}" ]; then |
| 471 | IS_I686="YES" |
| 472 | if which "uname" >/dev/null 2>&1; then |
| 473 | if [ -z "$(uname -a | grep i686)" ]; then |
| 474 | IS_I686="NO" |
| 475 | fi |
| 476 | fi |
| 477 | fi |
| 478 | if [ "$IS_I686" = "YES" ]; then |
| 479 | SKIP_NEXT="YES" |
| 480 | fi |
| 481 | } |
| 482 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 483 | # Calculate the input & output maximum content lengths set in the config |
David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 484 | MAX_CONTENT_LEN=16384 |
Yuto Takano | 2be6f1a | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 485 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 486 | MAX_OUT_LEN=$( get_config_value_or_default "MBEDTLS_SSL_OUT_CONTENT_LEN" ) |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 487 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 488 | # Calculate the maximum content length that fits both |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 489 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 490 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 491 | fi |
| 492 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 493 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 494 | fi |
| 495 | |
| 496 | # skip the next test if the SSL output buffer is less than 16KB |
| 497 | requires_full_size_output_buffer() { |
| 498 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 499 | SKIP_NEXT="YES" |
| 500 | fi |
| 501 | } |
| 502 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 503 | # skip the next test if valgrind is in use |
| 504 | not_with_valgrind() { |
| 505 | if [ "$MEMCHECK" -gt 0 ]; then |
| 506 | SKIP_NEXT="YES" |
| 507 | fi |
| 508 | } |
| 509 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 510 | # skip the next test if valgrind is NOT in use |
| 511 | only_with_valgrind() { |
| 512 | if [ "$MEMCHECK" -eq 0 ]; then |
| 513 | SKIP_NEXT="YES" |
| 514 | fi |
| 515 | } |
| 516 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 517 | # multiply the client timeout delay by the given factor for the next test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 518 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 519 | CLI_DELAY_FACTOR=$1 |
| 520 | } |
| 521 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 522 | # wait for the given seconds after the client finished in the next test |
| 523 | server_needs_more_time() { |
| 524 | SRV_DELAY_SECONDS=$1 |
| 525 | } |
| 526 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 527 | # print_name <name> |
| 528 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 529 | TESTS=$(( $TESTS + 1 )) |
| 530 | LINE="" |
| 531 | |
| 532 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 533 | LINE="$TESTS " |
| 534 | fi |
| 535 | |
| 536 | LINE="$LINE$1" |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 537 | printf "%s " "$LINE" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 538 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 539 | for i in `seq 1 $LEN`; do printf '.'; done |
| 540 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 541 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 542 | } |
| 543 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 544 | # record_outcome <outcome> [<failure-reason>] |
| 545 | # The test name must be in $NAME. |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 546 | # Use $TEST_SUITE_NAME as the test suite name if set. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 547 | record_outcome() { |
| 548 | echo "$1" |
| 549 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 550 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 551 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 552 | "${TEST_SUITE_NAME:-ssl-opt}" "$NAME" \ |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 553 | "$1" "${2-}" \ |
| 554 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 555 | fi |
| 556 | } |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 557 | unset TEST_SUITE_NAME |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 558 | |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 559 | # True if the presence of the given pattern in a log definitely indicates |
| 560 | # that the test has failed. False if the presence is inconclusive. |
| 561 | # |
| 562 | # Inputs: |
| 563 | # * $1: pattern found in the logs |
| 564 | # * $TIMES_LEFT: >0 if retrying is an option |
| 565 | # |
| 566 | # Outputs: |
| 567 | # * $outcome: set to a retry reason if the pattern is inconclusive, |
| 568 | # unchanged otherwise. |
| 569 | # * Return value: 1 if the pattern is inconclusive, |
| 570 | # 0 if the failure is definitive. |
| 571 | log_pattern_presence_is_conclusive() { |
| 572 | # If we've run out of attempts, then don't retry no matter what. |
| 573 | if [ $TIMES_LEFT -eq 0 ]; then |
| 574 | return 0 |
| 575 | fi |
| 576 | case $1 in |
| 577 | "resend") |
| 578 | # An undesired resend may have been caused by the OS dropping or |
| 579 | # delaying a packet at an inopportune time. |
| 580 | outcome="RETRY(resend)" |
| 581 | return 1;; |
| 582 | esac |
| 583 | } |
| 584 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 585 | # fail <message> |
| 586 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 587 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 588 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 589 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 590 | mv $SRV_OUT o-srv-${TESTS}.log |
| 591 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 592 | if [ -n "$PXY_CMD" ]; then |
| 593 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 594 | fi |
| 595 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 596 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 597 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 598 | echo " ! server output:" |
| 599 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 600 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 601 | echo " ! client output:" |
| 602 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 603 | if [ -n "$PXY_CMD" ]; then |
| 604 | echo " ! ========================================================" |
| 605 | echo " ! proxy output:" |
| 606 | cat o-pxy-${TESTS}.log |
| 607 | fi |
| 608 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 609 | fi |
| 610 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 611 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 612 | } |
| 613 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 614 | # is_polar <cmd_line> |
| 615 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 616 | case "$1" in |
| 617 | *ssl_client2*) true;; |
| 618 | *ssl_server2*) true;; |
| 619 | *) false;; |
| 620 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 621 | } |
| 622 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 623 | # openssl s_server doesn't have -www with DTLS |
| 624 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 625 | case "$SRV_CMD" in |
| 626 | *s_server*-dtls*) |
| 627 | NEEDS_INPUT=1 |
| 628 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 629 | *) NEEDS_INPUT=0;; |
| 630 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 631 | } |
| 632 | |
| 633 | # provide input to commands that need it |
| 634 | provide_input() { |
| 635 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 636 | return |
| 637 | fi |
| 638 | |
| 639 | while true; do |
| 640 | echo "HTTP/1.0 200 OK" |
| 641 | sleep 1 |
| 642 | done |
| 643 | } |
| 644 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 645 | # has_mem_err <log_file_name> |
| 646 | has_mem_err() { |
| 647 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 648 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 649 | then |
| 650 | return 1 # false: does not have errors |
| 651 | else |
| 652 | return 0 # true: has errors |
| 653 | fi |
| 654 | } |
| 655 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 656 | # Wait for process $2 named $3 to be listening on port $1. Print error to $4. |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 657 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 658 | wait_app_start() { |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 659 | newline=' |
| 660 | ' |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 661 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 662 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 663 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 664 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 665 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 666 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 667 | # Make a tight loop, server normally takes less than 1s to start. |
Paul Elliott | 58ed8a7 | 2021-10-19 17:56:39 +0100 | [diff] [blame] | 668 | while true; do |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 669 | SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -F p) |
| 670 | # When we use a proxy, it will be listening on the same port we |
| 671 | # are checking for as well as the server and lsof will list both. |
| 672 | # If multiple PIDs are returned, each one will be on a separate |
| 673 | # line, each prepended with 'p'. |
| 674 | case ${newline}${SERVER_PIDS}${newline} in |
| 675 | *${newline}p${2}${newline}*) break;; |
| 676 | esac |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 677 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 678 | echo "$3 START TIMEOUT" |
| 679 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 680 | break |
| 681 | fi |
| 682 | # Linux and *BSD support decimal arguments to sleep. On other |
| 683 | # OSes this may be a tight loop. |
| 684 | sleep 0.1 2>/dev/null || true |
| 685 | done |
| 686 | } |
| 687 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 688 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 689 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 690 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 691 | } |
| 692 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 693 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 694 | # Wait for server process $2 to be listening on port $1. |
| 695 | wait_server_start() { |
| 696 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 697 | } |
| 698 | |
| 699 | # Wait for proxy process $2 to be listening on port $1. |
| 700 | wait_proxy_start() { |
| 701 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 702 | } |
| 703 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 704 | # Given the client or server debug output, parse the unix timestamp that is |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 705 | # included in the first 4 bytes of the random bytes and check that it's within |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 706 | # acceptable bounds |
| 707 | check_server_hello_time() { |
| 708 | # Extract the time from the debug (lvl 3) output of the client |
Andres Amaya Garcia | 67d8da5 | 2017-09-15 15:49:24 +0100 | [diff] [blame] | 709 | SERVER_HELLO_TIME="$(sed -n 's/.*server hello, current time: //p' < "$1")" |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 710 | # Get the Unix timestamp for now |
| 711 | CUR_TIME=$(date +'%s') |
| 712 | THRESHOLD_IN_SECS=300 |
| 713 | |
| 714 | # Check if the ServerHello time was printed |
| 715 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 716 | return 1 |
| 717 | fi |
| 718 | |
| 719 | # Check the time in ServerHello is within acceptable bounds |
| 720 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 721 | # The time in ServerHello is at least 5 minutes before now |
| 722 | return 1 |
| 723 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 724 | # The time in ServerHello is at least 5 minutes later than now |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 725 | return 1 |
| 726 | else |
| 727 | return 0 |
| 728 | fi |
| 729 | } |
| 730 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 731 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 732 | handshake_memory_get() { |
| 733 | OUTPUT_VARIABLE="$1" |
| 734 | OUTPUT_FILE="$2" |
| 735 | |
| 736 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 737 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 738 | |
| 739 | # Check if memory usage was read |
| 740 | if [ -z "$MEM_USAGE" ]; then |
| 741 | echo "Error: Can not read the value of handshake memory usage" |
| 742 | return 1 |
| 743 | else |
| 744 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 745 | return 0 |
| 746 | fi |
| 747 | } |
| 748 | |
| 749 | # Get handshake memory usage from server or client output and check if this value |
| 750 | # is not higher than the maximum given by the first argument |
| 751 | handshake_memory_check() { |
| 752 | MAX_MEMORY="$1" |
| 753 | OUTPUT_FILE="$2" |
| 754 | |
| 755 | # Get memory usage |
| 756 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 757 | return 1 |
| 758 | fi |
| 759 | |
| 760 | # Check if memory usage is below max value |
| 761 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 762 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 763 | "but should be below $MAX_MEMORY bytes" |
| 764 | return 1 |
| 765 | else |
| 766 | return 0 |
| 767 | fi |
| 768 | } |
| 769 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 770 | # wait for client to terminate and set CLI_EXIT |
| 771 | # must be called right after starting the client |
| 772 | wait_client_done() { |
| 773 | CLI_PID=$! |
| 774 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 775 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 776 | CLI_DELAY_FACTOR=1 |
| 777 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 778 | ( sleep $CLI_DELAY; echo "===CLIENT_TIMEOUT===" >> $CLI_OUT; kill $CLI_PID ) & |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 779 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 780 | |
| 781 | wait $CLI_PID |
| 782 | CLI_EXIT=$? |
| 783 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 784 | kill $DOG_PID >/dev/null 2>&1 |
| 785 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 786 | |
| 787 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 788 | |
| 789 | sleep $SRV_DELAY_SECONDS |
| 790 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 791 | } |
| 792 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 793 | # check if the given command uses dtls and sets global variable DTLS |
| 794 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 795 | case "$1" in |
Paul Elliott | 1428f25 | 2021-10-12 16:02:55 +0100 | [diff] [blame] | 796 | *dtls=1*|*-dtls*|*-u*) DTLS=1;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 797 | *) DTLS=0;; |
| 798 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 799 | } |
| 800 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 801 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 802 | is_gnutls() { |
| 803 | case "$1" in |
| 804 | *gnutls-cli*) |
| 805 | CMD_IS_GNUTLS=1 |
| 806 | ;; |
| 807 | *gnutls-serv*) |
| 808 | CMD_IS_GNUTLS=1 |
| 809 | ;; |
| 810 | *) |
| 811 | CMD_IS_GNUTLS=0 |
| 812 | ;; |
| 813 | esac |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 814 | } |
| 815 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 816 | # Compare file content |
| 817 | # Usage: find_in_both pattern file1 file2 |
| 818 | # extract from file1 the first line matching the pattern |
| 819 | # check in file2 that the same line can be found |
| 820 | find_in_both() { |
| 821 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 822 | if [ -z "$srv_pattern" ]; then |
| 823 | return 1; |
| 824 | fi |
| 825 | |
| 826 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 827 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 828 | else |
| 829 | return 1; |
| 830 | fi |
| 831 | } |
| 832 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 833 | SKIP_HANDSHAKE_CHECK="NO" |
| 834 | skip_handshake_stage_check() { |
| 835 | SKIP_HANDSHAKE_CHECK="YES" |
| 836 | } |
| 837 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 838 | # Analyze the commands that will be used in a test. |
| 839 | # |
| 840 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass |
| 841 | # extra arguments or go through wrappers. |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 842 | analyze_test_commands() { |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 843 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 844 | # 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] | 845 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 846 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 847 | case " $SRV_CMD " in |
| 848 | *' server_addr=::1 '*) |
| 849 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 850 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 851 | fi |
| 852 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 853 | # update CMD_IS_GNUTLS variable |
| 854 | is_gnutls "$SRV_CMD" |
| 855 | |
| 856 | # if the server uses gnutls but doesn't set priority, explicitly |
| 857 | # set the default priority |
| 858 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 859 | case "$SRV_CMD" in |
| 860 | *--priority*) :;; |
| 861 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 862 | esac |
| 863 | fi |
| 864 | |
| 865 | # update CMD_IS_GNUTLS variable |
| 866 | is_gnutls "$CLI_CMD" |
| 867 | |
| 868 | # if the client uses gnutls but doesn't set priority, explicitly |
| 869 | # set the default priority |
| 870 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 871 | case "$CLI_CMD" in |
| 872 | *--priority*) :;; |
| 873 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 874 | esac |
| 875 | fi |
| 876 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 877 | # fix client port |
| 878 | if [ -n "$PXY_CMD" ]; then |
| 879 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 880 | else |
| 881 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 882 | fi |
| 883 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 884 | # prepend valgrind to our commands if active |
| 885 | if [ "$MEMCHECK" -gt 0 ]; then |
| 886 | if is_polar "$SRV_CMD"; then |
| 887 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 888 | fi |
| 889 | if is_polar "$CLI_CMD"; then |
| 890 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 891 | fi |
| 892 | fi |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 893 | } |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 894 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 895 | # Check for failure conditions after a test case. |
| 896 | # |
| 897 | # Inputs from run_test: |
| 898 | # * positional parameters: test options (see run_test documentation) |
| 899 | # * $CLI_EXIT: client return code |
| 900 | # * $CLI_EXPECT: expected client return code |
| 901 | # * $SRV_RET: server return code |
| 902 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 903 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 904 | # |
| 905 | # Outputs: |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 906 | # * $outcome: one of PASS/RETRY*/FAIL |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 907 | check_test_failure() { |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 908 | outcome=FAIL |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 909 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 910 | if [ $TIMES_LEFT -gt 0 ] && |
| 911 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null |
| 912 | then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 913 | outcome="RETRY(client-timeout)" |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 914 | return |
| 915 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 916 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 917 | # 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] | 918 | # (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] | 919 | # expected client exit to incorrectly succeed in case of catastrophic |
| 920 | # failure) |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 921 | if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ] |
| 922 | then |
| 923 | if is_polar "$SRV_CMD"; then |
| 924 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
| 925 | else |
| 926 | fail "server or client failed to reach handshake stage" |
| 927 | return |
| 928 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 929 | fi |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 930 | if is_polar "$CLI_CMD"; then |
| 931 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
| 932 | else |
| 933 | fail "server or client failed to reach handshake stage" |
| 934 | return |
| 935 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 936 | fi |
| 937 | fi |
| 938 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 939 | SKIP_HANDSHAKE_CHECK="NO" |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 940 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 941 | # exit with status 0 when interrupted by a signal, and we don't really |
| 942 | # care anyway), in case e.g. the server reports a memory leak. |
| 943 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 944 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 945 | return |
| 946 | fi |
| 947 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 948 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 949 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 950 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 951 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 952 | 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] | 953 | return |
| 954 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 955 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 956 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 957 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 958 | # 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] | 959 | while [ $# -gt 0 ] |
| 960 | do |
| 961 | case $1 in |
| 962 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 963 | 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] | 964 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 965 | return |
| 966 | fi |
| 967 | ;; |
| 968 | |
| 969 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 970 | 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] | 971 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 972 | return |
| 973 | fi |
| 974 | ;; |
| 975 | |
| 976 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 977 | if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 978 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 979 | fail "pattern '$2' MUST NOT be present in the Server output" |
| 980 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 981 | return |
| 982 | fi |
| 983 | ;; |
| 984 | |
| 985 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 986 | if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 987 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 988 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 989 | fi |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 990 | return |
| 991 | fi |
| 992 | ;; |
| 993 | |
| 994 | # The filtering in the following two options (-u and -U) do the following |
| 995 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 996 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 997 | # - keep one of each non-unique line |
| 998 | # - count how many lines remain |
| 999 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 1000 | # if there were no duplicates. |
| 1001 | "-U") |
| 1002 | 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 |
| 1003 | fail "lines following pattern '$2' must be unique in Server output" |
| 1004 | return |
| 1005 | fi |
| 1006 | ;; |
| 1007 | |
| 1008 | "-u") |
| 1009 | 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 |
| 1010 | 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] | 1011 | return |
| 1012 | fi |
| 1013 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 1014 | "-F") |
| 1015 | if ! $2 "$SRV_OUT"; then |
| 1016 | fail "function call to '$2' failed on Server output" |
| 1017 | return |
| 1018 | fi |
| 1019 | ;; |
| 1020 | "-f") |
| 1021 | if ! $2 "$CLI_OUT"; then |
| 1022 | fail "function call to '$2' failed on Client output" |
| 1023 | return |
| 1024 | fi |
| 1025 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1026 | "-g") |
| 1027 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 1028 | fail "function call to '$2' failed on Server and Client output" |
| 1029 | return |
| 1030 | fi |
| 1031 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1032 | |
| 1033 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1034 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1035 | exit 1 |
| 1036 | esac |
| 1037 | shift 2 |
| 1038 | done |
| 1039 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1040 | # check valgrind's results |
| 1041 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1042 | 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] | 1043 | fail "Server has memory errors" |
| 1044 | return |
| 1045 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1046 | 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] | 1047 | fail "Client has memory errors" |
| 1048 | return |
| 1049 | fi |
| 1050 | fi |
| 1051 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1052 | # if we're here, everything is ok |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1053 | outcome=PASS |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1054 | } |
| 1055 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1056 | # Run the current test case: start the server and if applicable the proxy, run |
| 1057 | # the client, wait for all processes to finish or time out. |
| 1058 | # |
| 1059 | # Inputs: |
| 1060 | # * $NAME: test case name |
| 1061 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run |
| 1062 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs |
| 1063 | # |
| 1064 | # Outputs: |
| 1065 | # * $CLI_EXIT: client return code |
| 1066 | # * $SRV_RET: server return code |
| 1067 | do_run_test_once() { |
| 1068 | # run the commands |
| 1069 | if [ -n "$PXY_CMD" ]; then |
| 1070 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
| 1071 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 1072 | PXY_PID=$! |
| 1073 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
| 1074 | fi |
| 1075 | |
| 1076 | check_osrv_dtls |
| 1077 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
| 1078 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 1079 | SRV_PID=$! |
| 1080 | wait_server_start "$SRV_PORT" "$SRV_PID" |
| 1081 | |
| 1082 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
| 1083 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 1084 | wait_client_done |
| 1085 | |
| 1086 | sleep 0.05 |
| 1087 | |
| 1088 | # terminate the server (and the proxy) |
| 1089 | kill $SRV_PID |
| 1090 | wait $SRV_PID |
| 1091 | SRV_RET=$? |
| 1092 | |
| 1093 | if [ -n "$PXY_CMD" ]; then |
| 1094 | kill $PXY_PID >/dev/null 2>&1 |
| 1095 | wait $PXY_PID |
| 1096 | fi |
| 1097 | } |
| 1098 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1099 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
| 1100 | # Options: -s pattern pattern that must be present in server output |
| 1101 | # -c pattern pattern that must be present in client output |
| 1102 | # -u pattern lines after pattern must be unique in client output |
| 1103 | # -f call shell function on client output |
| 1104 | # -S pattern pattern that must be absent in server output |
| 1105 | # -C pattern pattern that must be absent in client output |
| 1106 | # -U pattern lines after pattern must be unique in server output |
| 1107 | # -F call shell function on server output |
| 1108 | # -g call shell function on server and client output |
| 1109 | run_test() { |
| 1110 | NAME="$1" |
| 1111 | shift 1 |
| 1112 | |
| 1113 | if is_excluded "$NAME"; then |
| 1114 | SKIP_NEXT="NO" |
| 1115 | # There was no request to run the test, so don't record its outcome. |
| 1116 | return |
| 1117 | fi |
| 1118 | |
| 1119 | print_name "$NAME" |
| 1120 | |
| 1121 | # Do we only run numbered tests? |
| 1122 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 1123 | case ",$RUN_TEST_NUMBER," in |
| 1124 | *",$TESTS,"*) :;; |
| 1125 | *) SKIP_NEXT="YES";; |
| 1126 | esac |
| 1127 | fi |
| 1128 | |
| 1129 | # does this test use a proxy? |
| 1130 | if [ "X$1" = "X-p" ]; then |
| 1131 | PXY_CMD="$2" |
| 1132 | shift 2 |
| 1133 | else |
| 1134 | PXY_CMD="" |
| 1135 | fi |
| 1136 | |
| 1137 | # get commands and client output |
| 1138 | SRV_CMD="$1" |
| 1139 | CLI_CMD="$2" |
| 1140 | CLI_EXPECT="$3" |
| 1141 | shift 3 |
| 1142 | |
| 1143 | # Check if test uses files |
| 1144 | case "$SRV_CMD $CLI_CMD" in |
| 1145 | *data_files/*) |
| 1146 | requires_config_enabled MBEDTLS_FS_IO;; |
| 1147 | esac |
| 1148 | |
Gilles Peskine | 82a4ab2 | 2022-02-25 19:46:30 +0100 | [diff] [blame] | 1149 | # Check if the test uses DTLS. |
| 1150 | detect_dtls "$SRV_CMD" |
| 1151 | if [ "$DTLS" -eq 1 ]; then |
| 1152 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 1153 | fi |
| 1154 | |
Gilles Peskine | a165b5c | 2022-02-25 19:47:04 +0100 | [diff] [blame] | 1155 | # Check more TLS protocol features. |
| 1156 | case "$SRV_CMD $CLI_CMD" in |
| 1157 | *[-_\ =]tickets=[^0]*) |
| 1158 | requires_config_enabled MBEDTLS_SSL_TICKET_C;; |
| 1159 | esac |
| 1160 | case "$SRV_CMD $CLI_CMD" in |
| 1161 | *[-_\ =]alpn=*) |
| 1162 | requires_config_enabled MBEDTLS_SSL_ALPN;; |
| 1163 | esac |
| 1164 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1165 | # If the client or serve requires a ciphersuite, check that it's enabled. |
| 1166 | maybe_requires_ciphersuite_enabled "$SRV_CMD" "$@" |
| 1167 | maybe_requires_ciphersuite_enabled "$CLI_CMD" "$@" |
| 1168 | |
| 1169 | # should we skip? |
| 1170 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 1171 | SKIP_NEXT="NO" |
| 1172 | record_outcome "SKIP" |
| 1173 | SKIPS=$(( $SKIPS + 1 )) |
| 1174 | return |
| 1175 | fi |
| 1176 | |
| 1177 | analyze_test_commands "$@" |
| 1178 | |
| 1179 | TIMES_LEFT=2 |
| 1180 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1181 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1182 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1183 | do_run_test_once |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1184 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1185 | check_test_failure "$@" |
| 1186 | case $outcome in |
| 1187 | PASS) break;; |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1188 | RETRY*) printf "$outcome ";; |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1189 | FAIL) return;; |
| 1190 | esac |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1191 | done |
| 1192 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1193 | # If we get this far, the test case passed. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1194 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1195 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1196 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1197 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1198 | if [ -n "$PXY_CMD" ]; then |
| 1199 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1200 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1201 | fi |
| 1202 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1203 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1204 | } |
| 1205 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1206 | run_test_psa() { |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1207 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1208 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1209 | run_test "PSA-supported ciphersuite: $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1210 | "$P_SRV debug_level=3 force_version=tls12" \ |
| 1211 | "$P_CLI debug_level=3 force_version=tls12 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1212 | 0 \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1213 | -c "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1214 | -c "calc PSA finished" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1215 | -s "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1216 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1217 | -C "Failed to setup PSA-based cipher context"\ |
| 1218 | -S "Failed to setup PSA-based cipher context"\ |
| 1219 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1220 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1221 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1222 | -S "error" \ |
| 1223 | -C "error" |
| 1224 | } |
| 1225 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1226 | run_test_psa_force_curve() { |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1227 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1228 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1229 | run_test "PSA - ECDH with $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1230 | "$P_SRV debug_level=4 force_version=tls12 curves=$1" \ |
| 1231 | "$P_CLI debug_level=4 force_version=tls12 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 curves=$1" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1232 | 0 \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1233 | -c "PSA calc verify" \ |
| 1234 | -c "calc PSA finished" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1235 | -s "PSA calc verify" \ |
| 1236 | -s "calc PSA finished" \ |
| 1237 | -C "Failed to setup PSA-based cipher context"\ |
| 1238 | -S "Failed to setup PSA-based cipher context"\ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1239 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1240 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1241 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1242 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1243 | -C "error" |
| 1244 | } |
| 1245 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1246 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1247 | # a maximum fragment length. |
| 1248 | # first argument ($1) is MFL for SSL client |
| 1249 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1250 | run_test_memory_after_hanshake_with_mfl() |
| 1251 | { |
| 1252 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1253 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1254 | |
| 1255 | # Leave some margin for robustness |
| 1256 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1257 | |
| 1258 | run_test "Handshake memory usage (MFL $1)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1259 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
| 1260 | "$P_CLI debug_level=3 force_version=tls12 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1261 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1262 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1263 | 0 \ |
| 1264 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1265 | } |
| 1266 | |
| 1267 | |
| 1268 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1269 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1270 | run_tests_memory_after_hanshake() |
| 1271 | { |
| 1272 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1273 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1274 | |
| 1275 | # first test with default MFU is to get reference memory usage |
| 1276 | MEMORY_USAGE_MFL_16K=0 |
| 1277 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1278 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
| 1279 | "$P_CLI debug_level=3 force_version=tls12 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1280 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1281 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1282 | 0 \ |
| 1283 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1284 | |
| 1285 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1286 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1287 | |
| 1288 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1289 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1290 | |
| 1291 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1292 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1293 | |
| 1294 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1295 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1296 | } |
| 1297 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1298 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1299 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1300 | rm -f context_srv.txt |
| 1301 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1302 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1303 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1304 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1305 | 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] | 1306 | exit 1 |
| 1307 | } |
| 1308 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1309 | # |
| 1310 | # MAIN |
| 1311 | # |
| 1312 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1313 | get_options "$@" |
| 1314 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1315 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1316 | # patterns rather than regular expressions, use a case statement instead |
| 1317 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1318 | # detects simple cases: plain substring, everything, nothing. |
| 1319 | # |
| 1320 | # As an exception, the character '.' is treated as an ordinary character |
| 1321 | # if it is the only special character in the string. This is because it's |
| 1322 | # rare to need "any one character", but needing a literal '.' is common |
| 1323 | # (e.g. '-f "DTLS 1.2"'). |
| 1324 | need_grep= |
| 1325 | case "$FILTER" in |
| 1326 | '^$') simple_filter=;; |
| 1327 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1328 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1329 | need_grep=1;; |
| 1330 | *) # No regexp or shell-pattern special character |
| 1331 | simple_filter="*$FILTER*";; |
| 1332 | esac |
| 1333 | case "$EXCLUDE" in |
| 1334 | '^$') simple_exclude=;; |
| 1335 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1336 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1337 | need_grep=1;; |
| 1338 | *) # No regexp or shell-pattern special character |
| 1339 | simple_exclude="*$EXCLUDE*";; |
| 1340 | esac |
| 1341 | if [ -n "$need_grep" ]; then |
| 1342 | is_excluded () { |
| 1343 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1344 | } |
| 1345 | else |
| 1346 | is_excluded () { |
| 1347 | case "$1" in |
| 1348 | $simple_exclude) true;; |
| 1349 | $simple_filter) false;; |
| 1350 | *) true;; |
| 1351 | esac |
| 1352 | } |
| 1353 | fi |
| 1354 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1355 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1356 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1357 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1358 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1359 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1360 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1361 | exit 1 |
| 1362 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1363 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1364 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1365 | exit 1 |
| 1366 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1367 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1368 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1369 | exit 1 |
| 1370 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1371 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1372 | if which valgrind >/dev/null 2>&1; then :; else |
| 1373 | echo "Memcheck not possible. Valgrind not found" |
| 1374 | exit 1 |
| 1375 | fi |
| 1376 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1377 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 1378 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1379 | exit 1 |
| 1380 | fi |
| 1381 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1382 | # used by watchdog |
| 1383 | MAIN_PID="$$" |
| 1384 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1385 | # We use somewhat arbitrary delays for tests: |
| 1386 | # - how long do we wait for the server to start (when lsof not available)? |
| 1387 | # - how long do we allow for the client to finish? |
| 1388 | # (not to check performance, just to avoid waiting indefinitely) |
| 1389 | # Things are slower with valgrind, so give extra time here. |
| 1390 | # |
| 1391 | # Note: without lsof, there is a trade-off between the running time of this |
| 1392 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1393 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1394 | # 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] | 1395 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1396 | START_DELAY=6 |
| 1397 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1398 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1399 | START_DELAY=2 |
| 1400 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1401 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1402 | |
| 1403 | # some particular tests need more time: |
| 1404 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1405 | # - for the server, we sleep for a number of seconds after the client exits |
| 1406 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1407 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1408 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1409 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1410 | # 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] | 1411 | # +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] | 1412 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 1413 | # 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] | 1414 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1415 | 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] | 1416 | 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] | 1417 | O_SRV="$O_SRV -accept $SRV_PORT" |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1418 | 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] | 1419 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1420 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1421 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1422 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1423 | 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] | 1424 | 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] | 1425 | fi |
| 1426 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 1427 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 1428 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1429 | O_NEXT_SRV_NO_CERT="$O_NEXT_SRV_NO_CERT -accept $SRV_PORT" |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1430 | 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] | 1431 | fi |
| 1432 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1433 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1434 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1435 | G_NEXT_SRV_NO_CERT="$G_NEXT_SRV_NO_CERT -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1436 | fi |
| 1437 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1438 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1439 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1440 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1441 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1442 | # Allow SHA-1, because many of our test certificates use it |
| 1443 | P_SRV="$P_SRV allow_sha1=1" |
| 1444 | P_CLI="$P_CLI allow_sha1=1" |
| 1445 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1446 | # Also pick a unique name for intermediate files |
| 1447 | SRV_OUT="srv_out.$$" |
| 1448 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1449 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1450 | SESSION="session.$$" |
| 1451 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1452 | SKIP_NEXT="NO" |
| 1453 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1454 | trap cleanup INT TERM HUP |
| 1455 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1456 | # Basic test |
| 1457 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1458 | # Checks that: |
| 1459 | # - 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] | 1460 | # - the expected parameters are selected |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1461 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1462 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 1463 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1464 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1465 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1466 | "$P_CLI" \ |
| 1467 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1468 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1469 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1470 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 1471 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1472 | -S "error" \ |
| 1473 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1474 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1475 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 1476 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1477 | run_test "Default, DTLS" \ |
| 1478 | "$P_SRV dtls=1" \ |
| 1479 | "$P_CLI dtls=1" \ |
| 1480 | 0 \ |
| 1481 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1482 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1483 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1484 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1485 | run_test "TLS client auth: required" \ |
| 1486 | "$P_SRV auth_mode=required" \ |
| 1487 | "$P_CLI" \ |
| 1488 | 0 \ |
| 1489 | -s "Verifying peer X.509 certificate... ok" |
| 1490 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1491 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 1492 | run_test "key size: TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1493 | "$P_SRV" \ |
| 1494 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1495 | 0 \ |
| 1496 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1497 | -c "Key size is 256" |
| 1498 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1499 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 1500 | run_test "key size: TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1501 | "$P_SRV" \ |
| 1502 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1503 | 0 \ |
| 1504 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1505 | -c "Key size is 128" |
| 1506 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1507 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1508 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1509 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1510 | requires_config_enabled MBEDTLS_SHA256_C |
| 1511 | run_test "TLS: password protected client key" \ |
| 1512 | "$P_SRV auth_mode=required" \ |
| 1513 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1514 | 0 |
| 1515 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1516 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1517 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1518 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1519 | requires_config_enabled MBEDTLS_SHA256_C |
| 1520 | run_test "TLS: password protected server key" \ |
| 1521 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1522 | "$P_CLI" \ |
| 1523 | 0 |
| 1524 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1525 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1526 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1527 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1528 | requires_config_enabled MBEDTLS_RSA_C |
| 1529 | requires_config_enabled MBEDTLS_SHA256_C |
| 1530 | run_test "TLS: password protected server key, two certificates" \ |
| 1531 | "$P_SRV \ |
| 1532 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1533 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1534 | "$P_CLI" \ |
| 1535 | 0 |
| 1536 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1537 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1538 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1539 | run_test "CA callback on client" \ |
| 1540 | "$P_SRV debug_level=3" \ |
| 1541 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1542 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1543 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1544 | -S "error" \ |
| 1545 | -C "error" |
| 1546 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1547 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1548 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1549 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1550 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1551 | requires_config_enabled MBEDTLS_SHA256_C |
| 1552 | run_test "CA callback on server" \ |
| 1553 | "$P_SRV auth_mode=required" \ |
| 1554 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1555 | key_file=data_files/server5.key" \ |
| 1556 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1557 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1558 | -s "Verifying peer X.509 certificate... ok" \ |
| 1559 | -S "error" \ |
| 1560 | -C "error" |
| 1561 | |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1562 | # Test using an opaque private key for client authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1563 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1564 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1565 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1566 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1567 | requires_config_enabled MBEDTLS_SHA256_C |
| 1568 | run_test "Opaque key for client authentication" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1569 | "$P_SRV auth_mode=required crt_file=data_files/server5.crt \ |
| 1570 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1571 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1572 | key_file=data_files/server5.key" \ |
| 1573 | 0 \ |
| 1574 | -c "key type: Opaque" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1575 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1576 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1577 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1578 | -S "error" \ |
| 1579 | -C "error" |
| 1580 | |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1581 | # Test using an opaque private key for server authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1582 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1583 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1584 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1585 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1586 | requires_config_enabled MBEDTLS_SHA256_C |
| 1587 | run_test "Opaque key for server authentication" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1588 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
| 1589 | key_file=data_files/server5.key" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1590 | "$P_CLI crt_file=data_files/server5.crt \ |
| 1591 | key_file=data_files/server5.key" \ |
| 1592 | 0 \ |
| 1593 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1594 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 1595 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1596 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1597 | -S "error" \ |
| 1598 | -C "error" |
| 1599 | |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1600 | # Test using an opaque private key for client/server authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1601 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1602 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1603 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1604 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1605 | requires_config_enabled MBEDTLS_SHA256_C |
| 1606 | run_test "Opaque key for client/server authentication" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1607 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
| 1608 | key_file=data_files/server5.key" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1609 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1610 | key_file=data_files/server5.key" \ |
| 1611 | 0 \ |
| 1612 | -c "key type: Opaque" \ |
| 1613 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1614 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 1615 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1616 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1617 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1618 | -S "error" \ |
| 1619 | -C "error" |
| 1620 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1621 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 1622 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 1623 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 1624 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 1625 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 1626 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 1627 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 1628 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 1629 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 1630 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 1631 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 1632 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1633 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1634 | run_test_psa_force_curve "secp521r1" |
| 1635 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 1636 | run_test_psa_force_curve "brainpoolP512r1" |
| 1637 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 1638 | run_test_psa_force_curve "secp384r1" |
| 1639 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1640 | run_test_psa_force_curve "brainpoolP384r1" |
| 1641 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1642 | run_test_psa_force_curve "secp256r1" |
| 1643 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1644 | run_test_psa_force_curve "secp256k1" |
| 1645 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1646 | run_test_psa_force_curve "brainpoolP256r1" |
| 1647 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1648 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1649 | ## SECP224K1 is buggy via the PSA API |
| 1650 | ## (https://github.com/ARMmbed/mbedtls/issues/3541), |
| 1651 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 1652 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 1653 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 1654 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1655 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1656 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1657 | run_test_psa_force_curve "secp192r1" |
| 1658 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1659 | run_test_psa_force_curve "secp192k1" |
| 1660 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1661 | # Test current time in ServerHello |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1662 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1663 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 1664 | run_test "ServerHello contains gmt_unix_time" \ |
| 1665 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1666 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1667 | 0 \ |
| 1668 | -f "check_server_hello_time" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1669 | -F "check_server_hello_time" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1670 | |
| 1671 | # Test for uniqueness of IVs in AEAD ciphersuites |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1672 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1673 | run_test "Unique IV in GCM" \ |
| 1674 | "$P_SRV exchanges=20 debug_level=4" \ |
| 1675 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 1676 | 0 \ |
| 1677 | -u "IV used" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1678 | -U "IV used" |
| 1679 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1680 | # Tests for certificate verification callback |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1681 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1682 | run_test "Configuration-specific CRT verification callback" \ |
| 1683 | "$P_SRV debug_level=3" \ |
| 1684 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1685 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1686 | -S "error" \ |
| 1687 | -c "Verify requested for " \ |
| 1688 | -c "Use configuration-specific verification callback" \ |
| 1689 | -C "Use context-specific verification callback" \ |
| 1690 | -C "error" |
| 1691 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1692 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1693 | run_test "Context-specific CRT verification callback" \ |
| 1694 | "$P_SRV debug_level=3" \ |
| 1695 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 1696 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1697 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1698 | -c "Verify requested for " \ |
| 1699 | -c "Use context-specific verification callback" \ |
| 1700 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1701 | -C "error" |
| 1702 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1703 | # Tests for SHA-1 support |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1704 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1705 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1706 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1707 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1708 | 1 \ |
| 1709 | -c "The certificate is signed with an unacceptable hash" |
| 1710 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1711 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1712 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1713 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1714 | "$P_CLI allow_sha1=1" \ |
| 1715 | 0 |
| 1716 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1717 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1718 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1719 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1720 | "$P_CLI allow_sha1=0" \ |
| 1721 | 0 |
| 1722 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1723 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1724 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1725 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1726 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1727 | 1 \ |
| 1728 | -s "The certificate is signed with an unacceptable hash" |
| 1729 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1730 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1731 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1732 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1733 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1734 | 0 |
| 1735 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1736 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1737 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1738 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1739 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1740 | 0 |
| 1741 | |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1742 | # Dummy TLS 1.3 test |
| 1743 | # Currently only checking that passing TLS 1.3 key exchange modes to |
| 1744 | # ssl_client2/ssl_server2 example programs works. |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 1745 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1746 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1747 | run_test "TLS 1.3, key exchange mode parameter passing: PSK only" \ |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 1748 | "$P_SRV tls13_kex_modes=psk debug_level=4" \ |
| 1749 | "$P_CLI tls13_kex_modes=psk debug_level=4" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1750 | 0 |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 1751 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1752 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1753 | run_test "TLS 1.3, key exchange mode parameter passing: PSK-ephemeral only" \ |
| 1754 | "$P_SRV tls13_kex_modes=psk_ephemeral" \ |
| 1755 | "$P_CLI tls13_kex_modes=psk_ephemeral" \ |
| 1756 | 0 |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 1757 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1758 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1759 | 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] | 1760 | "$P_SRV tls13_kex_modes=ephemeral" \ |
| 1761 | "$P_CLI tls13_kex_modes=ephemeral" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1762 | 0 |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 1763 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1764 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1765 | run_test "TLS 1.3, key exchange mode parameter passing: All ephemeral" \ |
| 1766 | "$P_SRV tls13_kex_modes=ephemeral_all" \ |
| 1767 | "$P_CLI tls13_kex_modes=ephemeral_all" \ |
| 1768 | 0 |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 1769 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1770 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1771 | run_test "TLS 1.3, key exchange mode parameter passing: All PSK" \ |
| 1772 | "$P_SRV tls13_kex_modes=psk_all" \ |
| 1773 | "$P_CLI tls13_kex_modes=psk_all" \ |
| 1774 | 0 |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 1775 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1776 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1777 | run_test "TLS 1.3, key exchange mode parameter passing: All" \ |
| 1778 | "$P_SRV tls13_kex_modes=all" \ |
| 1779 | "$P_CLI tls13_kex_modes=all" \ |
| 1780 | 0 |
| 1781 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1782 | # Tests for datagram packing |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1783 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1784 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1785 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1786 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1787 | 0 \ |
| 1788 | -c "next record in same datagram" \ |
| 1789 | -s "next record in same datagram" |
| 1790 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1791 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1792 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1793 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1794 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1795 | 0 \ |
| 1796 | -s "next record in same datagram" \ |
| 1797 | -C "next record in same datagram" |
| 1798 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1799 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1800 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1801 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1802 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1803 | 0 \ |
| 1804 | -S "next record in same datagram" \ |
| 1805 | -c "next record in same datagram" |
| 1806 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1807 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1808 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1809 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1810 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1811 | 0 \ |
| 1812 | -S "next record in same datagram" \ |
| 1813 | -C "next record in same datagram" |
| 1814 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1815 | # Tests for Context serialization |
| 1816 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1817 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1818 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1819 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1820 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1821 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1822 | 0 \ |
| 1823 | -c "Deserializing connection..." \ |
| 1824 | -S "Deserializing connection..." |
| 1825 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1826 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1827 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1828 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 1829 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1830 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1831 | 0 \ |
| 1832 | -c "Deserializing connection..." \ |
| 1833 | -S "Deserializing connection..." |
| 1834 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1835 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1836 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1837 | run_test "Context serialization, client serializes, GCM" \ |
| 1838 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1839 | "$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] | 1840 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1841 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1842 | -S "Deserializing connection..." |
| 1843 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1844 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1845 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1846 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1847 | run_test "Context serialization, client serializes, with CID" \ |
| 1848 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1849 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1850 | 0 \ |
| 1851 | -c "Deserializing connection..." \ |
| 1852 | -S "Deserializing connection..." |
| 1853 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1854 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1855 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1856 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1857 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1858 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1859 | 0 \ |
| 1860 | -C "Deserializing connection..." \ |
| 1861 | -s "Deserializing connection..." |
| 1862 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1863 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1864 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1865 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 1866 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1867 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1868 | 0 \ |
| 1869 | -C "Deserializing connection..." \ |
| 1870 | -s "Deserializing connection..." |
| 1871 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1872 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1873 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1874 | run_test "Context serialization, server serializes, GCM" \ |
| 1875 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1876 | "$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] | 1877 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1878 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1879 | -s "Deserializing connection..." |
| 1880 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1881 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1882 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1883 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1884 | run_test "Context serialization, server serializes, with CID" \ |
| 1885 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1886 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1887 | 0 \ |
| 1888 | -C "Deserializing connection..." \ |
| 1889 | -s "Deserializing connection..." |
| 1890 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1891 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1892 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1893 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1894 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1895 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1896 | 0 \ |
| 1897 | -c "Deserializing connection..." \ |
| 1898 | -s "Deserializing connection..." |
| 1899 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1900 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1901 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1902 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 1903 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1904 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1905 | 0 \ |
| 1906 | -c "Deserializing connection..." \ |
| 1907 | -s "Deserializing connection..." |
| 1908 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1909 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1910 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1911 | run_test "Context serialization, both serialize, GCM" \ |
| 1912 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1913 | "$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] | 1914 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1915 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1916 | -s "Deserializing connection..." |
| 1917 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1918 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1919 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1920 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1921 | run_test "Context serialization, both serialize, with CID" \ |
| 1922 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1923 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1924 | 0 \ |
| 1925 | -c "Deserializing connection..." \ |
| 1926 | -s "Deserializing connection..." |
| 1927 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1928 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1929 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1930 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1931 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1932 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1933 | 0 \ |
| 1934 | -c "Deserializing connection..." \ |
| 1935 | -S "Deserializing connection..." |
| 1936 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1937 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1938 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1939 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 1940 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1941 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1942 | 0 \ |
| 1943 | -c "Deserializing connection..." \ |
| 1944 | -S "Deserializing connection..." |
| 1945 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1946 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1947 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1948 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 1949 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1950 | "$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] | 1951 | 0 \ |
| 1952 | -c "Deserializing connection..." \ |
| 1953 | -S "Deserializing connection..." |
| 1954 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1955 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1956 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1957 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1958 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 1959 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1960 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1961 | 0 \ |
| 1962 | -c "Deserializing connection..." \ |
| 1963 | -S "Deserializing connection..." |
| 1964 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1965 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1966 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1967 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1968 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1969 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1970 | 0 \ |
| 1971 | -C "Deserializing connection..." \ |
| 1972 | -s "Deserializing connection..." |
| 1973 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1974 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1975 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1976 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 1977 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1978 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1979 | 0 \ |
| 1980 | -C "Deserializing connection..." \ |
| 1981 | -s "Deserializing connection..." |
| 1982 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1983 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1984 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1985 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 1986 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1987 | "$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] | 1988 | 0 \ |
| 1989 | -C "Deserializing connection..." \ |
| 1990 | -s "Deserializing connection..." |
| 1991 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1992 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1993 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1994 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1995 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 1996 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1997 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1998 | 0 \ |
| 1999 | -C "Deserializing connection..." \ |
| 2000 | -s "Deserializing connection..." |
| 2001 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2002 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2003 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2004 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2005 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2006 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2007 | 0 \ |
| 2008 | -c "Deserializing connection..." \ |
| 2009 | -s "Deserializing connection..." |
| 2010 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2011 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2012 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2013 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 2014 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2015 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2016 | 0 \ |
| 2017 | -c "Deserializing connection..." \ |
| 2018 | -s "Deserializing connection..." |
| 2019 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2020 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2021 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2022 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 2023 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2024 | "$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] | 2025 | 0 \ |
| 2026 | -c "Deserializing connection..." \ |
| 2027 | -s "Deserializing connection..." |
| 2028 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2029 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2030 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2031 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2032 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 2033 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2034 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2035 | 0 \ |
| 2036 | -c "Deserializing connection..." \ |
| 2037 | -s "Deserializing connection..." |
| 2038 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2039 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 2040 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2041 | run_test "Saving the serialized context to a file" \ |
| 2042 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 2043 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 2044 | 0 \ |
| 2045 | -s "Save serialized context to a file... ok" \ |
| 2046 | -c "Save serialized context to a file... ok" |
| 2047 | rm -f context_srv.txt |
| 2048 | rm -f context_cli.txt |
| 2049 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2050 | # Tests for DTLS Connection ID extension |
| 2051 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2052 | # So far, the CID API isn't implemented, so we can't |
| 2053 | # grep for output witnessing its use. This needs to be |
| 2054 | # changed once the CID extension is implemented. |
| 2055 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2056 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2057 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2058 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2059 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 2060 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2061 | 0 \ |
| 2062 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2063 | -s "found CID extension" \ |
| 2064 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2065 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2066 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2067 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2068 | -C "found CID extension" \ |
| 2069 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2070 | -C "Copy CIDs into SSL transform" \ |
| 2071 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2072 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2073 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2074 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2075 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2076 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2077 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 2078 | 0 \ |
| 2079 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2080 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2081 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2082 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2083 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2084 | -C "found CID extension" \ |
| 2085 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2086 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 2087 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2088 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2089 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2090 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2091 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2092 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2093 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 2094 | 0 \ |
| 2095 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2096 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2097 | -c "client hello, adding CID extension" \ |
| 2098 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2099 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2100 | -s "server hello, adding CID extension" \ |
| 2101 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2102 | -c "Use of CID extension negotiated" \ |
| 2103 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2104 | -c "Copy CIDs into SSL transform" \ |
| 2105 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2106 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2107 | -s "Use of Connection ID has been negotiated" \ |
| 2108 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2109 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2110 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2111 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2112 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2113 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2114 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 2115 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 2116 | 0 \ |
| 2117 | -c "Enable use of CID extension." \ |
| 2118 | -s "Enable use of CID extension." \ |
| 2119 | -c "client hello, adding CID extension" \ |
| 2120 | -s "found CID extension" \ |
| 2121 | -s "Use of CID extension negotiated" \ |
| 2122 | -s "server hello, adding CID extension" \ |
| 2123 | -c "found CID extension" \ |
| 2124 | -c "Use of CID extension negotiated" \ |
| 2125 | -s "Copy CIDs into SSL transform" \ |
| 2126 | -c "Copy CIDs into SSL transform" \ |
| 2127 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2128 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2129 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2130 | -c "Use of Connection ID has been negotiated" \ |
| 2131 | -c "ignoring unexpected CID" \ |
| 2132 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2133 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2134 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2135 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2136 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 2137 | -p "$P_PXY mtu=800" \ |
| 2138 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2139 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2140 | 0 \ |
| 2141 | -c "Enable use of CID extension." \ |
| 2142 | -s "Enable use of CID extension." \ |
| 2143 | -c "client hello, adding CID extension" \ |
| 2144 | -s "found CID extension" \ |
| 2145 | -s "Use of CID extension negotiated" \ |
| 2146 | -s "server hello, adding CID extension" \ |
| 2147 | -c "found CID extension" \ |
| 2148 | -c "Use of CID extension negotiated" \ |
| 2149 | -s "Copy CIDs into SSL transform" \ |
| 2150 | -c "Copy CIDs into SSL transform" \ |
| 2151 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2152 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2153 | -s "Use of Connection ID has been negotiated" \ |
| 2154 | -c "Use of Connection ID has been negotiated" |
| 2155 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2156 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2157 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2158 | 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] | 2159 | -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] | 2160 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2161 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2162 | 0 \ |
| 2163 | -c "Enable use of CID extension." \ |
| 2164 | -s "Enable use of CID extension." \ |
| 2165 | -c "client hello, adding CID extension" \ |
| 2166 | -s "found CID extension" \ |
| 2167 | -s "Use of CID extension negotiated" \ |
| 2168 | -s "server hello, adding CID extension" \ |
| 2169 | -c "found CID extension" \ |
| 2170 | -c "Use of CID extension negotiated" \ |
| 2171 | -s "Copy CIDs into SSL transform" \ |
| 2172 | -c "Copy CIDs into SSL transform" \ |
| 2173 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2174 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2175 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2176 | -c "Use of Connection ID has been negotiated" \ |
| 2177 | -c "ignoring unexpected CID" \ |
| 2178 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2179 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2180 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2181 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2182 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2183 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2184 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2185 | 0 \ |
| 2186 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2187 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2188 | -c "client hello, adding CID extension" \ |
| 2189 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2190 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2191 | -s "server hello, adding CID extension" \ |
| 2192 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2193 | -c "Use of CID extension negotiated" \ |
| 2194 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2195 | -c "Copy CIDs into SSL transform" \ |
| 2196 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2197 | -s "Peer CID (length 0 Bytes):" \ |
| 2198 | -s "Use of Connection ID has been negotiated" \ |
| 2199 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2200 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2201 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2202 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2203 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2204 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2205 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2206 | 0 \ |
| 2207 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2208 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2209 | -c "client hello, adding CID extension" \ |
| 2210 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2211 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2212 | -s "server hello, adding CID extension" \ |
| 2213 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2214 | -c "Use of CID extension negotiated" \ |
| 2215 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2216 | -c "Copy CIDs into SSL transform" \ |
| 2217 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2218 | -c "Peer CID (length 0 Bytes):" \ |
| 2219 | -s "Use of Connection ID has been negotiated" \ |
| 2220 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2221 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2222 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2223 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2224 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2225 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2226 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2227 | 0 \ |
| 2228 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2229 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2230 | -c "client hello, adding CID extension" \ |
| 2231 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2232 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2233 | -s "server hello, adding CID extension" \ |
| 2234 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2235 | -c "Use of CID extension negotiated" \ |
| 2236 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2237 | -c "Copy CIDs into SSL transform" \ |
| 2238 | -S "Use of Connection ID has been negotiated" \ |
| 2239 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2240 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2241 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2242 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2243 | 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] | 2244 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2245 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2246 | 0 \ |
| 2247 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2248 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2249 | -c "client hello, adding CID extension" \ |
| 2250 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2251 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2252 | -s "server hello, adding CID extension" \ |
| 2253 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2254 | -c "Use of CID extension negotiated" \ |
| 2255 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2256 | -c "Copy CIDs into SSL transform" \ |
| 2257 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2258 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2259 | -s "Use of Connection ID has been negotiated" \ |
| 2260 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2261 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2262 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2263 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2264 | 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] | 2265 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2266 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2267 | 0 \ |
| 2268 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2269 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2270 | -c "client hello, adding CID extension" \ |
| 2271 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2272 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2273 | -s "server hello, adding CID extension" \ |
| 2274 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2275 | -c "Use of CID extension negotiated" \ |
| 2276 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2277 | -c "Copy CIDs into SSL transform" \ |
| 2278 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2279 | -s "Peer CID (length 0 Bytes):" \ |
| 2280 | -s "Use of Connection ID has been negotiated" \ |
| 2281 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2282 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2283 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2284 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2285 | 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] | 2286 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2287 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2288 | 0 \ |
| 2289 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2290 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2291 | -c "client hello, adding CID extension" \ |
| 2292 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2293 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2294 | -s "server hello, adding CID extension" \ |
| 2295 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2296 | -c "Use of CID extension negotiated" \ |
| 2297 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2298 | -c "Copy CIDs into SSL transform" \ |
| 2299 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2300 | -c "Peer CID (length 0 Bytes):" \ |
| 2301 | -s "Use of Connection ID has been negotiated" \ |
| 2302 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2303 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2304 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2305 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2306 | 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] | 2307 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2308 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2309 | 0 \ |
| 2310 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2311 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2312 | -c "client hello, adding CID extension" \ |
| 2313 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2314 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2315 | -s "server hello, adding CID extension" \ |
| 2316 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2317 | -c "Use of CID extension negotiated" \ |
| 2318 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2319 | -c "Copy CIDs into SSL transform" \ |
| 2320 | -S "Use of Connection ID has been negotiated" \ |
| 2321 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2322 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2323 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
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 | 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] | 2326 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2327 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2328 | 0 \ |
| 2329 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2330 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2331 | -c "client hello, adding CID extension" \ |
| 2332 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2333 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2334 | -s "server hello, adding CID extension" \ |
| 2335 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2336 | -c "Use of CID extension negotiated" \ |
| 2337 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2338 | -c "Copy CIDs into SSL transform" \ |
| 2339 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2340 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2341 | -s "Use of Connection ID has been negotiated" \ |
| 2342 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2343 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2344 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2345 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2346 | 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] | 2347 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2348 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2349 | 0 \ |
| 2350 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2351 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2352 | -c "client hello, adding CID extension" \ |
| 2353 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2354 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2355 | -s "server hello, adding CID extension" \ |
| 2356 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2357 | -c "Use of CID extension negotiated" \ |
| 2358 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2359 | -c "Copy CIDs into SSL transform" \ |
| 2360 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2361 | -s "Peer CID (length 0 Bytes):" \ |
| 2362 | -s "Use of Connection ID has been negotiated" \ |
| 2363 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2364 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2365 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2366 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2367 | 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] | 2368 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2369 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2370 | 0 \ |
| 2371 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2372 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2373 | -c "client hello, adding CID extension" \ |
| 2374 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2375 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2376 | -s "server hello, adding CID extension" \ |
| 2377 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2378 | -c "Use of CID extension negotiated" \ |
| 2379 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2380 | -c "Copy CIDs into SSL transform" \ |
| 2381 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2382 | -c "Peer CID (length 0 Bytes):" \ |
| 2383 | -s "Use of Connection ID has been negotiated" \ |
| 2384 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2385 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2386 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2387 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2388 | 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] | 2389 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2390 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2391 | 0 \ |
| 2392 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2393 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2394 | -c "client hello, adding CID extension" \ |
| 2395 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2396 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2397 | -s "server hello, adding CID extension" \ |
| 2398 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2399 | -c "Use of CID extension negotiated" \ |
| 2400 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2401 | -c "Copy CIDs into SSL transform" \ |
| 2402 | -S "Use of Connection ID has been negotiated" \ |
| 2403 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2404 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2405 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2406 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 2407 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2408 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2409 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2410 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2411 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2412 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2413 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2414 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2415 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2416 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2417 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2418 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2419 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2420 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2421 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2422 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2423 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2424 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2425 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2426 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2427 | 0 \ |
| 2428 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2429 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2430 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2431 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2432 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2433 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2434 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2435 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2436 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2437 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2438 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2439 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2440 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 2441 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2442 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2443 | 0 \ |
| 2444 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2445 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2446 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2447 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2448 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2449 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2450 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2451 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2452 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2453 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2454 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2455 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2456 | 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] | 2457 | -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] | 2458 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2459 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2460 | 0 \ |
| 2461 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2462 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2463 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2464 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2465 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2466 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2467 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2468 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2469 | -c "ignoring unexpected CID" \ |
| 2470 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2471 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2472 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2473 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2474 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2475 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2476 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2477 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2478 | 0 \ |
| 2479 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2480 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2481 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2482 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2483 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2484 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2485 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2486 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2487 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2488 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2489 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2490 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2491 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 2492 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2493 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2494 | 0 \ |
| 2495 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2496 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2497 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2498 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2499 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2500 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2501 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2502 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2503 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2504 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2505 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2506 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2507 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2508 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2509 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2510 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2511 | 0 \ |
| 2512 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2513 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2514 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2515 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2516 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2517 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2518 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2519 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2520 | -c "ignoring unexpected CID" \ |
| 2521 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2522 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2523 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2524 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2525 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2526 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2527 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2528 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2529 | 0 \ |
| 2530 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2531 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2532 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2533 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2534 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2535 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2536 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2537 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2538 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2539 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2540 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 2541 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2542 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2543 | 0 \ |
| 2544 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2545 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2546 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2547 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2548 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2549 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2550 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2551 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2552 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2553 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2554 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2555 | -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] | 2556 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2557 | "$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" \ |
| 2558 | 0 \ |
| 2559 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2560 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2561 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2562 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2563 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2564 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2565 | -c "ignoring unexpected CID" \ |
| 2566 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2567 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2568 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2569 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2570 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2571 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2572 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2573 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2574 | 0 \ |
| 2575 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2576 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2577 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2578 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2579 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2580 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2581 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2582 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2583 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 2584 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2585 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2586 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2587 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2588 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2589 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2590 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2591 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2592 | 0 \ |
| 2593 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2594 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2595 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2596 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2597 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2598 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2599 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2600 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2601 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2602 | -c "ignoring unexpected CID" \ |
| 2603 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2604 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2605 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2606 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2607 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2608 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 2609 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2610 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2611 | 0 \ |
| 2612 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2613 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2614 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2615 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2616 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2617 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2618 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2619 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2620 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2621 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2622 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2623 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2624 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2625 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2626 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2627 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2628 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2629 | 0 \ |
| 2630 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2631 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2632 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2633 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2634 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2635 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2636 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2637 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2638 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2639 | -c "ignoring unexpected CID" \ |
| 2640 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2641 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 2642 | # 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] | 2643 | # tests check that the buffer contents are reallocated when the message is |
| 2644 | # larger than the buffer. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2645 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2646 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2647 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2648 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2649 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 2650 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2651 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 2652 | 0 \ |
| 2653 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2654 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2655 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2656 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2657 | -s "Reallocating in_buf" \ |
| 2658 | -s "Reallocating out_buf" |
| 2659 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2660 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2661 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2662 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2663 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2664 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 2665 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2666 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 2667 | 0 \ |
| 2668 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2669 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2670 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2671 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2672 | -s "Reallocating in_buf" \ |
| 2673 | -s "Reallocating out_buf" |
| 2674 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2675 | # Tests for Encrypt-then-MAC extension |
| 2676 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2677 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2678 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2679 | "$P_SRV debug_level=3 \ |
| 2680 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2681 | "$P_CLI debug_level=3" \ |
| 2682 | 0 \ |
| 2683 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2684 | -s "found encrypt then mac extension" \ |
| 2685 | -s "server hello, adding encrypt then mac extension" \ |
| 2686 | -c "found encrypt_then_mac extension" \ |
| 2687 | -c "using encrypt then mac" \ |
| 2688 | -s "using encrypt then mac" |
| 2689 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2690 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2691 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2692 | "$P_SRV debug_level=3 etm=0 \ |
| 2693 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2694 | "$P_CLI debug_level=3 etm=1" \ |
| 2695 | 0 \ |
| 2696 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2697 | -s "found encrypt then mac extension" \ |
| 2698 | -S "server hello, adding encrypt then mac extension" \ |
| 2699 | -C "found encrypt_then_mac extension" \ |
| 2700 | -C "using encrypt then mac" \ |
| 2701 | -S "using encrypt then mac" |
| 2702 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2703 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2704 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 2705 | "$P_SRV debug_level=3 etm=1 \ |
| 2706 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 2707 | "$P_CLI debug_level=3 etm=1" \ |
| 2708 | 0 \ |
| 2709 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2710 | -s "found encrypt then mac extension" \ |
| 2711 | -S "server hello, adding encrypt then mac extension" \ |
| 2712 | -C "found encrypt_then_mac extension" \ |
| 2713 | -C "using encrypt then mac" \ |
| 2714 | -S "using encrypt then mac" |
| 2715 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2716 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2717 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2718 | "$P_SRV debug_level=3 etm=1 \ |
| 2719 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2720 | "$P_CLI debug_level=3 etm=0" \ |
| 2721 | 0 \ |
| 2722 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2723 | -S "found encrypt then mac extension" \ |
| 2724 | -S "server hello, adding encrypt then mac extension" \ |
| 2725 | -C "found encrypt_then_mac extension" \ |
| 2726 | -C "using encrypt then mac" \ |
| 2727 | -S "using encrypt then mac" |
| 2728 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2729 | # Tests for Extended Master Secret extension |
| 2730 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2731 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame^] | 2732 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2733 | run_test "Extended Master Secret: default" \ |
| 2734 | "$P_SRV debug_level=3" \ |
| 2735 | "$P_CLI debug_level=3" \ |
| 2736 | 0 \ |
| 2737 | -c "client hello, adding extended_master_secret extension" \ |
| 2738 | -s "found extended master secret extension" \ |
| 2739 | -s "server hello, adding extended master secret extension" \ |
| 2740 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2741 | -c "session hash for extended master secret" \ |
| 2742 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2743 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2744 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame^] | 2745 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2746 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 2747 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 2748 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 2749 | 0 \ |
| 2750 | -c "client hello, adding extended_master_secret extension" \ |
| 2751 | -s "found extended master secret extension" \ |
| 2752 | -S "server hello, adding extended master secret extension" \ |
| 2753 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2754 | -C "session hash for extended master secret" \ |
| 2755 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2756 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2757 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame^] | 2758 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2759 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 2760 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 2761 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 2762 | 0 \ |
| 2763 | -C "client hello, adding extended_master_secret extension" \ |
| 2764 | -S "found extended master secret extension" \ |
| 2765 | -S "server hello, adding extended master secret extension" \ |
| 2766 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2767 | -C "session hash for extended master secret" \ |
| 2768 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2769 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2770 | # Test sending and receiving empty application data records |
| 2771 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2772 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2773 | run_test "Encrypt then MAC: empty application data record" \ |
| 2774 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 2775 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 2776 | 0 \ |
| 2777 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2778 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2779 | -c "0 bytes written in 1 fragments" |
| 2780 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2781 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2782 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2783 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 2784 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 2785 | 0 \ |
| 2786 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2787 | -c "0 bytes written in 1 fragments" |
| 2788 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2789 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2790 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 2791 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 2792 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 2793 | 0 \ |
| 2794 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2795 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2796 | -c "0 bytes written in 1 fragments" |
| 2797 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2798 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2799 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2800 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 2801 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 2802 | 0 \ |
| 2803 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2804 | -c "0 bytes written in 1 fragments" |
| 2805 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2806 | # Tests for CBC 1/n-1 record splitting |
| 2807 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2808 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2809 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 2810 | "$P_SRV" \ |
| 2811 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 2812 | request_size=123 force_version=tls12" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2813 | 0 \ |
| 2814 | -s "Read from client: 123 bytes read" \ |
| 2815 | -S "Read from client: 1 bytes read" \ |
| 2816 | -S "122 bytes read" |
| 2817 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2818 | # Tests for Session Tickets |
| 2819 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2820 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2821 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2822 | "$P_SRV debug_level=3 tickets=1" \ |
| 2823 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2824 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2825 | -c "client hello, adding session ticket extension" \ |
| 2826 | -s "found session ticket extension" \ |
| 2827 | -s "server hello, adding session ticket extension" \ |
| 2828 | -c "found session_ticket extension" \ |
| 2829 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2830 | -S "session successfully restored from cache" \ |
| 2831 | -s "session successfully restored from ticket" \ |
| 2832 | -s "a session has been resumed" \ |
| 2833 | -c "a session has been resumed" |
| 2834 | |
Jerry Yu | baa4934 | 2022-02-15 10:26:40 +0800 | [diff] [blame] | 2835 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 2836 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 2837 | run_test "Session resume using tickets: manual rotation" \ |
| 2838 | "$P_SRV debug_level=3 tickets=1 ticket_rotate=1" \ |
| 2839 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2840 | 0 \ |
| 2841 | -c "client hello, adding session ticket extension" \ |
| 2842 | -s "found session ticket extension" \ |
| 2843 | -s "server hello, adding session ticket extension" \ |
| 2844 | -c "found session_ticket extension" \ |
| 2845 | -c "parse new session ticket" \ |
| 2846 | -S "session successfully restored from cache" \ |
| 2847 | -s "session successfully restored from ticket" \ |
| 2848 | -s "a session has been resumed" \ |
| 2849 | -c "a session has been resumed" |
| 2850 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2851 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2852 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2853 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2854 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2855 | 0 \ |
| 2856 | -c "client hello, adding session ticket extension" \ |
| 2857 | -s "found session ticket extension" \ |
| 2858 | -s "server hello, adding session ticket extension" \ |
| 2859 | -c "found session_ticket extension" \ |
| 2860 | -c "parse new session ticket" \ |
| 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 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2866 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2867 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2868 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2869 | "$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] | 2870 | 0 \ |
| 2871 | -c "client hello, adding session ticket extension" \ |
| 2872 | -s "found session ticket extension" \ |
| 2873 | -s "server hello, adding session ticket extension" \ |
| 2874 | -c "found session_ticket extension" \ |
| 2875 | -c "parse new session ticket" \ |
| 2876 | -S "session successfully restored from cache" \ |
| 2877 | -S "session successfully restored from ticket" \ |
| 2878 | -S "a session has been resumed" \ |
| 2879 | -C "a session has been resumed" |
| 2880 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2881 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2882 | run_test "Session resume using tickets: session copy" \ |
| 2883 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2884 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 2885 | 0 \ |
| 2886 | -c "client hello, adding session ticket extension" \ |
| 2887 | -s "found session ticket extension" \ |
| 2888 | -s "server hello, adding session ticket extension" \ |
| 2889 | -c "found session_ticket extension" \ |
| 2890 | -c "parse new session ticket" \ |
| 2891 | -S "session successfully restored from cache" \ |
| 2892 | -s "session successfully restored from ticket" \ |
| 2893 | -s "a session has been resumed" \ |
| 2894 | -c "a session has been resumed" |
| 2895 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2896 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2897 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2898 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2899 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2900 | 0 \ |
| 2901 | -c "client hello, adding session ticket extension" \ |
| 2902 | -c "found session_ticket extension" \ |
| 2903 | -c "parse new session ticket" \ |
| 2904 | -c "a session has been resumed" |
| 2905 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2906 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2907 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2908 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2909 | "( $O_CLI -sess_out $SESSION; \ |
| 2910 | $O_CLI -sess_in $SESSION; \ |
| 2911 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2912 | 0 \ |
| 2913 | -s "found session ticket extension" \ |
| 2914 | -s "server hello, adding session ticket extension" \ |
| 2915 | -S "session successfully restored from cache" \ |
| 2916 | -s "session successfully restored from ticket" \ |
| 2917 | -s "a session has been resumed" |
| 2918 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2919 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 2920 | run_test "Session resume using tickets: AES-128-GCM" \ |
| 2921 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-GCM" \ |
| 2922 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2923 | 0 \ |
| 2924 | -c "client hello, adding session ticket extension" \ |
| 2925 | -s "found session ticket extension" \ |
| 2926 | -s "server hello, adding session ticket extension" \ |
| 2927 | -c "found session_ticket extension" \ |
| 2928 | -c "parse new session ticket" \ |
| 2929 | -S "session successfully restored from cache" \ |
| 2930 | -s "session successfully restored from ticket" \ |
| 2931 | -s "a session has been resumed" \ |
| 2932 | -c "a session has been resumed" |
| 2933 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2934 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 2935 | run_test "Session resume using tickets: AES-192-GCM" \ |
| 2936 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-GCM" \ |
| 2937 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2938 | 0 \ |
| 2939 | -c "client hello, adding session ticket extension" \ |
| 2940 | -s "found session ticket extension" \ |
| 2941 | -s "server hello, adding session ticket extension" \ |
| 2942 | -c "found session_ticket extension" \ |
| 2943 | -c "parse new session ticket" \ |
| 2944 | -S "session successfully restored from cache" \ |
| 2945 | -s "session successfully restored from ticket" \ |
| 2946 | -s "a session has been resumed" \ |
| 2947 | -c "a session has been resumed" |
| 2948 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2949 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 2950 | run_test "Session resume using tickets: AES-128-CCM" \ |
| 2951 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-CCM" \ |
| 2952 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2953 | 0 \ |
| 2954 | -c "client hello, adding session ticket extension" \ |
| 2955 | -s "found session ticket extension" \ |
| 2956 | -s "server hello, adding session ticket extension" \ |
| 2957 | -c "found session_ticket extension" \ |
| 2958 | -c "parse new session ticket" \ |
| 2959 | -S "session successfully restored from cache" \ |
| 2960 | -s "session successfully restored from ticket" \ |
| 2961 | -s "a session has been resumed" \ |
| 2962 | -c "a session has been resumed" |
| 2963 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2964 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 2965 | run_test "Session resume using tickets: AES-192-CCM" \ |
| 2966 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-CCM" \ |
| 2967 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2968 | 0 \ |
| 2969 | -c "client hello, adding session ticket extension" \ |
| 2970 | -s "found session ticket extension" \ |
| 2971 | -s "server hello, adding session ticket extension" \ |
| 2972 | -c "found session_ticket extension" \ |
| 2973 | -c "parse new session ticket" \ |
| 2974 | -S "session successfully restored from cache" \ |
| 2975 | -s "session successfully restored from ticket" \ |
| 2976 | -s "a session has been resumed" \ |
| 2977 | -c "a session has been resumed" |
| 2978 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2979 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 2980 | run_test "Session resume using tickets: AES-256-CCM" \ |
| 2981 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-256-CCM" \ |
| 2982 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2983 | 0 \ |
| 2984 | -c "client hello, adding session ticket extension" \ |
| 2985 | -s "found session ticket extension" \ |
| 2986 | -s "server hello, adding session ticket extension" \ |
| 2987 | -c "found session_ticket extension" \ |
| 2988 | -c "parse new session ticket" \ |
| 2989 | -S "session successfully restored from cache" \ |
| 2990 | -s "session successfully restored from ticket" \ |
| 2991 | -s "a session has been resumed" \ |
| 2992 | -c "a session has been resumed" |
| 2993 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2994 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 2995 | run_test "Session resume using tickets: CAMELLIA-128-CCM" \ |
| 2996 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-128-CCM" \ |
| 2997 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2998 | 0 \ |
| 2999 | -c "client hello, adding session ticket extension" \ |
| 3000 | -s "found session ticket extension" \ |
| 3001 | -s "server hello, adding session ticket extension" \ |
| 3002 | -c "found session_ticket extension" \ |
| 3003 | -c "parse new session ticket" \ |
| 3004 | -S "session successfully restored from cache" \ |
| 3005 | -s "session successfully restored from ticket" \ |
| 3006 | -s "a session has been resumed" \ |
| 3007 | -c "a session has been resumed" |
| 3008 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3009 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3010 | run_test "Session resume using tickets: CAMELLIA-192-CCM" \ |
| 3011 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-192-CCM" \ |
| 3012 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3013 | 0 \ |
| 3014 | -c "client hello, adding session ticket extension" \ |
| 3015 | -s "found session ticket extension" \ |
| 3016 | -s "server hello, adding session ticket extension" \ |
| 3017 | -c "found session_ticket extension" \ |
| 3018 | -c "parse new session ticket" \ |
| 3019 | -S "session successfully restored from cache" \ |
| 3020 | -s "session successfully restored from ticket" \ |
| 3021 | -s "a session has been resumed" \ |
| 3022 | -c "a session has been resumed" |
| 3023 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3024 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3025 | run_test "Session resume using tickets: CAMELLIA-256-CCM" \ |
| 3026 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-256-CCM" \ |
| 3027 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3028 | 0 \ |
| 3029 | -c "client hello, adding session ticket extension" \ |
| 3030 | -s "found session ticket extension" \ |
| 3031 | -s "server hello, adding session ticket extension" \ |
| 3032 | -c "found session_ticket extension" \ |
| 3033 | -c "parse new session ticket" \ |
| 3034 | -S "session successfully restored from cache" \ |
| 3035 | -s "session successfully restored from ticket" \ |
| 3036 | -s "a session has been resumed" \ |
| 3037 | -c "a session has been resumed" |
| 3038 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3039 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3040 | run_test "Session resume using tickets: ARIA-128-GCM" \ |
| 3041 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-GCM" \ |
| 3042 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3043 | 0 \ |
| 3044 | -c "client hello, adding session ticket extension" \ |
| 3045 | -s "found session ticket extension" \ |
| 3046 | -s "server hello, adding session ticket extension" \ |
| 3047 | -c "found session_ticket extension" \ |
| 3048 | -c "parse new session ticket" \ |
| 3049 | -S "session successfully restored from cache" \ |
| 3050 | -s "session successfully restored from ticket" \ |
| 3051 | -s "a session has been resumed" \ |
| 3052 | -c "a session has been resumed" |
| 3053 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3054 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3055 | run_test "Session resume using tickets: ARIA-192-GCM" \ |
| 3056 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-GCM" \ |
| 3057 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3058 | 0 \ |
| 3059 | -c "client hello, adding session ticket extension" \ |
| 3060 | -s "found session ticket extension" \ |
| 3061 | -s "server hello, adding session ticket extension" \ |
| 3062 | -c "found session_ticket extension" \ |
| 3063 | -c "parse new session ticket" \ |
| 3064 | -S "session successfully restored from cache" \ |
| 3065 | -s "session successfully restored from ticket" \ |
| 3066 | -s "a session has been resumed" \ |
| 3067 | -c "a session has been resumed" |
| 3068 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3069 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3070 | run_test "Session resume using tickets: ARIA-256-GCM" \ |
| 3071 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-GCM" \ |
| 3072 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3073 | 0 \ |
| 3074 | -c "client hello, adding session ticket extension" \ |
| 3075 | -s "found session ticket extension" \ |
| 3076 | -s "server hello, adding session ticket extension" \ |
| 3077 | -c "found session_ticket extension" \ |
| 3078 | -c "parse new session ticket" \ |
| 3079 | -S "session successfully restored from cache" \ |
| 3080 | -s "session successfully restored from ticket" \ |
| 3081 | -s "a session has been resumed" \ |
| 3082 | -c "a session has been resumed" |
| 3083 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3084 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3085 | run_test "Session resume using tickets: ARIA-128-CCM" \ |
| 3086 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-CCM" \ |
| 3087 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3088 | 0 \ |
| 3089 | -c "client hello, adding session ticket extension" \ |
| 3090 | -s "found session ticket extension" \ |
| 3091 | -s "server hello, adding session ticket extension" \ |
| 3092 | -c "found session_ticket extension" \ |
| 3093 | -c "parse new session ticket" \ |
| 3094 | -S "session successfully restored from cache" \ |
| 3095 | -s "session successfully restored from ticket" \ |
| 3096 | -s "a session has been resumed" \ |
| 3097 | -c "a session has been resumed" |
| 3098 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3099 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3100 | run_test "Session resume using tickets: ARIA-192-CCM" \ |
| 3101 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-CCM" \ |
| 3102 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3103 | 0 \ |
| 3104 | -c "client hello, adding session ticket extension" \ |
| 3105 | -s "found session ticket extension" \ |
| 3106 | -s "server hello, adding session ticket extension" \ |
| 3107 | -c "found session_ticket extension" \ |
| 3108 | -c "parse new session ticket" \ |
| 3109 | -S "session successfully restored from cache" \ |
| 3110 | -s "session successfully restored from ticket" \ |
| 3111 | -s "a session has been resumed" \ |
| 3112 | -c "a session has been resumed" |
| 3113 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3114 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3115 | run_test "Session resume using tickets: ARIA-256-CCM" \ |
| 3116 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-CCM" \ |
| 3117 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3118 | 0 \ |
| 3119 | -c "client hello, adding session ticket extension" \ |
| 3120 | -s "found session ticket extension" \ |
| 3121 | -s "server hello, adding session ticket extension" \ |
| 3122 | -c "found session_ticket extension" \ |
| 3123 | -c "parse new session ticket" \ |
| 3124 | -S "session successfully restored from cache" \ |
| 3125 | -s "session successfully restored from ticket" \ |
| 3126 | -s "a session has been resumed" \ |
| 3127 | -c "a session has been resumed" |
| 3128 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3129 | # Tests for Session Tickets with DTLS |
| 3130 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3131 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3132 | run_test "Session resume using tickets, DTLS: basic" \ |
| 3133 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3134 | "$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] | 3135 | 0 \ |
| 3136 | -c "client hello, adding session ticket extension" \ |
| 3137 | -s "found session ticket extension" \ |
| 3138 | -s "server hello, adding session ticket extension" \ |
| 3139 | -c "found session_ticket extension" \ |
| 3140 | -c "parse new session ticket" \ |
| 3141 | -S "session successfully restored from cache" \ |
| 3142 | -s "session successfully restored from ticket" \ |
| 3143 | -s "a session has been resumed" \ |
| 3144 | -c "a session has been resumed" |
| 3145 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3146 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3147 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 3148 | "$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] | 3149 | "$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] | 3150 | 0 \ |
| 3151 | -c "client hello, adding session ticket extension" \ |
| 3152 | -s "found session ticket extension" \ |
| 3153 | -s "server hello, adding session ticket extension" \ |
| 3154 | -c "found session_ticket extension" \ |
| 3155 | -c "parse new session ticket" \ |
| 3156 | -S "session successfully restored from cache" \ |
| 3157 | -s "session successfully restored from ticket" \ |
| 3158 | -s "a session has been resumed" \ |
| 3159 | -c "a session has been resumed" |
| 3160 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3161 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3162 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 3163 | "$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] | 3164 | "$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] | 3165 | 0 \ |
| 3166 | -c "client hello, adding session ticket extension" \ |
| 3167 | -s "found session ticket extension" \ |
| 3168 | -s "server hello, adding session ticket extension" \ |
| 3169 | -c "found session_ticket extension" \ |
| 3170 | -c "parse new session ticket" \ |
| 3171 | -S "session successfully restored from cache" \ |
| 3172 | -S "session successfully restored from ticket" \ |
| 3173 | -S "a session has been resumed" \ |
| 3174 | -C "a session has been resumed" |
| 3175 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3176 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3177 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 3178 | "$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] | 3179 | "$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] | 3180 | 0 \ |
| 3181 | -c "client hello, adding session ticket extension" \ |
| 3182 | -s "found session ticket extension" \ |
| 3183 | -s "server hello, adding session ticket extension" \ |
| 3184 | -c "found session_ticket extension" \ |
| 3185 | -c "parse new session ticket" \ |
| 3186 | -S "session successfully restored from cache" \ |
| 3187 | -s "session successfully restored from ticket" \ |
| 3188 | -s "a session has been resumed" \ |
| 3189 | -c "a session has been resumed" |
| 3190 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3191 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3192 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 3193 | "$O_SRV -dtls" \ |
| 3194 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 3195 | 0 \ |
| 3196 | -c "client hello, adding session ticket extension" \ |
| 3197 | -c "found session_ticket extension" \ |
| 3198 | -c "parse new session ticket" \ |
| 3199 | -c "a session has been resumed" |
| 3200 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3201 | # 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] | 3202 | # 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] | 3203 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3204 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3205 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 3206 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3207 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 3208 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3209 | rm -f $SESSION )" \ |
| 3210 | 0 \ |
| 3211 | -s "found session ticket extension" \ |
| 3212 | -s "server hello, adding session ticket extension" \ |
| 3213 | -S "session successfully restored from cache" \ |
| 3214 | -s "session successfully restored from ticket" \ |
| 3215 | -s "a session has been resumed" |
| 3216 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3217 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3218 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3219 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame^] | 3220 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3221 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3222 | "$P_SRV debug_level=3 tickets=0" \ |
| 3223 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3224 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3225 | -c "client hello, adding session ticket extension" \ |
| 3226 | -s "found session ticket extension" \ |
| 3227 | -S "server hello, adding session ticket extension" \ |
| 3228 | -C "found session_ticket extension" \ |
| 3229 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3230 | -s "session successfully restored from cache" \ |
| 3231 | -S "session successfully restored from ticket" \ |
| 3232 | -s "a session has been resumed" \ |
| 3233 | -c "a session has been resumed" |
| 3234 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3235 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame^] | 3236 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3237 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3238 | "$P_SRV debug_level=3 tickets=1" \ |
| 3239 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3240 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3241 | -C "client hello, adding session ticket extension" \ |
| 3242 | -S "found session ticket extension" \ |
| 3243 | -S "server hello, adding session ticket extension" \ |
| 3244 | -C "found session_ticket extension" \ |
| 3245 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3246 | -s "session successfully restored from cache" \ |
| 3247 | -S "session successfully restored from ticket" \ |
| 3248 | -s "a session has been resumed" \ |
| 3249 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3250 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3251 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame^] | 3252 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3253 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3254 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 3255 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3256 | 0 \ |
| 3257 | -S "session successfully restored from cache" \ |
| 3258 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3259 | -S "a session has been resumed" \ |
| 3260 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3261 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3262 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame^] | 3263 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3264 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3265 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 3266 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3267 | 0 \ |
| 3268 | -s "session successfully restored from cache" \ |
| 3269 | -S "session successfully restored from ticket" \ |
| 3270 | -s "a session has been resumed" \ |
| 3271 | -c "a session has been resumed" |
| 3272 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3273 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame^] | 3274 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 3275 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3276 | "$P_SRV debug_level=3 tickets=0" \ |
| 3277 | "$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] | 3278 | 0 \ |
| 3279 | -s "session successfully restored from cache" \ |
| 3280 | -S "session successfully restored from ticket" \ |
| 3281 | -s "a session has been resumed" \ |
| 3282 | -c "a session has been resumed" |
| 3283 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3284 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame^] | 3285 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3286 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3287 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 3288 | "$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] | 3289 | 0 \ |
| 3290 | -S "session successfully restored from cache" \ |
| 3291 | -S "session successfully restored from ticket" \ |
| 3292 | -S "a session has been resumed" \ |
| 3293 | -C "a session has been resumed" |
| 3294 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3295 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame^] | 3296 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3297 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3298 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 3299 | "$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] | 3300 | 0 \ |
| 3301 | -s "session successfully restored from cache" \ |
| 3302 | -S "session successfully restored from ticket" \ |
| 3303 | -s "a session has been resumed" \ |
| 3304 | -c "a session has been resumed" |
| 3305 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3306 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame^] | 3307 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3308 | run_test "Session resume using cache: session copy" \ |
| 3309 | "$P_SRV debug_level=3 tickets=0" \ |
| 3310 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 3311 | 0 \ |
| 3312 | -s "session successfully restored from cache" \ |
| 3313 | -S "session successfully restored from ticket" \ |
| 3314 | -s "a session has been resumed" \ |
| 3315 | -c "a session has been resumed" |
| 3316 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3317 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame^] | 3318 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3319 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3320 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3321 | "( $O_CLI -sess_out $SESSION; \ |
| 3322 | $O_CLI -sess_in $SESSION; \ |
| 3323 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 3324 | 0 \ |
| 3325 | -s "found session ticket extension" \ |
| 3326 | -S "server hello, adding session ticket extension" \ |
| 3327 | -s "session successfully restored from cache" \ |
| 3328 | -S "session successfully restored from ticket" \ |
| 3329 | -s "a session has been resumed" |
| 3330 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3331 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame^] | 3332 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3333 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 3334 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3335 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 3336 | 0 \ |
| 3337 | -C "found session_ticket extension" \ |
| 3338 | -C "parse new session ticket" \ |
| 3339 | -c "a session has been resumed" |
| 3340 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3341 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 3342 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3343 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame^] | 3344 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3345 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 3346 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3347 | "$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] | 3348 | 0 \ |
| 3349 | -c "client hello, adding session ticket extension" \ |
| 3350 | -s "found session ticket extension" \ |
| 3351 | -S "server hello, adding session ticket extension" \ |
| 3352 | -C "found session_ticket extension" \ |
| 3353 | -C "parse new session ticket" \ |
| 3354 | -s "session successfully restored from cache" \ |
| 3355 | -S "session successfully restored from ticket" \ |
| 3356 | -s "a session has been resumed" \ |
| 3357 | -c "a session has been resumed" |
| 3358 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3359 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame^] | 3360 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3361 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 3362 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3363 | "$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] | 3364 | 0 \ |
| 3365 | -C "client hello, adding session ticket extension" \ |
| 3366 | -S "found session ticket extension" \ |
| 3367 | -S "server hello, adding session ticket extension" \ |
| 3368 | -C "found session_ticket extension" \ |
| 3369 | -C "parse new session ticket" \ |
| 3370 | -s "session successfully restored from cache" \ |
| 3371 | -S "session successfully restored from ticket" \ |
| 3372 | -s "a session has been resumed" \ |
| 3373 | -c "a session has been resumed" |
| 3374 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3375 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame^] | 3376 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3377 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 3378 | "$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] | 3379 | "$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] | 3380 | 0 \ |
| 3381 | -S "session successfully restored from cache" \ |
| 3382 | -S "session successfully restored from ticket" \ |
| 3383 | -S "a session has been resumed" \ |
| 3384 | -C "a session has been resumed" |
| 3385 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3386 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame^] | 3387 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3388 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 3389 | "$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] | 3390 | "$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] | 3391 | 0 \ |
| 3392 | -s "session successfully restored from cache" \ |
| 3393 | -S "session successfully restored from ticket" \ |
| 3394 | -s "a session has been resumed" \ |
| 3395 | -c "a session has been resumed" |
| 3396 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3397 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame^] | 3398 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3399 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 3400 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3401 | "$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] | 3402 | 0 \ |
| 3403 | -s "session successfully restored from cache" \ |
| 3404 | -S "session successfully restored from ticket" \ |
| 3405 | -s "a session has been resumed" \ |
| 3406 | -c "a session has been resumed" |
| 3407 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3408 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame^] | 3409 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3410 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 3411 | "$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] | 3412 | "$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] | 3413 | 0 \ |
| 3414 | -S "session successfully restored from cache" \ |
| 3415 | -S "session successfully restored from ticket" \ |
| 3416 | -S "a session has been resumed" \ |
| 3417 | -C "a session has been resumed" |
| 3418 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3419 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame^] | 3420 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3421 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 3422 | "$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] | 3423 | "$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] | 3424 | 0 \ |
| 3425 | -s "session successfully restored from cache" \ |
| 3426 | -S "session successfully restored from ticket" \ |
| 3427 | -s "a session has been resumed" \ |
| 3428 | -c "a session has been resumed" |
| 3429 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3430 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame^] | 3431 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3432 | run_test "Session resume using cache, DTLS: session copy" \ |
| 3433 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3434 | "$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] | 3435 | 0 \ |
| 3436 | -s "session successfully restored from cache" \ |
| 3437 | -S "session successfully restored from ticket" \ |
| 3438 | -s "a session has been resumed" \ |
| 3439 | -c "a session has been resumed" |
| 3440 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3441 | # 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] | 3442 | # 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] | 3443 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3444 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame^] | 3445 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3446 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 3447 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3448 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 3449 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3450 | rm -f $SESSION )" \ |
| 3451 | 0 \ |
| 3452 | -s "found session ticket extension" \ |
| 3453 | -S "server hello, adding session ticket extension" \ |
| 3454 | -s "session successfully restored from cache" \ |
| 3455 | -S "session successfully restored from ticket" \ |
| 3456 | -s "a session has been resumed" |
| 3457 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3458 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame^] | 3459 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3460 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 3461 | "$O_SRV -dtls" \ |
| 3462 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 3463 | 0 \ |
| 3464 | -C "found session_ticket extension" \ |
| 3465 | -C "parse new session ticket" \ |
| 3466 | -c "a session has been resumed" |
| 3467 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3468 | # Tests for Max Fragment Length extension |
| 3469 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3470 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3471 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3472 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3473 | "$P_SRV debug_level=3" \ |
| 3474 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3475 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3476 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3477 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3478 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3479 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3480 | -C "client hello, adding max_fragment_length extension" \ |
| 3481 | -S "found max fragment length extension" \ |
| 3482 | -S "server hello, max_fragment_length extension" \ |
| 3483 | -C "found max_fragment_length extension" |
| 3484 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3485 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3486 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3487 | run_test "Max fragment length: enabled, default, larger message" \ |
| 3488 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3489 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3490 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3491 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3492 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3493 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3494 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3495 | -C "client hello, adding max_fragment_length extension" \ |
| 3496 | -S "found max fragment length extension" \ |
| 3497 | -S "server hello, max_fragment_length extension" \ |
| 3498 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3499 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3500 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3501 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3502 | |
| 3503 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3504 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3505 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 3506 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3507 | "$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] | 3508 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3509 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3510 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3511 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3512 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3513 | -C "client hello, adding max_fragment_length extension" \ |
| 3514 | -S "found max fragment length extension" \ |
| 3515 | -S "server hello, max_fragment_length extension" \ |
| 3516 | -C "found max_fragment_length extension" \ |
| 3517 | -c "fragment larger than.*maximum " |
| 3518 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3519 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 3520 | # (session fragment length will be 16384 regardless of mbedtls |
| 3521 | # content length configuration.) |
| 3522 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3523 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3524 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3525 | run_test "Max fragment length: disabled, larger message" \ |
| 3526 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3527 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3528 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3529 | -C "Maximum incoming record payload length is 16384" \ |
| 3530 | -C "Maximum outgoing record payload length is 16384" \ |
| 3531 | -S "Maximum incoming record payload length is 16384" \ |
| 3532 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3533 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3534 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3535 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3536 | |
| 3537 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3538 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 3539 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3540 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3541 | "$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] | 3542 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3543 | -C "Maximum incoming record payload length is 16384" \ |
| 3544 | -C "Maximum outgoing record payload length is 16384" \ |
| 3545 | -S "Maximum incoming record payload length is 16384" \ |
| 3546 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3547 | -c "fragment larger than.*maximum " |
| 3548 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3549 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3550 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3551 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3552 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3553 | "$P_SRV debug_level=3" \ |
| 3554 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3555 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3556 | -c "Maximum incoming record payload length is 4096" \ |
| 3557 | -c "Maximum outgoing record payload length is 4096" \ |
| 3558 | -s "Maximum incoming record payload length is 4096" \ |
| 3559 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3560 | -c "client hello, adding max_fragment_length extension" \ |
| 3561 | -s "found max fragment length extension" \ |
| 3562 | -s "server hello, max_fragment_length extension" \ |
| 3563 | -c "found max_fragment_length extension" |
| 3564 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3565 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3566 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3567 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3568 | run_test "Max fragment length: client 512, server 1024" \ |
| 3569 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3570 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3571 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3572 | -c "Maximum incoming record payload length is 512" \ |
| 3573 | -c "Maximum outgoing record payload length is 512" \ |
| 3574 | -s "Maximum incoming record payload length is 512" \ |
| 3575 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3576 | -c "client hello, adding max_fragment_length extension" \ |
| 3577 | -s "found max fragment length extension" \ |
| 3578 | -s "server hello, max_fragment_length extension" \ |
| 3579 | -c "found max_fragment_length extension" |
| 3580 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3581 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3582 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3583 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3584 | run_test "Max fragment length: client 512, server 2048" \ |
| 3585 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3586 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3587 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3588 | -c "Maximum incoming record payload length is 512" \ |
| 3589 | -c "Maximum outgoing record payload length is 512" \ |
| 3590 | -s "Maximum incoming record payload length is 512" \ |
| 3591 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3592 | -c "client hello, adding max_fragment_length extension" \ |
| 3593 | -s "found max fragment length extension" \ |
| 3594 | -s "server hello, max_fragment_length extension" \ |
| 3595 | -c "found max_fragment_length extension" |
| 3596 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3597 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3598 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3599 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3600 | run_test "Max fragment length: client 512, server 4096" \ |
| 3601 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3602 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3603 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3604 | -c "Maximum incoming record payload length is 512" \ |
| 3605 | -c "Maximum outgoing record payload length is 512" \ |
| 3606 | -s "Maximum incoming record payload length is 512" \ |
| 3607 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3608 | -c "client hello, adding max_fragment_length extension" \ |
| 3609 | -s "found max fragment length extension" \ |
| 3610 | -s "server hello, max_fragment_length extension" \ |
| 3611 | -c "found max_fragment_length extension" |
| 3612 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3613 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3614 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3615 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3616 | run_test "Max fragment length: client 1024, server 512" \ |
| 3617 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3618 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3619 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3620 | -c "Maximum incoming record payload length is 1024" \ |
| 3621 | -c "Maximum outgoing record payload length is 1024" \ |
| 3622 | -s "Maximum incoming record payload length is 1024" \ |
| 3623 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3624 | -c "client hello, adding max_fragment_length extension" \ |
| 3625 | -s "found max fragment length extension" \ |
| 3626 | -s "server hello, max_fragment_length extension" \ |
| 3627 | -c "found max_fragment_length extension" |
| 3628 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3629 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3630 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3631 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3632 | run_test "Max fragment length: client 1024, server 2048" \ |
| 3633 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3634 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3635 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3636 | -c "Maximum incoming record payload length is 1024" \ |
| 3637 | -c "Maximum outgoing record payload length is 1024" \ |
| 3638 | -s "Maximum incoming record payload length is 1024" \ |
| 3639 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3640 | -c "client hello, adding max_fragment_length extension" \ |
| 3641 | -s "found max fragment length extension" \ |
| 3642 | -s "server hello, max_fragment_length extension" \ |
| 3643 | -c "found max_fragment_length extension" |
| 3644 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3645 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3646 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3647 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3648 | run_test "Max fragment length: client 1024, server 4096" \ |
| 3649 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3650 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3651 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3652 | -c "Maximum incoming record payload length is 1024" \ |
| 3653 | -c "Maximum outgoing record payload length is 1024" \ |
| 3654 | -s "Maximum incoming record payload length is 1024" \ |
| 3655 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3656 | -c "client hello, adding max_fragment_length extension" \ |
| 3657 | -s "found max fragment length extension" \ |
| 3658 | -s "server hello, max_fragment_length extension" \ |
| 3659 | -c "found max_fragment_length extension" |
| 3660 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3661 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3662 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3663 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3664 | run_test "Max fragment length: client 2048, server 512" \ |
| 3665 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3666 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3667 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3668 | -c "Maximum incoming record payload length is 2048" \ |
| 3669 | -c "Maximum outgoing record payload length is 2048" \ |
| 3670 | -s "Maximum incoming record payload length is 2048" \ |
| 3671 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3672 | -c "client hello, adding max_fragment_length extension" \ |
| 3673 | -s "found max fragment length extension" \ |
| 3674 | -s "server hello, max_fragment_length extension" \ |
| 3675 | -c "found max_fragment_length extension" |
| 3676 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3677 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3678 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3679 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3680 | run_test "Max fragment length: client 2048, server 1024" \ |
| 3681 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3682 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3683 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3684 | -c "Maximum incoming record payload length is 2048" \ |
| 3685 | -c "Maximum outgoing record payload length is 2048" \ |
| 3686 | -s "Maximum incoming record payload length is 2048" \ |
| 3687 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3688 | -c "client hello, adding max_fragment_length extension" \ |
| 3689 | -s "found max fragment length extension" \ |
| 3690 | -s "server hello, max_fragment_length extension" \ |
| 3691 | -c "found max_fragment_length extension" |
| 3692 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3693 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3694 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3695 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3696 | run_test "Max fragment length: client 2048, server 4096" \ |
| 3697 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3698 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3699 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3700 | -c "Maximum incoming record payload length is 2048" \ |
| 3701 | -c "Maximum outgoing record payload length is 2048" \ |
| 3702 | -s "Maximum incoming record payload length is 2048" \ |
| 3703 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3704 | -c "client hello, adding max_fragment_length extension" \ |
| 3705 | -s "found max fragment length extension" \ |
| 3706 | -s "server hello, max_fragment_length extension" \ |
| 3707 | -c "found max_fragment_length extension" |
| 3708 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3709 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3710 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3711 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3712 | run_test "Max fragment length: client 4096, server 512" \ |
| 3713 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3714 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3715 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3716 | -c "Maximum incoming record payload length is 4096" \ |
| 3717 | -c "Maximum outgoing record payload length is 4096" \ |
| 3718 | -s "Maximum incoming record payload length is 4096" \ |
| 3719 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3720 | -c "client hello, adding max_fragment_length extension" \ |
| 3721 | -s "found max fragment length extension" \ |
| 3722 | -s "server hello, max_fragment_length extension" \ |
| 3723 | -c "found max_fragment_length extension" |
| 3724 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3725 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3726 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3727 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3728 | run_test "Max fragment length: client 4096, server 1024" \ |
| 3729 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3730 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3731 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3732 | -c "Maximum incoming record payload length is 4096" \ |
| 3733 | -c "Maximum outgoing record payload length is 4096" \ |
| 3734 | -s "Maximum incoming record payload length is 4096" \ |
| 3735 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3736 | -c "client hello, adding max_fragment_length extension" \ |
| 3737 | -s "found max fragment length extension" \ |
| 3738 | -s "server hello, max_fragment_length extension" \ |
| 3739 | -c "found max_fragment_length extension" |
| 3740 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3741 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3742 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3743 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3744 | run_test "Max fragment length: client 4096, server 2048" \ |
| 3745 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3746 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3747 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3748 | -c "Maximum incoming record payload length is 4096" \ |
| 3749 | -c "Maximum outgoing record payload length is 4096" \ |
| 3750 | -s "Maximum incoming record payload length is 4096" \ |
| 3751 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3752 | -c "client hello, adding max_fragment_length extension" \ |
| 3753 | -s "found max fragment length extension" \ |
| 3754 | -s "server hello, max_fragment_length extension" \ |
| 3755 | -c "found max_fragment_length extension" |
| 3756 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3757 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3758 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3759 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3760 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3761 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3762 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3763 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3764 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3765 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3766 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3767 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3768 | -C "client hello, adding max_fragment_length extension" \ |
| 3769 | -S "found max fragment length extension" \ |
| 3770 | -S "server hello, max_fragment_length extension" \ |
| 3771 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3772 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3773 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3774 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3775 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3776 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3777 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3778 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3779 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3780 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3781 | -c "Maximum incoming record payload length is 4096" \ |
| 3782 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3783 | -c "client hello, adding max_fragment_length extension" \ |
| 3784 | -c "found max_fragment_length extension" |
| 3785 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3786 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3787 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3788 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3789 | run_test "Max fragment length: client, message just fits" \ |
| 3790 | "$P_SRV debug_level=3" \ |
| 3791 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 3792 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3793 | -c "Maximum incoming record payload length is 2048" \ |
| 3794 | -c "Maximum outgoing record payload length is 2048" \ |
| 3795 | -s "Maximum incoming record payload length is 2048" \ |
| 3796 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3797 | -c "client hello, adding max_fragment_length extension" \ |
| 3798 | -s "found max fragment length extension" \ |
| 3799 | -s "server hello, max_fragment_length extension" \ |
| 3800 | -c "found max_fragment_length extension" \ |
| 3801 | -c "2048 bytes written in 1 fragments" \ |
| 3802 | -s "2048 bytes read" |
| 3803 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3804 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3805 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3806 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3807 | run_test "Max fragment length: client, larger message" \ |
| 3808 | "$P_SRV debug_level=3" \ |
| 3809 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 3810 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3811 | -c "Maximum incoming record payload length is 2048" \ |
| 3812 | -c "Maximum outgoing record payload length is 2048" \ |
| 3813 | -s "Maximum incoming record payload length is 2048" \ |
| 3814 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3815 | -c "client hello, adding max_fragment_length extension" \ |
| 3816 | -s "found max fragment length extension" \ |
| 3817 | -s "server hello, max_fragment_length extension" \ |
| 3818 | -c "found max_fragment_length extension" \ |
| 3819 | -c "2345 bytes written in 2 fragments" \ |
| 3820 | -s "2048 bytes read" \ |
| 3821 | -s "297 bytes read" |
| 3822 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3823 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3824 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3825 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 3826 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3827 | "$P_SRV debug_level=3 dtls=1" \ |
| 3828 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 3829 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3830 | -c "Maximum incoming record payload length is 2048" \ |
| 3831 | -c "Maximum outgoing record payload length is 2048" \ |
| 3832 | -s "Maximum incoming record payload length is 2048" \ |
| 3833 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3834 | -c "client hello, adding max_fragment_length extension" \ |
| 3835 | -s "found max fragment length extension" \ |
| 3836 | -s "server hello, max_fragment_length extension" \ |
| 3837 | -c "found max_fragment_length extension" \ |
| 3838 | -c "fragment larger than.*maximum" |
| 3839 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3840 | # Tests for renegotiation |
| 3841 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3842 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3843 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3844 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3845 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3846 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3847 | 0 \ |
| 3848 | -C "client hello, adding renegotiation extension" \ |
| 3849 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3850 | -S "found renegotiation extension" \ |
| 3851 | -s "server hello, secure renegotiation extension" \ |
| 3852 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3853 | -C "=> renegotiate" \ |
| 3854 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3855 | -S "write hello request" |
| 3856 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3857 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3858 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3859 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3860 | "$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] | 3861 | "$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] | 3862 | 0 \ |
| 3863 | -c "client hello, adding renegotiation extension" \ |
| 3864 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3865 | -s "found renegotiation extension" \ |
| 3866 | -s "server hello, secure renegotiation extension" \ |
| 3867 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3868 | -c "=> renegotiate" \ |
| 3869 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3870 | -S "write hello request" |
| 3871 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3872 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3873 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3874 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3875 | "$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] | 3876 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3877 | 0 \ |
| 3878 | -c "client hello, adding renegotiation extension" \ |
| 3879 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3880 | -s "found renegotiation extension" \ |
| 3881 | -s "server hello, secure renegotiation extension" \ |
| 3882 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3883 | -c "=> renegotiate" \ |
| 3884 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3885 | -s "write hello request" |
| 3886 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3887 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3888 | # 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] | 3889 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3890 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3891 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3892 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 3893 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 3894 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3895 | 0 \ |
| 3896 | -c "client hello, adding renegotiation extension" \ |
| 3897 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3898 | -s "found renegotiation extension" \ |
| 3899 | -s "server hello, secure renegotiation extension" \ |
| 3900 | -c "found renegotiation extension" \ |
| 3901 | -c "=> renegotiate" \ |
| 3902 | -s "=> renegotiate" \ |
| 3903 | -S "write hello request" \ |
| 3904 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3905 | |
| 3906 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3907 | # 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] | 3908 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3909 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3910 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3911 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 3912 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 3913 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3914 | 0 \ |
| 3915 | -c "client hello, adding renegotiation extension" \ |
| 3916 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3917 | -s "found renegotiation extension" \ |
| 3918 | -s "server hello, secure renegotiation extension" \ |
| 3919 | -c "found renegotiation extension" \ |
| 3920 | -c "=> renegotiate" \ |
| 3921 | -s "=> renegotiate" \ |
| 3922 | -s "write hello request" \ |
| 3923 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3924 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3925 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3926 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3927 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3928 | "$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] | 3929 | "$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] | 3930 | 0 \ |
| 3931 | -c "client hello, adding renegotiation extension" \ |
| 3932 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3933 | -s "found renegotiation extension" \ |
| 3934 | -s "server hello, secure renegotiation extension" \ |
| 3935 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3936 | -c "=> renegotiate" \ |
| 3937 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3938 | -s "write hello request" |
| 3939 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3940 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3941 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3942 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3943 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3944 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 3945 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 3946 | "$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" \ |
| 3947 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3948 | -c "Maximum incoming record payload length is 2048" \ |
| 3949 | -c "Maximum outgoing record payload length is 2048" \ |
| 3950 | -s "Maximum incoming record payload length is 2048" \ |
| 3951 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3952 | -c "client hello, adding max_fragment_length extension" \ |
| 3953 | -s "found max fragment length extension" \ |
| 3954 | -s "server hello, max_fragment_length extension" \ |
| 3955 | -c "found max_fragment_length extension" \ |
| 3956 | -c "client hello, adding renegotiation extension" \ |
| 3957 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3958 | -s "found renegotiation extension" \ |
| 3959 | -s "server hello, secure renegotiation extension" \ |
| 3960 | -c "found renegotiation extension" \ |
| 3961 | -c "=> renegotiate" \ |
| 3962 | -s "=> renegotiate" \ |
| 3963 | -s "write hello request" |
| 3964 | |
| 3965 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3966 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3967 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3968 | "$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] | 3969 | "$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] | 3970 | 1 \ |
| 3971 | -c "client hello, adding renegotiation extension" \ |
| 3972 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3973 | -S "found renegotiation extension" \ |
| 3974 | -s "server hello, secure renegotiation extension" \ |
| 3975 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3976 | -c "=> renegotiate" \ |
| 3977 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3978 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 3979 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3980 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3981 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3982 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3983 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3984 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3985 | "$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] | 3986 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3987 | 0 \ |
| 3988 | -C "client hello, adding renegotiation extension" \ |
| 3989 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3990 | -S "found renegotiation extension" \ |
| 3991 | -s "server hello, secure renegotiation extension" \ |
| 3992 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3993 | -C "=> renegotiate" \ |
| 3994 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3995 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 3996 | -S "SSL - An unexpected message was received from our peer" \ |
| 3997 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3998 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3999 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4000 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4001 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4002 | "$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] | 4003 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4004 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4005 | 0 \ |
| 4006 | -C "client hello, adding renegotiation extension" \ |
| 4007 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4008 | -S "found renegotiation extension" \ |
| 4009 | -s "server hello, secure renegotiation extension" \ |
| 4010 | -c "found renegotiation extension" \ |
| 4011 | -C "=> renegotiate" \ |
| 4012 | -S "=> renegotiate" \ |
| 4013 | -s "write hello request" \ |
| 4014 | -S "SSL - An unexpected message was received from our peer" \ |
| 4015 | -S "failed" |
| 4016 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 4017 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4018 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4019 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4020 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4021 | "$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] | 4022 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4023 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4024 | 0 \ |
| 4025 | -C "client hello, adding renegotiation extension" \ |
| 4026 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4027 | -S "found renegotiation extension" \ |
| 4028 | -s "server hello, secure renegotiation extension" \ |
| 4029 | -c "found renegotiation extension" \ |
| 4030 | -C "=> renegotiate" \ |
| 4031 | -S "=> renegotiate" \ |
| 4032 | -s "write hello request" \ |
| 4033 | -S "SSL - An unexpected message was received from our peer" \ |
| 4034 | -S "failed" |
| 4035 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4036 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4037 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4038 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4039 | "$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] | 4040 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4041 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4042 | 0 \ |
| 4043 | -C "client hello, adding renegotiation extension" \ |
| 4044 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4045 | -S "found renegotiation extension" \ |
| 4046 | -s "server hello, secure renegotiation extension" \ |
| 4047 | -c "found renegotiation extension" \ |
| 4048 | -C "=> renegotiate" \ |
| 4049 | -S "=> renegotiate" \ |
| 4050 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 4051 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4052 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4053 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4054 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4055 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4056 | "$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] | 4057 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4058 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4059 | 0 \ |
| 4060 | -c "client hello, adding renegotiation extension" \ |
| 4061 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4062 | -s "found renegotiation extension" \ |
| 4063 | -s "server hello, secure renegotiation extension" \ |
| 4064 | -c "found renegotiation extension" \ |
| 4065 | -c "=> renegotiate" \ |
| 4066 | -s "=> renegotiate" \ |
| 4067 | -s "write hello request" \ |
| 4068 | -S "SSL - An unexpected message was received from our peer" \ |
| 4069 | -S "failed" |
| 4070 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4071 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4072 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4073 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4074 | "$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] | 4075 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 4076 | 0 \ |
| 4077 | -C "client hello, adding renegotiation extension" \ |
| 4078 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4079 | -S "found renegotiation extension" \ |
| 4080 | -s "server hello, secure renegotiation extension" \ |
| 4081 | -c "found renegotiation extension" \ |
| 4082 | -S "record counter limit reached: renegotiate" \ |
| 4083 | -C "=> renegotiate" \ |
| 4084 | -S "=> renegotiate" \ |
| 4085 | -S "write hello request" \ |
| 4086 | -S "SSL - An unexpected message was received from our peer" \ |
| 4087 | -S "failed" |
| 4088 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 4089 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4090 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4091 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4092 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4093 | "$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] | 4094 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4095 | 0 \ |
| 4096 | -c "client hello, adding renegotiation extension" \ |
| 4097 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4098 | -s "found renegotiation extension" \ |
| 4099 | -s "server hello, secure renegotiation extension" \ |
| 4100 | -c "found renegotiation extension" \ |
| 4101 | -s "record counter limit reached: renegotiate" \ |
| 4102 | -c "=> renegotiate" \ |
| 4103 | -s "=> renegotiate" \ |
| 4104 | -s "write hello request" \ |
| 4105 | -S "SSL - An unexpected message was received from our peer" \ |
| 4106 | -S "failed" |
| 4107 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4108 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4109 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4110 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4111 | "$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] | 4112 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4113 | 0 \ |
| 4114 | -c "client hello, adding renegotiation extension" \ |
| 4115 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4116 | -s "found renegotiation extension" \ |
| 4117 | -s "server hello, secure renegotiation extension" \ |
| 4118 | -c "found renegotiation extension" \ |
| 4119 | -s "record counter limit reached: renegotiate" \ |
| 4120 | -c "=> renegotiate" \ |
| 4121 | -s "=> renegotiate" \ |
| 4122 | -s "write hello request" \ |
| 4123 | -S "SSL - An unexpected message was received from our peer" \ |
| 4124 | -S "failed" |
| 4125 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4126 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4127 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4128 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4129 | "$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] | 4130 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 4131 | 0 \ |
| 4132 | -C "client hello, adding renegotiation extension" \ |
| 4133 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4134 | -S "found renegotiation extension" \ |
| 4135 | -s "server hello, secure renegotiation extension" \ |
| 4136 | -c "found renegotiation extension" \ |
| 4137 | -S "record counter limit reached: renegotiate" \ |
| 4138 | -C "=> renegotiate" \ |
| 4139 | -S "=> renegotiate" \ |
| 4140 | -S "write hello request" \ |
| 4141 | -S "SSL - An unexpected message was received from our peer" \ |
| 4142 | -S "failed" |
| 4143 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4144 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4145 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4146 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4147 | "$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] | 4148 | "$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] | 4149 | 0 \ |
| 4150 | -c "client hello, adding renegotiation extension" \ |
| 4151 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4152 | -s "found renegotiation extension" \ |
| 4153 | -s "server hello, secure renegotiation extension" \ |
| 4154 | -c "found renegotiation extension" \ |
| 4155 | -c "=> renegotiate" \ |
| 4156 | -s "=> renegotiate" \ |
| 4157 | -S "write hello request" |
| 4158 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4159 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4160 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4161 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4162 | "$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] | 4163 | "$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] | 4164 | 0 \ |
| 4165 | -c "client hello, adding renegotiation extension" \ |
| 4166 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4167 | -s "found renegotiation extension" \ |
| 4168 | -s "server hello, secure renegotiation extension" \ |
| 4169 | -c "found renegotiation extension" \ |
| 4170 | -c "=> renegotiate" \ |
| 4171 | -s "=> renegotiate" \ |
| 4172 | -s "write hello request" |
| 4173 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4174 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4175 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4176 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 4177 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4178 | "$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] | 4179 | 0 \ |
| 4180 | -c "client hello, adding renegotiation extension" \ |
| 4181 | -c "found renegotiation extension" \ |
| 4182 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4183 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 4184 | -C "error" \ |
| 4185 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4186 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4187 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4188 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4189 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4190 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 4191 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4192 | "$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] | 4193 | 0 \ |
| 4194 | -c "client hello, adding renegotiation extension" \ |
| 4195 | -c "found renegotiation extension" \ |
| 4196 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4197 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 4198 | -C "error" \ |
| 4199 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4200 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4201 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4202 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4203 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4204 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 4205 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4206 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 4207 | 1 \ |
| 4208 | -c "client hello, adding renegotiation extension" \ |
| 4209 | -C "found renegotiation extension" \ |
| 4210 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4211 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4212 | -c "error" \ |
| 4213 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4214 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4215 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4216 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4217 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4218 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 4219 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4220 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 4221 | allow_legacy=0" \ |
| 4222 | 1 \ |
| 4223 | -c "client hello, adding renegotiation extension" \ |
| 4224 | -C "found renegotiation extension" \ |
| 4225 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4226 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4227 | -c "error" \ |
| 4228 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4229 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4230 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4231 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4232 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4233 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 4234 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4235 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 4236 | allow_legacy=1" \ |
| 4237 | 0 \ |
| 4238 | -c "client hello, adding renegotiation extension" \ |
| 4239 | -C "found renegotiation extension" \ |
| 4240 | -c "=> renegotiate" \ |
| 4241 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4242 | -C "error" \ |
| 4243 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4244 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4245 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4246 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 4247 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 4248 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 4249 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4250 | 0 \ |
| 4251 | -c "client hello, adding renegotiation extension" \ |
| 4252 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4253 | -s "found renegotiation extension" \ |
| 4254 | -s "server hello, secure renegotiation extension" \ |
| 4255 | -c "found renegotiation extension" \ |
| 4256 | -c "=> renegotiate" \ |
| 4257 | -s "=> renegotiate" \ |
| 4258 | -S "write hello request" |
| 4259 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4260 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4261 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 4262 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 4263 | "$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] | 4264 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 4265 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 4266 | 0 \ |
| 4267 | -c "client hello, adding renegotiation extension" \ |
| 4268 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4269 | -s "found renegotiation extension" \ |
| 4270 | -s "server hello, secure renegotiation extension" \ |
| 4271 | -c "found renegotiation extension" \ |
| 4272 | -c "=> renegotiate" \ |
| 4273 | -s "=> renegotiate" \ |
| 4274 | -s "write hello request" |
| 4275 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4276 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4277 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 4278 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 4279 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 4280 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 4281 | 0 \ |
| 4282 | -c "client hello, adding renegotiation extension" \ |
| 4283 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4284 | -s "found renegotiation extension" \ |
| 4285 | -s "server hello, secure renegotiation extension" \ |
| 4286 | -s "record counter limit reached: renegotiate" \ |
| 4287 | -c "=> renegotiate" \ |
| 4288 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4289 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 4290 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 4291 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4292 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4293 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 4294 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 4295 | "$G_SRV -u --mtu 4096" \ |
| 4296 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 4297 | 0 \ |
| 4298 | -c "client hello, adding renegotiation extension" \ |
| 4299 | -c "found renegotiation extension" \ |
| 4300 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4301 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 4302 | -C "error" \ |
| 4303 | -s "Extra-header:" |
| 4304 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4305 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 4306 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4307 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4308 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4309 | run_test "Renego ext: gnutls server strict, client default" \ |
| 4310 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 4311 | "$P_CLI debug_level=3" \ |
| 4312 | 0 \ |
| 4313 | -c "found renegotiation extension" \ |
| 4314 | -C "error" \ |
| 4315 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4316 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4317 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4318 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4319 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 4320 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4321 | "$P_CLI debug_level=3" \ |
| 4322 | 0 \ |
| 4323 | -C "found renegotiation extension" \ |
| 4324 | -C "error" \ |
| 4325 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4326 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4327 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4328 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4329 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 4330 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4331 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 4332 | 1 \ |
| 4333 | -C "found renegotiation extension" \ |
| 4334 | -c "error" \ |
| 4335 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4336 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4337 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4338 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4339 | run_test "Renego ext: gnutls client strict, server default" \ |
| 4340 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4341 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4342 | 0 \ |
| 4343 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4344 | -s "server hello, secure renegotiation extension" |
| 4345 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4346 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4347 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4348 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 4349 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4350 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4351 | 0 \ |
| 4352 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4353 | -S "server hello, secure renegotiation extension" |
| 4354 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4355 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4356 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4357 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 4358 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4359 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4360 | 1 \ |
| 4361 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4362 | -S "server hello, secure renegotiation extension" |
| 4363 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4364 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 4365 | |
| 4366 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4367 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4368 | run_test "DER format: no trailing bytes" \ |
| 4369 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 4370 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4371 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4372 | 0 \ |
| 4373 | -c "Handshake was completed" \ |
| 4374 | |
| 4375 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4376 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4377 | run_test "DER format: with a trailing zero byte" \ |
| 4378 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 4379 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4380 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4381 | 0 \ |
| 4382 | -c "Handshake was completed" \ |
| 4383 | |
| 4384 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4385 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4386 | run_test "DER format: with a trailing random byte" \ |
| 4387 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 4388 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4389 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4390 | 0 \ |
| 4391 | -c "Handshake was completed" \ |
| 4392 | |
| 4393 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4394 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4395 | run_test "DER format: with 2 trailing random bytes" \ |
| 4396 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 4397 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4398 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4399 | 0 \ |
| 4400 | -c "Handshake was completed" \ |
| 4401 | |
| 4402 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4403 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4404 | run_test "DER format: with 4 trailing random bytes" \ |
| 4405 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 4406 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4407 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4408 | 0 \ |
| 4409 | -c "Handshake was completed" \ |
| 4410 | |
| 4411 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4412 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4413 | run_test "DER format: with 8 trailing random bytes" \ |
| 4414 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 4415 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4416 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4417 | 0 \ |
| 4418 | -c "Handshake was completed" \ |
| 4419 | |
| 4420 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4421 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4422 | run_test "DER format: with 9 trailing random bytes" \ |
| 4423 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 4424 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4425 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4426 | 0 \ |
| 4427 | -c "Handshake was completed" \ |
| 4428 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4429 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 4430 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4431 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4432 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4433 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4434 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4435 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4436 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4437 | 1 \ |
| 4438 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4439 | -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] | 4440 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4441 | -c "X509 - Certificate verification failed" |
| 4442 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4443 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4444 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4445 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4446 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4447 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4448 | 0 \ |
| 4449 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4450 | -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] | 4451 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4452 | -C "X509 - Certificate verification failed" |
| 4453 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4454 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 4455 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 4456 | "$P_SRV" \ |
| 4457 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 4458 | 0 \ |
| 4459 | -c "x509_verify_cert() returned" \ |
| 4460 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4461 | -c "! Certificate verification flags"\ |
| 4462 | -C "! mbedtls_ssl_handshake returned" \ |
| 4463 | -C "X509 - Certificate verification failed" \ |
| 4464 | -C "SSL - No CA Chain is set, but required to operate" |
| 4465 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4466 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 4467 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 4468 | "$P_SRV" \ |
| 4469 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 4470 | 1 \ |
| 4471 | -c "x509_verify_cert() returned" \ |
| 4472 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4473 | -c "! Certificate verification flags"\ |
| 4474 | -c "! mbedtls_ssl_handshake returned" \ |
| 4475 | -c "SSL - No CA Chain is set, but required to operate" |
| 4476 | |
| 4477 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4478 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4479 | # the client informs the server about the supported curves - it does, though, in the |
| 4480 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4481 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4482 | # different means to have the server ignoring the client's supported curve list. |
| 4483 | |
| 4484 | requires_config_enabled MBEDTLS_ECP_C |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4485 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 4486 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4487 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4488 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4489 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4490 | 1 \ |
| 4491 | -c "bad certificate (EC key curve)"\ |
| 4492 | -c "! Certificate verification flags"\ |
| 4493 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4494 | |
| 4495 | requires_config_enabled MBEDTLS_ECP_C |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4496 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 4497 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4498 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4499 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4500 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4501 | 1 \ |
| 4502 | -c "bad certificate (EC key curve)"\ |
| 4503 | -c "! Certificate verification flags"\ |
| 4504 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4505 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4506 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4507 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 4508 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4509 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4510 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4511 | 0 \ |
| 4512 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4513 | -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] | 4514 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4515 | -C "X509 - Certificate verification failed" |
| 4516 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4517 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 4518 | run_test "Authentication: client SHA256, server required" \ |
| 4519 | "$P_SRV auth_mode=required" \ |
| 4520 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4521 | key_file=data_files/server6.key \ |
| 4522 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4523 | 0 \ |
| 4524 | -c "Supported Signature Algorithm found: 4," \ |
| 4525 | -c "Supported Signature Algorithm found: 5," |
| 4526 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4527 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 4528 | run_test "Authentication: client SHA384, server required" \ |
| 4529 | "$P_SRV auth_mode=required" \ |
| 4530 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4531 | key_file=data_files/server6.key \ |
| 4532 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4533 | 0 \ |
| 4534 | -c "Supported Signature Algorithm found: 4," \ |
| 4535 | -c "Supported Signature Algorithm found: 5," |
| 4536 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4537 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4538 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 4539 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4540 | "$P_CLI debug_level=3 crt_file=none \ |
| 4541 | key_file=data_files/server5.key" \ |
| 4542 | 1 \ |
| 4543 | -S "skip write certificate request" \ |
| 4544 | -C "skip parse certificate request" \ |
| 4545 | -c "got a certificate request" \ |
| 4546 | -c "= write certificate$" \ |
| 4547 | -C "skip write certificate$" \ |
| 4548 | -S "x509_verify_cert() returned" \ |
| 4549 | -s "client has no certificate" \ |
| 4550 | -s "! mbedtls_ssl_handshake returned" \ |
| 4551 | -c "! mbedtls_ssl_handshake returned" \ |
| 4552 | -s "No client certification received from the client, but required by the authentication mode" |
| 4553 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4554 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4555 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4556 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4557 | "$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] | 4558 | key_file=data_files/server5.key" \ |
| 4559 | 1 \ |
| 4560 | -S "skip write certificate request" \ |
| 4561 | -C "skip parse certificate request" \ |
| 4562 | -c "got a certificate request" \ |
| 4563 | -C "skip write certificate" \ |
| 4564 | -C "skip write certificate verify" \ |
| 4565 | -S "skip parse certificate verify" \ |
| 4566 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4567 | -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] | 4568 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4569 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4570 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4571 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4572 | # We don't check that the client receives the alert because it might |
| 4573 | # detect that its write end of the connection is closed and abort |
| 4574 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4575 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4576 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 4577 | run_test "Authentication: client cert self-signed and trusted, server required" \ |
| 4578 | "$P_SRV debug_level=3 auth_mode=required ca_file=data_files/server5-selfsigned.crt" \ |
| 4579 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4580 | key_file=data_files/server5.key" \ |
| 4581 | 0 \ |
| 4582 | -S "skip write certificate request" \ |
| 4583 | -C "skip parse certificate request" \ |
| 4584 | -c "got a certificate request" \ |
| 4585 | -C "skip write certificate" \ |
| 4586 | -C "skip write certificate verify" \ |
| 4587 | -S "skip parse certificate verify" \ |
| 4588 | -S "x509_verify_cert() returned" \ |
| 4589 | -S "! The certificate is not correctly signed" \ |
| 4590 | -S "X509 - Certificate verification failed" |
| 4591 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4592 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4593 | run_test "Authentication: client cert not trusted, server required" \ |
| 4594 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4595 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4596 | key_file=data_files/server5.key" \ |
| 4597 | 1 \ |
| 4598 | -S "skip write certificate request" \ |
| 4599 | -C "skip parse certificate request" \ |
| 4600 | -c "got a certificate request" \ |
| 4601 | -C "skip write certificate" \ |
| 4602 | -C "skip write certificate verify" \ |
| 4603 | -S "skip parse certificate verify" \ |
| 4604 | -s "x509_verify_cert() returned" \ |
| 4605 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4606 | -s "! mbedtls_ssl_handshake returned" \ |
| 4607 | -c "! mbedtls_ssl_handshake returned" \ |
| 4608 | -s "X509 - Certificate verification failed" |
| 4609 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4610 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4611 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4612 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4613 | "$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] | 4614 | key_file=data_files/server5.key" \ |
| 4615 | 0 \ |
| 4616 | -S "skip write certificate request" \ |
| 4617 | -C "skip parse certificate request" \ |
| 4618 | -c "got a certificate request" \ |
| 4619 | -C "skip write certificate" \ |
| 4620 | -C "skip write certificate verify" \ |
| 4621 | -S "skip parse certificate verify" \ |
| 4622 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4623 | -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] | 4624 | -S "! mbedtls_ssl_handshake returned" \ |
| 4625 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4626 | -S "X509 - Certificate verification failed" |
| 4627 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4628 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4629 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4630 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 4631 | "$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] | 4632 | key_file=data_files/server5.key" \ |
| 4633 | 0 \ |
| 4634 | -s "skip write certificate request" \ |
| 4635 | -C "skip parse certificate request" \ |
| 4636 | -c "got no certificate request" \ |
| 4637 | -c "skip write certificate" \ |
| 4638 | -c "skip write certificate verify" \ |
| 4639 | -s "skip parse certificate verify" \ |
| 4640 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4641 | -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] | 4642 | -S "! mbedtls_ssl_handshake returned" \ |
| 4643 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4644 | -S "X509 - Certificate verification failed" |
| 4645 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4646 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4647 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4648 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4649 | "$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] | 4650 | 0 \ |
| 4651 | -S "skip write certificate request" \ |
| 4652 | -C "skip parse certificate request" \ |
| 4653 | -c "got a certificate request" \ |
| 4654 | -C "skip write certificate$" \ |
| 4655 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4656 | -c "skip write certificate verify" \ |
| 4657 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4658 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4659 | -S "! mbedtls_ssl_handshake returned" \ |
| 4660 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4661 | -S "X509 - Certificate verification failed" |
| 4662 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4663 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4664 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4665 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4666 | "$O_CLI" \ |
| 4667 | 0 \ |
| 4668 | -S "skip write certificate request" \ |
| 4669 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4670 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4671 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4672 | -S "X509 - Certificate verification failed" |
| 4673 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4674 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4675 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4676 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4677 | "$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] | 4678 | 0 \ |
| 4679 | -C "skip parse certificate request" \ |
| 4680 | -c "got a certificate request" \ |
| 4681 | -C "skip write certificate$" \ |
| 4682 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4683 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4684 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4685 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4686 | run_test "Authentication: client no cert, openssl server required" \ |
| 4687 | "$O_SRV -Verify 10" \ |
| 4688 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 4689 | 1 \ |
| 4690 | -C "skip parse certificate request" \ |
| 4691 | -c "got a certificate request" \ |
| 4692 | -C "skip write certificate$" \ |
| 4693 | -c "skip write certificate verify" \ |
| 4694 | -c "! mbedtls_ssl_handshake returned" |
| 4695 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4696 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 4697 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 4698 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4699 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4700 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4701 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4702 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 4703 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 4704 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 4705 | # 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] | 4706 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4707 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4708 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4709 | run_test "Authentication: server max_int chain, client default" \ |
| 4710 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4711 | key_file=data_files/dir-maxpath/09.key" \ |
| 4712 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4713 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4714 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4715 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4716 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4717 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4718 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4719 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 4720 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4721 | key_file=data_files/dir-maxpath/10.key" \ |
| 4722 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4723 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4724 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4725 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4726 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4727 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4728 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4729 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 4730 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4731 | key_file=data_files/dir-maxpath/10.key" \ |
| 4732 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4733 | auth_mode=optional" \ |
| 4734 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4735 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4736 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4737 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4738 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4739 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4740 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 4741 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4742 | key_file=data_files/dir-maxpath/10.key" \ |
| 4743 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4744 | auth_mode=none" \ |
| 4745 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4746 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4747 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4748 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4749 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4750 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4751 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 4752 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 4753 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4754 | key_file=data_files/dir-maxpath/10.key" \ |
| 4755 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4756 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4757 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4758 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4759 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4760 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4761 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 4762 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4763 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4764 | key_file=data_files/dir-maxpath/10.key" \ |
| 4765 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4766 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4767 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4768 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4769 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4770 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4771 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 4772 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4773 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4774 | key_file=data_files/dir-maxpath/10.key" \ |
| 4775 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4776 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4777 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4778 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4779 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4780 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4781 | run_test "Authentication: client max_int chain, server required" \ |
| 4782 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4783 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4784 | key_file=data_files/dir-maxpath/09.key" \ |
| 4785 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4786 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4787 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4788 | # Tests for CA list in CertificateRequest messages |
| 4789 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4790 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4791 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 4792 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4793 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4794 | key_file=data_files/server6.key" \ |
| 4795 | 0 \ |
| 4796 | -s "requested DN" |
| 4797 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4798 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4799 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 4800 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4801 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4802 | key_file=data_files/server6.key" \ |
| 4803 | 0 \ |
| 4804 | -S "requested DN" |
| 4805 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4806 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4807 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 4808 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4809 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4810 | key_file=data_files/server5.key" \ |
| 4811 | 1 \ |
| 4812 | -S "requested DN" \ |
| 4813 | -s "x509_verify_cert() returned" \ |
| 4814 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4815 | -s "! mbedtls_ssl_handshake returned" \ |
| 4816 | -c "! mbedtls_ssl_handshake returned" \ |
| 4817 | -s "X509 - Certificate verification failed" |
| 4818 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4819 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 4820 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4821 | |
| 4822 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4823 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4824 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 4825 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4826 | key_file=data_files/server5.key" \ |
| 4827 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4828 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4829 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4830 | -c "x509_verify_cert() returned" \ |
| 4831 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4832 | -c "! mbedtls_ssl_handshake returned" \ |
| 4833 | -c "X509 - Certificate verification failed" |
| 4834 | |
| 4835 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4836 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4837 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 4838 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4839 | key_file=data_files/server5.key" \ |
| 4840 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4841 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4842 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4843 | -c "x509_verify_cert() returned" \ |
| 4844 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4845 | -C "! mbedtls_ssl_handshake returned" \ |
| 4846 | -C "X509 - Certificate verification failed" |
| 4847 | |
| 4848 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4849 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4850 | # the client informs the server about the supported curves - it does, though, in the |
| 4851 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4852 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4853 | # different means to have the server ignoring the client's supported curve list. |
| 4854 | |
| 4855 | requires_config_enabled MBEDTLS_ECP_C |
| 4856 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4857 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4858 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4859 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4860 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4861 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4862 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4863 | -c "use CA callback for X.509 CRT verification" \ |
| 4864 | -c "bad certificate (EC key curve)" \ |
| 4865 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4866 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4867 | |
| 4868 | requires_config_enabled MBEDTLS_ECP_C |
| 4869 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4870 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4871 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4872 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4873 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4874 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4875 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4876 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4877 | -c "bad certificate (EC key curve)"\ |
| 4878 | -c "! Certificate verification flags"\ |
| 4879 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4880 | |
| 4881 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4882 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4883 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 4884 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4885 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4886 | key_file=data_files/server6.key \ |
| 4887 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4888 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4889 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4890 | -c "Supported Signature Algorithm found: 4," \ |
| 4891 | -c "Supported Signature Algorithm found: 5," |
| 4892 | |
| 4893 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4894 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4895 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 4896 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4897 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4898 | key_file=data_files/server6.key \ |
| 4899 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4900 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4901 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4902 | -c "Supported Signature Algorithm found: 4," \ |
| 4903 | -c "Supported Signature Algorithm found: 5," |
| 4904 | |
| 4905 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4906 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4907 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 4908 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4909 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4910 | key_file=data_files/server5.key" \ |
| 4911 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4912 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4913 | -S "skip write certificate request" \ |
| 4914 | -C "skip parse certificate request" \ |
| 4915 | -c "got a certificate request" \ |
| 4916 | -C "skip write certificate" \ |
| 4917 | -C "skip write certificate verify" \ |
| 4918 | -S "skip parse certificate verify" \ |
| 4919 | -s "x509_verify_cert() returned" \ |
| 4920 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4921 | -s "! mbedtls_ssl_handshake returned" \ |
| 4922 | -s "send alert level=2 message=48" \ |
| 4923 | -c "! mbedtls_ssl_handshake returned" \ |
| 4924 | -s "X509 - Certificate verification failed" |
| 4925 | # We don't check that the client receives the alert because it might |
| 4926 | # detect that its write end of the connection is closed and abort |
| 4927 | # before reading the alert message. |
| 4928 | |
| 4929 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4930 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4931 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 4932 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4933 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4934 | key_file=data_files/server5.key" \ |
| 4935 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4936 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4937 | -S "skip write certificate request" \ |
| 4938 | -C "skip parse certificate request" \ |
| 4939 | -c "got a certificate request" \ |
| 4940 | -C "skip write certificate" \ |
| 4941 | -C "skip write certificate verify" \ |
| 4942 | -S "skip parse certificate verify" \ |
| 4943 | -s "x509_verify_cert() returned" \ |
| 4944 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4945 | -s "! mbedtls_ssl_handshake returned" \ |
| 4946 | -c "! mbedtls_ssl_handshake returned" \ |
| 4947 | -s "X509 - Certificate verification failed" |
| 4948 | |
| 4949 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4950 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4951 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 4952 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4953 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4954 | key_file=data_files/server5.key" \ |
| 4955 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4956 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4957 | -S "skip write certificate request" \ |
| 4958 | -C "skip parse certificate request" \ |
| 4959 | -c "got a certificate request" \ |
| 4960 | -C "skip write certificate" \ |
| 4961 | -C "skip write certificate verify" \ |
| 4962 | -S "skip parse certificate verify" \ |
| 4963 | -s "x509_verify_cert() returned" \ |
| 4964 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4965 | -S "! mbedtls_ssl_handshake returned" \ |
| 4966 | -C "! mbedtls_ssl_handshake returned" \ |
| 4967 | -S "X509 - Certificate verification failed" |
| 4968 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4969 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4970 | requires_full_size_output_buffer |
| 4971 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4972 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4973 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 4974 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4975 | key_file=data_files/dir-maxpath/09.key" \ |
| 4976 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4977 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4978 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4979 | -C "X509 - A fatal error occurred" |
| 4980 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4981 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4982 | requires_full_size_output_buffer |
| 4983 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4984 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4985 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 4986 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4987 | key_file=data_files/dir-maxpath/10.key" \ |
| 4988 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4989 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4990 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4991 | -c "X509 - A fatal error occurred" |
| 4992 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4993 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4994 | requires_full_size_output_buffer |
| 4995 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4996 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4997 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 4998 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4999 | key_file=data_files/dir-maxpath/10.key" \ |
| 5000 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 5001 | debug_level=3 auth_mode=optional" \ |
| 5002 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5003 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5004 | -c "X509 - A fatal error occurred" |
| 5005 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5006 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5007 | requires_full_size_output_buffer |
| 5008 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5009 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5010 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 5011 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 5012 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5013 | key_file=data_files/dir-maxpath/10.key" \ |
| 5014 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5015 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5016 | -s "X509 - A fatal error occurred" |
| 5017 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5018 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5019 | requires_full_size_output_buffer |
| 5020 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5021 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5022 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 5023 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5024 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5025 | key_file=data_files/dir-maxpath/10.key" \ |
| 5026 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5027 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5028 | -s "X509 - A fatal error occurred" |
| 5029 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5030 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5031 | requires_full_size_output_buffer |
| 5032 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5033 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5034 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 5035 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5036 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 5037 | key_file=data_files/dir-maxpath/09.key" \ |
| 5038 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5039 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5040 | -S "X509 - A fatal error occurred" |
| 5041 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5042 | # Tests for certificate selection based on SHA verson |
| 5043 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5044 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5045 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5046 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 5047 | "$P_SRV crt_file=data_files/server5.crt \ |
| 5048 | key_file=data_files/server5.key \ |
| 5049 | crt_file2=data_files/server5-sha1.crt \ |
| 5050 | key_file2=data_files/server5.key" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5051 | "$P_CLI force_version=tls12" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5052 | 0 \ |
| 5053 | -c "signed using.*ECDSA with SHA256" \ |
| 5054 | -C "signed using.*ECDSA with SHA1" |
| 5055 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5056 | # tests for SNI |
| 5057 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5058 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5059 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5060 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5061 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5062 | 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] | 5063 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5064 | 0 \ |
| 5065 | -S "parse ServerName extension" \ |
| 5066 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 5067 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5068 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5069 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5070 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5071 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5072 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5073 | 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] | 5074 | 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] | 5075 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5076 | 0 \ |
| 5077 | -s "parse ServerName extension" \ |
| 5078 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5079 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5080 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5081 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5082 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5083 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5084 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5085 | 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] | 5086 | 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] | 5087 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5088 | 0 \ |
| 5089 | -s "parse ServerName extension" \ |
| 5090 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5091 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5092 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5093 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5094 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5095 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5096 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5097 | 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] | 5098 | 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] | 5099 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5100 | 1 \ |
| 5101 | -s "parse ServerName extension" \ |
| 5102 | -s "ssl_sni_wrapper() returned" \ |
| 5103 | -s "mbedtls_ssl_handshake returned" \ |
| 5104 | -c "mbedtls_ssl_handshake returned" \ |
| 5105 | -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] | 5106 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5107 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5108 | run_test "SNI: client auth no override: optional" \ |
| 5109 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5110 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5111 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 5112 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5113 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5114 | -S "skip write certificate request" \ |
| 5115 | -C "skip parse certificate request" \ |
| 5116 | -c "got a certificate request" \ |
| 5117 | -C "skip write certificate" \ |
| 5118 | -C "skip write certificate verify" \ |
| 5119 | -S "skip parse certificate verify" |
| 5120 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5121 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5122 | run_test "SNI: client auth override: none -> optional" \ |
| 5123 | "$P_SRV debug_level=3 auth_mode=none \ |
| 5124 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5125 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 5126 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5127 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5128 | -S "skip write certificate request" \ |
| 5129 | -C "skip parse certificate request" \ |
| 5130 | -c "got a certificate request" \ |
| 5131 | -C "skip write certificate" \ |
| 5132 | -C "skip write certificate verify" \ |
| 5133 | -S "skip parse certificate verify" |
| 5134 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5135 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5136 | run_test "SNI: client auth override: optional -> none" \ |
| 5137 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5138 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5139 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 5140 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5141 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5142 | -s "skip write certificate request" \ |
| 5143 | -C "skip parse certificate request" \ |
| 5144 | -c "got no certificate request" \ |
| 5145 | -c "skip write certificate" \ |
| 5146 | -c "skip write certificate verify" \ |
| 5147 | -s "skip parse certificate verify" |
| 5148 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5149 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5150 | run_test "SNI: CA no override" \ |
| 5151 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5152 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5153 | ca_file=data_files/test-ca.crt \ |
| 5154 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 5155 | "$P_CLI debug_level=3 server_name=localhost \ |
| 5156 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5157 | 1 \ |
| 5158 | -S "skip write certificate request" \ |
| 5159 | -C "skip parse certificate request" \ |
| 5160 | -c "got a certificate request" \ |
| 5161 | -C "skip write certificate" \ |
| 5162 | -C "skip write certificate verify" \ |
| 5163 | -S "skip parse certificate verify" \ |
| 5164 | -s "x509_verify_cert() returned" \ |
| 5165 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5166 | -S "The certificate has been revoked (is on a CRL)" |
| 5167 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5168 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5169 | run_test "SNI: CA override" \ |
| 5170 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5171 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5172 | ca_file=data_files/test-ca.crt \ |
| 5173 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 5174 | "$P_CLI debug_level=3 server_name=localhost \ |
| 5175 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5176 | 0 \ |
| 5177 | -S "skip write certificate request" \ |
| 5178 | -C "skip parse certificate request" \ |
| 5179 | -c "got a certificate request" \ |
| 5180 | -C "skip write certificate" \ |
| 5181 | -C "skip write certificate verify" \ |
| 5182 | -S "skip parse certificate verify" \ |
| 5183 | -S "x509_verify_cert() returned" \ |
| 5184 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5185 | -S "The certificate has been revoked (is on a CRL)" |
| 5186 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5187 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5188 | run_test "SNI: CA override with CRL" \ |
| 5189 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5190 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5191 | ca_file=data_files/test-ca.crt \ |
| 5192 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 5193 | "$P_CLI debug_level=3 server_name=localhost \ |
| 5194 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5195 | 1 \ |
| 5196 | -S "skip write certificate request" \ |
| 5197 | -C "skip parse certificate request" \ |
| 5198 | -c "got a certificate request" \ |
| 5199 | -C "skip write certificate" \ |
| 5200 | -C "skip write certificate verify" \ |
| 5201 | -S "skip parse certificate verify" \ |
| 5202 | -s "x509_verify_cert() returned" \ |
| 5203 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5204 | -s "The certificate has been revoked (is on a CRL)" |
| 5205 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5206 | # Tests for SNI and DTLS |
| 5207 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5208 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5209 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5210 | run_test "SNI: DTLS, no SNI callback" \ |
| 5211 | "$P_SRV debug_level=3 dtls=1 \ |
| 5212 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 5213 | "$P_CLI server_name=localhost dtls=1" \ |
| 5214 | 0 \ |
| 5215 | -S "parse ServerName extension" \ |
| 5216 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 5217 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 5218 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5219 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5220 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5221 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5222 | "$P_SRV debug_level=3 dtls=1 \ |
| 5223 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5224 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5225 | "$P_CLI server_name=localhost dtls=1" \ |
| 5226 | 0 \ |
| 5227 | -s "parse ServerName extension" \ |
| 5228 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5229 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 5230 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5231 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5232 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5233 | run_test "SNI: DTLS, matching cert 2" \ |
| 5234 | "$P_SRV debug_level=3 dtls=1 \ |
| 5235 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5236 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5237 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 5238 | 0 \ |
| 5239 | -s "parse ServerName extension" \ |
| 5240 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5241 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 5242 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5243 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5244 | run_test "SNI: DTLS, no matching cert" \ |
| 5245 | "$P_SRV debug_level=3 dtls=1 \ |
| 5246 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5247 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5248 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 5249 | 1 \ |
| 5250 | -s "parse ServerName extension" \ |
| 5251 | -s "ssl_sni_wrapper() returned" \ |
| 5252 | -s "mbedtls_ssl_handshake returned" \ |
| 5253 | -c "mbedtls_ssl_handshake returned" \ |
| 5254 | -c "SSL - A fatal alert message was received from our peer" |
| 5255 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5256 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5257 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 5258 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5259 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5260 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 5261 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5262 | 0 \ |
| 5263 | -S "skip write certificate request" \ |
| 5264 | -C "skip parse certificate request" \ |
| 5265 | -c "got a certificate request" \ |
| 5266 | -C "skip write certificate" \ |
| 5267 | -C "skip write certificate verify" \ |
| 5268 | -S "skip parse certificate verify" |
| 5269 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5270 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5271 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 5272 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 5273 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5274 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 5275 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5276 | 0 \ |
| 5277 | -S "skip write certificate request" \ |
| 5278 | -C "skip parse certificate request" \ |
| 5279 | -c "got a certificate request" \ |
| 5280 | -C "skip write certificate" \ |
| 5281 | -C "skip write certificate verify" \ |
| 5282 | -S "skip parse certificate verify" |
| 5283 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5284 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5285 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 5286 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5287 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5288 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 5289 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5290 | 0 \ |
| 5291 | -s "skip write certificate request" \ |
| 5292 | -C "skip parse certificate request" \ |
| 5293 | -c "got no certificate request" \ |
| 5294 | -c "skip write certificate" \ |
| 5295 | -c "skip write certificate verify" \ |
| 5296 | -s "skip parse certificate verify" |
| 5297 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5298 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5299 | run_test "SNI: DTLS, CA no override" \ |
| 5300 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5301 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5302 | ca_file=data_files/test-ca.crt \ |
| 5303 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 5304 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5305 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5306 | 1 \ |
| 5307 | -S "skip write certificate request" \ |
| 5308 | -C "skip parse certificate request" \ |
| 5309 | -c "got a certificate request" \ |
| 5310 | -C "skip write certificate" \ |
| 5311 | -C "skip write certificate verify" \ |
| 5312 | -S "skip parse certificate verify" \ |
| 5313 | -s "x509_verify_cert() returned" \ |
| 5314 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5315 | -S "The certificate has been revoked (is on a CRL)" |
| 5316 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5317 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5318 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5319 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5320 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5321 | ca_file=data_files/test-ca.crt \ |
| 5322 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 5323 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5324 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5325 | 0 \ |
| 5326 | -S "skip write certificate request" \ |
| 5327 | -C "skip parse certificate request" \ |
| 5328 | -c "got a certificate request" \ |
| 5329 | -C "skip write certificate" \ |
| 5330 | -C "skip write certificate verify" \ |
| 5331 | -S "skip parse certificate verify" \ |
| 5332 | -S "x509_verify_cert() returned" \ |
| 5333 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5334 | -S "The certificate has been revoked (is on a CRL)" |
| 5335 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5336 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5337 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5338 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5339 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 5340 | ca_file=data_files/test-ca.crt \ |
| 5341 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 5342 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5343 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5344 | 1 \ |
| 5345 | -S "skip write certificate request" \ |
| 5346 | -C "skip parse certificate request" \ |
| 5347 | -c "got a certificate request" \ |
| 5348 | -C "skip write certificate" \ |
| 5349 | -C "skip write certificate verify" \ |
| 5350 | -S "skip parse certificate verify" \ |
| 5351 | -s "x509_verify_cert() returned" \ |
| 5352 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5353 | -s "The certificate has been revoked (is on a CRL)" |
| 5354 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5355 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 5356 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5357 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5358 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5359 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 5360 | "$P_CLI nbio=2 tickets=0" \ |
| 5361 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5362 | -S "mbedtls_ssl_handshake returned" \ |
| 5363 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5364 | -c "Read from server: .* bytes read" |
| 5365 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5366 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5367 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5368 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 5369 | "$P_CLI nbio=2 tickets=0" \ |
| 5370 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5371 | -S "mbedtls_ssl_handshake returned" \ |
| 5372 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5373 | -c "Read from server: .* bytes read" |
| 5374 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5375 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5376 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5377 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 5378 | "$P_CLI nbio=2 tickets=1" \ |
| 5379 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5380 | -S "mbedtls_ssl_handshake returned" \ |
| 5381 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5382 | -c "Read from server: .* bytes read" |
| 5383 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5384 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5385 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5386 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 5387 | "$P_CLI nbio=2 tickets=1" \ |
| 5388 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5389 | -S "mbedtls_ssl_handshake returned" \ |
| 5390 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5391 | -c "Read from server: .* bytes read" |
| 5392 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5393 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5394 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5395 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 5396 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 5397 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5398 | -S "mbedtls_ssl_handshake returned" \ |
| 5399 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5400 | -c "Read from server: .* bytes read" |
| 5401 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5402 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5403 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5404 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 5405 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 5406 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5407 | -S "mbedtls_ssl_handshake returned" \ |
| 5408 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5409 | -c "Read from server: .* bytes read" |
| 5410 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5411 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5412 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5413 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 5414 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 5415 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5416 | -S "mbedtls_ssl_handshake returned" \ |
| 5417 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5418 | -c "Read from server: .* bytes read" |
| 5419 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5420 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 5421 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5422 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5423 | run_test "Event-driven I/O: basic handshake" \ |
| 5424 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 5425 | "$P_CLI event=1 tickets=0" \ |
| 5426 | 0 \ |
| 5427 | -S "mbedtls_ssl_handshake returned" \ |
| 5428 | -C "mbedtls_ssl_handshake returned" \ |
| 5429 | -c "Read from server: .* bytes read" |
| 5430 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5431 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5432 | run_test "Event-driven I/O: client auth" \ |
| 5433 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 5434 | "$P_CLI event=1 tickets=0" \ |
| 5435 | 0 \ |
| 5436 | -S "mbedtls_ssl_handshake returned" \ |
| 5437 | -C "mbedtls_ssl_handshake returned" \ |
| 5438 | -c "Read from server: .* bytes read" |
| 5439 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5440 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5441 | run_test "Event-driven I/O: ticket" \ |
| 5442 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 5443 | "$P_CLI event=1 tickets=1" \ |
| 5444 | 0 \ |
| 5445 | -S "mbedtls_ssl_handshake returned" \ |
| 5446 | -C "mbedtls_ssl_handshake returned" \ |
| 5447 | -c "Read from server: .* bytes read" |
| 5448 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5449 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5450 | run_test "Event-driven I/O: ticket + client auth" \ |
| 5451 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 5452 | "$P_CLI event=1 tickets=1" \ |
| 5453 | 0 \ |
| 5454 | -S "mbedtls_ssl_handshake returned" \ |
| 5455 | -C "mbedtls_ssl_handshake returned" \ |
| 5456 | -c "Read from server: .* bytes read" |
| 5457 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5458 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5459 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 5460 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 5461 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 5462 | 0 \ |
| 5463 | -S "mbedtls_ssl_handshake returned" \ |
| 5464 | -C "mbedtls_ssl_handshake returned" \ |
| 5465 | -c "Read from server: .* bytes read" |
| 5466 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5467 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5468 | run_test "Event-driven I/O: ticket + resume" \ |
| 5469 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 5470 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 5471 | 0 \ |
| 5472 | -S "mbedtls_ssl_handshake returned" \ |
| 5473 | -C "mbedtls_ssl_handshake returned" \ |
| 5474 | -c "Read from server: .* bytes read" |
| 5475 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5476 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5477 | run_test "Event-driven I/O: session-id resume" \ |
| 5478 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 5479 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 5480 | 0 \ |
| 5481 | -S "mbedtls_ssl_handshake returned" \ |
| 5482 | -C "mbedtls_ssl_handshake returned" \ |
| 5483 | -c "Read from server: .* bytes read" |
| 5484 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5485 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5486 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 5487 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 5488 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 5489 | 0 \ |
| 5490 | -c "Read from server: .* bytes read" |
| 5491 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5492 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5493 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 5494 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 5495 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 5496 | 0 \ |
| 5497 | -c "Read from server: .* bytes read" |
| 5498 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5499 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5500 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 5501 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 5502 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 5503 | 0 \ |
| 5504 | -c "Read from server: .* bytes read" |
| 5505 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5506 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5507 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 5508 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 5509 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 5510 | 0 \ |
| 5511 | -c "Read from server: .* bytes read" |
| 5512 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5513 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5514 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 5515 | "$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] | 5516 | "$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] | 5517 | 0 \ |
| 5518 | -c "Read from server: .* bytes read" |
| 5519 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5520 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5521 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 5522 | "$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] | 5523 | "$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] | 5524 | 0 \ |
| 5525 | -c "Read from server: .* bytes read" |
| 5526 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5527 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5528 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 5529 | "$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] | 5530 | "$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] | 5531 | 0 \ |
| 5532 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5533 | |
| 5534 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 5535 | # During session resumption, the client will send its ApplicationData record |
| 5536 | # within the same datagram as the Finished messages. In this situation, the |
| 5537 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 5538 | # because the ApplicationData request has already been queued internally. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5539 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5540 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 5541 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5542 | "$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] | 5543 | "$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] | 5544 | 0 \ |
| 5545 | -c "Read from server: .* bytes read" |
| 5546 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5547 | # Tests for version negotiation |
| 5548 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5549 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5550 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5551 | "$P_SRV" \ |
| 5552 | "$P_CLI" \ |
| 5553 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5554 | -S "mbedtls_ssl_handshake returned" \ |
| 5555 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5556 | -s "Protocol is TLSv1.2" \ |
| 5557 | -c "Protocol is TLSv1.2" |
| 5558 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5559 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 5560 | run_test "Not supported version check: cli TLS 1.0" \ |
| 5561 | "$P_SRV" \ |
| 5562 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 5563 | 1 \ |
| 5564 | -s "Handshake protocol not within min/max boundaries" \ |
| 5565 | -c "Error in protocol version" \ |
| 5566 | -S "Protocol is TLSv1.0" \ |
| 5567 | -C "Handshake was completed" |
| 5568 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5569 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 5570 | run_test "Not supported version check: cli TLS 1.1" \ |
| 5571 | "$P_SRV" \ |
| 5572 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 5573 | 1 \ |
| 5574 | -s "Handshake protocol not within min/max boundaries" \ |
| 5575 | -c "Error in protocol version" \ |
| 5576 | -S "Protocol is TLSv1.1" \ |
| 5577 | -C "Handshake was completed" |
| 5578 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5579 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 5580 | run_test "Not supported version check: srv max TLS 1.0" \ |
| 5581 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 5582 | "$P_CLI" \ |
| 5583 | 1 \ |
| 5584 | -s "Error in protocol version" \ |
| 5585 | -c "Handshake protocol not within min/max boundaries" \ |
| 5586 | -S "Version: TLS1.0" \ |
| 5587 | -C "Protocol is TLSv1.0" |
| 5588 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5589 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 5590 | run_test "Not supported version check: srv max TLS 1.1" \ |
| 5591 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 5592 | "$P_CLI" \ |
| 5593 | 1 \ |
| 5594 | -s "Error in protocol version" \ |
| 5595 | -c "Handshake protocol not within min/max boundaries" \ |
| 5596 | -S "Version: TLS1.1" \ |
| 5597 | -C "Protocol is TLSv1.1" |
| 5598 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5599 | # Tests for ALPN extension |
| 5600 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5601 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5602 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5603 | "$P_SRV debug_level=3" \ |
| 5604 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5605 | 0 \ |
| 5606 | -C "client hello, adding alpn extension" \ |
| 5607 | -S "found alpn extension" \ |
| 5608 | -C "got an alert message, type: \\[2:120]" \ |
| 5609 | -S "server hello, adding alpn extension" \ |
| 5610 | -C "found alpn extension " \ |
| 5611 | -C "Application Layer Protocol is" \ |
| 5612 | -S "Application Layer Protocol is" |
| 5613 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5614 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5615 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5616 | "$P_SRV debug_level=3" \ |
| 5617 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5618 | 0 \ |
| 5619 | -c "client hello, adding alpn extension" \ |
| 5620 | -s "found alpn extension" \ |
| 5621 | -C "got an alert message, type: \\[2:120]" \ |
| 5622 | -S "server hello, adding alpn extension" \ |
| 5623 | -C "found alpn extension " \ |
| 5624 | -c "Application Layer Protocol is (none)" \ |
| 5625 | -S "Application Layer Protocol is" |
| 5626 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5627 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5628 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5629 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5630 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5631 | 0 \ |
| 5632 | -C "client hello, adding alpn extension" \ |
| 5633 | -S "found alpn extension" \ |
| 5634 | -C "got an alert message, type: \\[2:120]" \ |
| 5635 | -S "server hello, adding alpn extension" \ |
| 5636 | -C "found alpn extension " \ |
| 5637 | -C "Application Layer Protocol is" \ |
| 5638 | -s "Application Layer Protocol is (none)" |
| 5639 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5640 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5641 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5642 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5643 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5644 | 0 \ |
| 5645 | -c "client hello, adding alpn extension" \ |
| 5646 | -s "found alpn extension" \ |
| 5647 | -C "got an alert message, type: \\[2:120]" \ |
| 5648 | -s "server hello, adding alpn extension" \ |
| 5649 | -c "found alpn extension" \ |
| 5650 | -c "Application Layer Protocol is abc" \ |
| 5651 | -s "Application Layer Protocol is abc" |
| 5652 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5653 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5654 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5655 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5656 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5657 | 0 \ |
| 5658 | -c "client hello, adding alpn extension" \ |
| 5659 | -s "found alpn extension" \ |
| 5660 | -C "got an alert message, type: \\[2:120]" \ |
| 5661 | -s "server hello, adding alpn extension" \ |
| 5662 | -c "found alpn extension" \ |
| 5663 | -c "Application Layer Protocol is abc" \ |
| 5664 | -s "Application Layer Protocol is abc" |
| 5665 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5666 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5667 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5668 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5669 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5670 | 0 \ |
| 5671 | -c "client hello, adding alpn extension" \ |
| 5672 | -s "found alpn extension" \ |
| 5673 | -C "got an alert message, type: \\[2:120]" \ |
| 5674 | -s "server hello, adding alpn extension" \ |
| 5675 | -c "found alpn extension" \ |
| 5676 | -c "Application Layer Protocol is 1234" \ |
| 5677 | -s "Application Layer Protocol is 1234" |
| 5678 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5679 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5680 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5681 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 5682 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5683 | 1 \ |
| 5684 | -c "client hello, adding alpn extension" \ |
| 5685 | -s "found alpn extension" \ |
| 5686 | -c "got an alert message, type: \\[2:120]" \ |
| 5687 | -S "server hello, adding alpn extension" \ |
| 5688 | -C "found alpn extension" \ |
| 5689 | -C "Application Layer Protocol is 1234" \ |
| 5690 | -S "Application Layer Protocol is 1234" |
| 5691 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 5692 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5693 | # Tests for keyUsage in leaf certificates, part 1: |
| 5694 | # server-side certificate/suite selection |
| 5695 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5696 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5697 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5698 | "$P_SRV key_file=data_files/server2.key \ |
| 5699 | crt_file=data_files/server2.ku-ds.crt" \ |
| 5700 | "$P_CLI" \ |
| 5701 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 5702 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5703 | |
| 5704 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5705 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5706 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5707 | "$P_SRV key_file=data_files/server2.key \ |
| 5708 | crt_file=data_files/server2.ku-ke.crt" \ |
| 5709 | "$P_CLI" \ |
| 5710 | 0 \ |
| 5711 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 5712 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5713 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5714 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5715 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5716 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5717 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5718 | 1 \ |
| 5719 | -C "Ciphersuite is " |
| 5720 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5721 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5722 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5723 | "$P_SRV key_file=data_files/server5.key \ |
| 5724 | crt_file=data_files/server5.ku-ds.crt" \ |
| 5725 | "$P_CLI" \ |
| 5726 | 0 \ |
| 5727 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 5728 | |
| 5729 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5730 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5731 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5732 | "$P_SRV key_file=data_files/server5.key \ |
| 5733 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5734 | "$P_CLI" \ |
| 5735 | 0 \ |
| 5736 | -c "Ciphersuite is TLS-ECDH-" |
| 5737 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5738 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5739 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5740 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5741 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5742 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5743 | 1 \ |
| 5744 | -C "Ciphersuite is " |
| 5745 | |
| 5746 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5747 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5748 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5749 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5750 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5751 | "$O_SRV -key data_files/server2.key \ |
| 5752 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5753 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5754 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5755 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5756 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5757 | -C "Processing of the Certificate handshake message failed" \ |
| 5758 | -c "Ciphersuite is TLS-" |
| 5759 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5760 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5761 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5762 | "$O_SRV -key data_files/server2.key \ |
| 5763 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5764 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5765 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5766 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5767 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5768 | -C "Processing of the Certificate handshake message failed" \ |
| 5769 | -c "Ciphersuite is TLS-" |
| 5770 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5771 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5772 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5773 | "$O_SRV -key data_files/server2.key \ |
| 5774 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5775 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5776 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5777 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5778 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5779 | -C "Processing of the Certificate handshake message failed" \ |
| 5780 | -c "Ciphersuite is TLS-" |
| 5781 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5782 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5783 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5784 | "$O_SRV -key data_files/server2.key \ |
| 5785 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5786 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5787 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5788 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5789 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5790 | -c "Processing of the Certificate handshake message failed" \ |
| 5791 | -C "Ciphersuite is TLS-" |
| 5792 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5793 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5794 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 5795 | "$O_SRV -key data_files/server2.key \ |
| 5796 | -cert data_files/server2.ku-ke.crt" \ |
| 5797 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5798 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5799 | 0 \ |
| 5800 | -c "bad certificate (usage extensions)" \ |
| 5801 | -C "Processing of the Certificate handshake message failed" \ |
| 5802 | -c "Ciphersuite is TLS-" \ |
| 5803 | -c "! Usage does not match the keyUsage extension" |
| 5804 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5805 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5806 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5807 | "$O_SRV -key data_files/server2.key \ |
| 5808 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5809 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5810 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5811 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5812 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5813 | -C "Processing of the Certificate handshake message failed" \ |
| 5814 | -c "Ciphersuite is TLS-" |
| 5815 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5816 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5817 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5818 | "$O_SRV -key data_files/server2.key \ |
| 5819 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5820 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5821 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5822 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5823 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5824 | -c "Processing of the Certificate handshake message failed" \ |
| 5825 | -C "Ciphersuite is TLS-" |
| 5826 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5827 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5828 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 5829 | "$O_SRV -key data_files/server2.key \ |
| 5830 | -cert data_files/server2.ku-ds.crt" \ |
| 5831 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5832 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5833 | 0 \ |
| 5834 | -c "bad certificate (usage extensions)" \ |
| 5835 | -C "Processing of the Certificate handshake message failed" \ |
| 5836 | -c "Ciphersuite is TLS-" \ |
| 5837 | -c "! Usage does not match the keyUsage extension" |
| 5838 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5839 | # Tests for keyUsage in leaf certificates, part 3: |
| 5840 | # server-side checking of client cert |
| 5841 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5842 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5843 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5844 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5845 | "$O_CLI -key data_files/server2.key \ |
| 5846 | -cert data_files/server2.ku-ds.crt" \ |
| 5847 | 0 \ |
| 5848 | -S "bad certificate (usage extensions)" \ |
| 5849 | -S "Processing of the Certificate handshake message failed" |
| 5850 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5851 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5852 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5853 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5854 | "$O_CLI -key data_files/server2.key \ |
| 5855 | -cert data_files/server2.ku-ke.crt" \ |
| 5856 | 0 \ |
| 5857 | -s "bad certificate (usage extensions)" \ |
| 5858 | -S "Processing of the Certificate handshake message failed" |
| 5859 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5860 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5861 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5862 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5863 | "$O_CLI -key data_files/server2.key \ |
| 5864 | -cert data_files/server2.ku-ke.crt" \ |
| 5865 | 1 \ |
| 5866 | -s "bad certificate (usage extensions)" \ |
| 5867 | -s "Processing of the Certificate handshake message failed" |
| 5868 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5869 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5870 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5871 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5872 | "$O_CLI -key data_files/server5.key \ |
| 5873 | -cert data_files/server5.ku-ds.crt" \ |
| 5874 | 0 \ |
| 5875 | -S "bad certificate (usage extensions)" \ |
| 5876 | -S "Processing of the Certificate handshake message failed" |
| 5877 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5878 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5879 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5880 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5881 | "$O_CLI -key data_files/server5.key \ |
| 5882 | -cert data_files/server5.ku-ka.crt" \ |
| 5883 | 0 \ |
| 5884 | -s "bad certificate (usage extensions)" \ |
| 5885 | -S "Processing of the Certificate handshake message failed" |
| 5886 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5887 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 5888 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5889 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5890 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5891 | "$P_SRV key_file=data_files/server5.key \ |
| 5892 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5893 | "$P_CLI" \ |
| 5894 | 0 |
| 5895 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5896 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5897 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5898 | "$P_SRV key_file=data_files/server5.key \ |
| 5899 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5900 | "$P_CLI" \ |
| 5901 | 0 |
| 5902 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5903 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5904 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5905 | "$P_SRV key_file=data_files/server5.key \ |
| 5906 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 5907 | "$P_CLI" \ |
| 5908 | 0 |
| 5909 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5910 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5911 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5912 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5913 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5914 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5915 | 1 |
| 5916 | |
| 5917 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 5918 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5919 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5920 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5921 | "$O_SRV -key data_files/server5.key \ |
| 5922 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5923 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5924 | 0 \ |
| 5925 | -C "bad certificate (usage extensions)" \ |
| 5926 | -C "Processing of the Certificate handshake message failed" \ |
| 5927 | -c "Ciphersuite is TLS-" |
| 5928 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5929 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5930 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5931 | "$O_SRV -key data_files/server5.key \ |
| 5932 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5933 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5934 | 0 \ |
| 5935 | -C "bad certificate (usage extensions)" \ |
| 5936 | -C "Processing of the Certificate handshake message failed" \ |
| 5937 | -c "Ciphersuite is TLS-" |
| 5938 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5939 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5940 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5941 | "$O_SRV -key data_files/server5.key \ |
| 5942 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5943 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5944 | 0 \ |
| 5945 | -C "bad certificate (usage extensions)" \ |
| 5946 | -C "Processing of the Certificate handshake message failed" \ |
| 5947 | -c "Ciphersuite is TLS-" |
| 5948 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5949 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5950 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5951 | "$O_SRV -key data_files/server5.key \ |
| 5952 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5953 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5954 | 1 \ |
| 5955 | -c "bad certificate (usage extensions)" \ |
| 5956 | -c "Processing of the Certificate handshake message failed" \ |
| 5957 | -C "Ciphersuite is TLS-" |
| 5958 | |
| 5959 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 5960 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5961 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5962 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5963 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5964 | "$O_CLI -key data_files/server5.key \ |
| 5965 | -cert data_files/server5.eku-cli.crt" \ |
| 5966 | 0 \ |
| 5967 | -S "bad certificate (usage extensions)" \ |
| 5968 | -S "Processing of the Certificate handshake message failed" |
| 5969 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5970 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5971 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5972 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5973 | "$O_CLI -key data_files/server5.key \ |
| 5974 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 5975 | 0 \ |
| 5976 | -S "bad certificate (usage extensions)" \ |
| 5977 | -S "Processing of the Certificate handshake message failed" |
| 5978 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5979 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5980 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5981 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5982 | "$O_CLI -key data_files/server5.key \ |
| 5983 | -cert data_files/server5.eku-cs_any.crt" \ |
| 5984 | 0 \ |
| 5985 | -S "bad certificate (usage extensions)" \ |
| 5986 | -S "Processing of the Certificate handshake message failed" |
| 5987 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5988 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5989 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5990 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5991 | "$O_CLI -key data_files/server5.key \ |
| 5992 | -cert data_files/server5.eku-cs.crt" \ |
| 5993 | 0 \ |
| 5994 | -s "bad certificate (usage extensions)" \ |
| 5995 | -S "Processing of the Certificate handshake message failed" |
| 5996 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5997 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5998 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5999 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6000 | "$O_CLI -key data_files/server5.key \ |
| 6001 | -cert data_files/server5.eku-cs.crt" \ |
| 6002 | 1 \ |
| 6003 | -s "bad certificate (usage extensions)" \ |
| 6004 | -s "Processing of the Certificate handshake message failed" |
| 6005 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6006 | # Tests for DHM parameters loading |
| 6007 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6008 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6009 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6010 | "$P_SRV" \ |
| 6011 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6012 | debug_level=3" \ |
| 6013 | 0 \ |
| 6014 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 6015 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6016 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6017 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6018 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6019 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 6020 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6021 | debug_level=3" \ |
| 6022 | 0 \ |
| 6023 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 6024 | -c "value of 'DHM: G ' (2 bits)" |
| 6025 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6026 | # Tests for DHM client-side size checking |
| 6027 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6028 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6029 | run_test "DHM size: server default, client default, OK" \ |
| 6030 | "$P_SRV" \ |
| 6031 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6032 | debug_level=1" \ |
| 6033 | 0 \ |
| 6034 | -C "DHM prime too short:" |
| 6035 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6036 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6037 | run_test "DHM size: server default, client 2048, OK" \ |
| 6038 | "$P_SRV" \ |
| 6039 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6040 | debug_level=1 dhmlen=2048" \ |
| 6041 | 0 \ |
| 6042 | -C "DHM prime too short:" |
| 6043 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6044 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6045 | run_test "DHM size: server 1024, client default, OK" \ |
| 6046 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 6047 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6048 | debug_level=1" \ |
| 6049 | 0 \ |
| 6050 | -C "DHM prime too short:" |
| 6051 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6052 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6053 | run_test "DHM size: server 999, client 999, OK" \ |
| 6054 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 6055 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6056 | debug_level=1 dhmlen=999" \ |
| 6057 | 0 \ |
| 6058 | -C "DHM prime too short:" |
| 6059 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6060 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6061 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 6062 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 6063 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6064 | debug_level=1 dhmlen=1000" \ |
| 6065 | 0 \ |
| 6066 | -C "DHM prime too short:" |
| 6067 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6068 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6069 | run_test "DHM size: server 1000, client default, rejected" \ |
| 6070 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 6071 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6072 | debug_level=1" \ |
| 6073 | 1 \ |
| 6074 | -c "DHM prime too short:" |
| 6075 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6076 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6077 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 6078 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 6079 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6080 | debug_level=1 dhmlen=1001" \ |
| 6081 | 1 \ |
| 6082 | -c "DHM prime too short:" |
| 6083 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6084 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6085 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 6086 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 6087 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6088 | debug_level=1 dhmlen=1000" \ |
| 6089 | 1 \ |
| 6090 | -c "DHM prime too short:" |
| 6091 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6092 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6093 | run_test "DHM size: server 998, client 999, rejected" \ |
| 6094 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 6095 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6096 | debug_level=1 dhmlen=999" \ |
| 6097 | 1 \ |
| 6098 | -c "DHM prime too short:" |
| 6099 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6100 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6101 | run_test "DHM size: server default, client 2049, rejected" \ |
| 6102 | "$P_SRV" \ |
| 6103 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6104 | debug_level=1 dhmlen=2049" \ |
| 6105 | 1 \ |
| 6106 | -c "DHM prime too short:" |
| 6107 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6108 | # Tests for PSK callback |
| 6109 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6110 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6111 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6112 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 6113 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6114 | psk_identity=foo psk=abc123" \ |
| 6115 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6116 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 6117 | -S "SSL - Unknown identity received" \ |
| 6118 | -S "SSL - Verification of the message MAC failed" |
| 6119 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6120 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6121 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6122 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 6123 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6124 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 6125 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6126 | 0 \ |
| 6127 | -c "skip PMS generation for opaque PSK"\ |
| 6128 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6129 | -C "session hash for extended master secret"\ |
| 6130 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6131 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6132 | -S "SSL - Unknown identity received" \ |
| 6133 | -S "SSL - Verification of the message MAC failed" |
| 6134 | |
| 6135 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6136 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6137 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 6138 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6139 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 6140 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6141 | 0 \ |
| 6142 | -c "skip PMS generation for opaque PSK"\ |
| 6143 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6144 | -C "session hash for extended master secret"\ |
| 6145 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6146 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6147 | -S "SSL - Unknown identity received" \ |
| 6148 | -S "SSL - Verification of the message MAC failed" |
| 6149 | |
| 6150 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6151 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6152 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 6153 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6154 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 6155 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6156 | 0 \ |
| 6157 | -c "skip PMS generation for opaque PSK"\ |
| 6158 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6159 | -c "session hash for extended master secret"\ |
| 6160 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6161 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6162 | -S "SSL - Unknown identity received" \ |
| 6163 | -S "SSL - Verification of the message MAC failed" |
| 6164 | |
| 6165 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6166 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6167 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 6168 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6169 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 6170 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6171 | 0 \ |
| 6172 | -c "skip PMS generation for opaque PSK"\ |
| 6173 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6174 | -c "session hash for extended master secret"\ |
| 6175 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6176 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6177 | -S "SSL - Unknown identity received" \ |
| 6178 | -S "SSL - Verification of the message MAC failed" |
| 6179 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6180 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6181 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6182 | run_test "PSK callback: raw psk on client, static opaque on server, no callback" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6183 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 6184 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6185 | psk_identity=foo psk=abc123" \ |
| 6186 | 0 \ |
| 6187 | -C "skip PMS generation for opaque PSK"\ |
| 6188 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6189 | -C "session hash for extended master secret"\ |
| 6190 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6191 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6192 | -S "SSL - Unknown identity received" \ |
| 6193 | -S "SSL - Verification of the message MAC failed" |
| 6194 | |
| 6195 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6196 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6197 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, SHA-384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6198 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384" \ |
| 6199 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6200 | psk_identity=foo psk=abc123" \ |
| 6201 | 0 \ |
| 6202 | -C "skip PMS generation for opaque PSK"\ |
| 6203 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6204 | -C "session hash for extended master secret"\ |
| 6205 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6206 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6207 | -S "SSL - Unknown identity received" \ |
| 6208 | -S "SSL - Verification of the message MAC failed" |
| 6209 | |
| 6210 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6211 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6212 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, EMS" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6213 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6214 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6215 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6216 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 6217 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6218 | -c "session hash for extended master secret"\ |
| 6219 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6220 | -C "skip PMS generation for opaque PSK"\ |
| 6221 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6222 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6223 | -S "SSL - Unknown identity received" \ |
| 6224 | -S "SSL - Verification of the message MAC failed" |
| 6225 | |
| 6226 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6227 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6228 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, EMS, SHA384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6229 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6230 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6231 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6232 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 6233 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6234 | -c "session hash for extended master secret"\ |
| 6235 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6236 | -C "skip PMS generation for opaque PSK"\ |
| 6237 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6238 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6239 | -S "SSL - Unknown identity received" \ |
| 6240 | -S "SSL - Verification of the message MAC failed" |
| 6241 | |
| 6242 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6243 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6244 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6245 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 6246 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6247 | psk_identity=def psk=beef" \ |
| 6248 | 0 \ |
| 6249 | -C "skip PMS generation for opaque PSK"\ |
| 6250 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6251 | -C "session hash for extended master secret"\ |
| 6252 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6253 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6254 | -S "SSL - Unknown identity received" \ |
| 6255 | -S "SSL - Verification of the message MAC failed" |
| 6256 | |
| 6257 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6258 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6259 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, SHA-384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6260 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384" \ |
| 6261 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6262 | psk_identity=def psk=beef" \ |
| 6263 | 0 \ |
| 6264 | -C "skip PMS generation for opaque PSK"\ |
| 6265 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6266 | -C "session hash for extended master secret"\ |
| 6267 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6268 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6269 | -S "SSL - Unknown identity received" \ |
| 6270 | -S "SSL - Verification of the message MAC failed" |
| 6271 | |
| 6272 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6273 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6274 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, EMS" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6275 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6276 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6277 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6278 | psk_identity=abc psk=dead extended_ms=1" \ |
| 6279 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6280 | -c "session hash for extended master secret"\ |
| 6281 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6282 | -C "skip PMS generation for opaque PSK"\ |
| 6283 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6284 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6285 | -S "SSL - Unknown identity received" \ |
| 6286 | -S "SSL - Verification of the message MAC failed" |
| 6287 | |
| 6288 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6289 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6290 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, EMS, SHA384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6291 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6292 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6293 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6294 | psk_identity=abc psk=dead extended_ms=1" \ |
| 6295 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6296 | -c "session hash for extended master secret"\ |
| 6297 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6298 | -C "skip PMS generation for opaque PSK"\ |
| 6299 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6300 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6301 | -S "SSL - Unknown identity received" \ |
| 6302 | -S "SSL - Verification of the message MAC failed" |
| 6303 | |
| 6304 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6305 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6306 | run_test "PSK callback: raw psk on client, mismatching static raw PSK on server, opaque PSK from callback" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6307 | "$P_SRV extended_ms=0 psk_identity=foo psk=abc123 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 6308 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6309 | psk_identity=def psk=beef" \ |
| 6310 | 0 \ |
| 6311 | -C "skip PMS generation for opaque PSK"\ |
| 6312 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6313 | -C "session hash for extended master secret"\ |
| 6314 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6315 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6316 | -S "SSL - Unknown identity received" \ |
| 6317 | -S "SSL - Verification of the message MAC failed" |
| 6318 | |
| 6319 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6320 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6321 | run_test "PSK callback: raw psk on client, mismatching static opaque PSK on server, opaque PSK from callback" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6322 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=foo psk=abc123 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 6323 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6324 | psk_identity=def psk=beef" \ |
| 6325 | 0 \ |
| 6326 | -C "skip PMS generation for opaque PSK"\ |
| 6327 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6328 | -C "session hash for extended master secret"\ |
| 6329 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6330 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6331 | -S "SSL - Unknown identity received" \ |
| 6332 | -S "SSL - Verification of the message MAC failed" |
| 6333 | |
| 6334 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6335 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6336 | run_test "PSK callback: raw psk on client, mismatching static opaque PSK on server, raw PSK from callback" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6337 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=foo psk=abc123 debug_level=3 psk_list=abc,dead,def,beef min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 6338 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6339 | psk_identity=def psk=beef" \ |
| 6340 | 0 \ |
| 6341 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6342 | -C "session hash for extended master secret"\ |
| 6343 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6344 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6345 | -S "SSL - Unknown identity received" \ |
| 6346 | -S "SSL - Verification of the message MAC failed" |
| 6347 | |
| 6348 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6349 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6350 | run_test "PSK callback: raw psk on client, id-matching but wrong raw PSK on server, opaque PSK from callback" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6351 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=def psk=abc123 debug_level=3 psk_list=abc,dead,def,beef min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 6352 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6353 | psk_identity=def psk=beef" \ |
| 6354 | 0 \ |
| 6355 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6356 | -C "session hash for extended master secret"\ |
| 6357 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6358 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6359 | -S "SSL - Unknown identity received" \ |
| 6360 | -S "SSL - Verification of the message MAC failed" |
| 6361 | |
| 6362 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6363 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6364 | run_test "PSK callback: raw psk on client, matching opaque PSK on server, wrong opaque PSK from callback" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6365 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=def psk=beef debug_level=3 psk_list=abc,dead,def,abc123 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 6366 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6367 | psk_identity=def psk=beef" \ |
| 6368 | 1 \ |
| 6369 | -s "SSL - Verification of the message MAC failed" |
| 6370 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6371 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6372 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 6373 | "$P_SRV" \ |
| 6374 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6375 | psk_identity=foo psk=abc123" \ |
| 6376 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 6377 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6378 | -S "SSL - Unknown identity received" \ |
| 6379 | -S "SSL - Verification of the message MAC failed" |
| 6380 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6381 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6382 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6383 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 6384 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6385 | psk_identity=foo psk=abc123" \ |
| 6386 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6387 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6388 | -s "SSL - Unknown identity received" \ |
| 6389 | -S "SSL - Verification of the message MAC failed" |
| 6390 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6391 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6392 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6393 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6394 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6395 | psk_identity=abc psk=dead" \ |
| 6396 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6397 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6398 | -S "SSL - Unknown identity received" \ |
| 6399 | -S "SSL - Verification of the message MAC failed" |
| 6400 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6401 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6402 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6403 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6404 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6405 | psk_identity=def psk=beef" \ |
| 6406 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6407 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6408 | -S "SSL - Unknown identity received" \ |
| 6409 | -S "SSL - Verification of the message MAC failed" |
| 6410 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6411 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6412 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6413 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6414 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6415 | psk_identity=ghi psk=beef" \ |
| 6416 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6417 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6418 | -s "SSL - Unknown identity received" \ |
| 6419 | -S "SSL - Verification of the message MAC failed" |
| 6420 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6421 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6422 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6423 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6424 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6425 | psk_identity=abc psk=beef" \ |
| 6426 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6427 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6428 | -S "SSL - Unknown identity received" \ |
| 6429 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6430 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6431 | # Tests for EC J-PAKE |
| 6432 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6433 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6434 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6435 | run_test "ECJPAKE: client not configured" \ |
| 6436 | "$P_SRV debug_level=3" \ |
| 6437 | "$P_CLI debug_level=3" \ |
| 6438 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6439 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6440 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6441 | -S "found ecjpake kkpp extension" \ |
| 6442 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6443 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6444 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6445 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 6446 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6447 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6448 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6449 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6450 | run_test "ECJPAKE: server not configured" \ |
| 6451 | "$P_SRV debug_level=3" \ |
| 6452 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 6453 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6454 | 1 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6455 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6456 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6457 | -s "found ecjpake kkpp extension" \ |
| 6458 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6459 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6460 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6461 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 6462 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6463 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6464 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6465 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6466 | run_test "ECJPAKE: working, TLS" \ |
| 6467 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 6468 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 6469 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 6470 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6471 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6472 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6473 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6474 | -s "found ecjpake kkpp extension" \ |
| 6475 | -S "skip ecjpake kkpp extension" \ |
| 6476 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6477 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6478 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 6479 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6480 | -S "SSL - Verification of the message MAC failed" |
| 6481 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6482 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6483 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6484 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6485 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 6486 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 6487 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 6488 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6489 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6490 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6491 | -s "SSL - Verification of the message MAC failed" |
| 6492 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6493 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6494 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6495 | run_test "ECJPAKE: working, DTLS" \ |
| 6496 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 6497 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 6498 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6499 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6500 | -c "re-using cached ecjpake parameters" \ |
| 6501 | -S "SSL - Verification of the message MAC failed" |
| 6502 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6503 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6504 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6505 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 6506 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 6507 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 6508 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6509 | 0 \ |
| 6510 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6511 | -S "SSL - Verification of the message MAC failed" |
| 6512 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6513 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6514 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6515 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6516 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 6517 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 6518 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 6519 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6520 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6521 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6522 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6523 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 6524 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6525 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6526 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 6527 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 6528 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 6529 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 6530 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6531 | 0 |
| 6532 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 6533 | # Test for ClientHello without extensions |
| 6534 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 6535 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6536 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 6537 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 6538 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6539 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 6540 | 0 \ |
| 6541 | -s "dumping 'client hello extensions' (0 bytes)" |
| 6542 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6543 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6544 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6545 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6546 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6547 | "$P_SRV" \ |
| 6548 | "$P_CLI request_size=100" \ |
| 6549 | 0 \ |
| 6550 | -s "Read from client: 100 bytes read$" |
| 6551 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6552 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6553 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6554 | "$P_SRV" \ |
| 6555 | "$P_CLI request_size=500" \ |
| 6556 | 0 \ |
| 6557 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6558 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6559 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6560 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6561 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6562 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6563 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6564 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6565 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6566 | 0 \ |
| 6567 | -s "Read from client: 1 bytes read" |
| 6568 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6569 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6570 | 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] | 6571 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6572 | "$P_CLI request_size=1 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6573 | 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] | 6574 | 0 \ |
| 6575 | -s "Read from client: 1 bytes read" |
| 6576 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6577 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6578 | 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] | 6579 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6580 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6581 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6582 | 0 \ |
| 6583 | -s "Read from client: 1 bytes read" |
| 6584 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6585 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6586 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6587 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6588 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6589 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6590 | 0 \ |
| 6591 | -s "Read from client: 1 bytes read" |
| 6592 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6593 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6594 | 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] | 6595 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6596 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6597 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6598 | 0 \ |
| 6599 | -s "Read from client: 1 bytes read" |
| 6600 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6601 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6602 | |
| 6603 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6604 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6605 | run_test "Small client packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6606 | "$P_SRV dtls=1 force_version=dtls12" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6607 | "$P_CLI dtls=1 request_size=1 \ |
| 6608 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6609 | 0 \ |
| 6610 | -s "Read from client: 1 bytes read" |
| 6611 | |
| 6612 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6613 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6614 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6615 | "$P_SRV dtls=1 force_version=dtls12 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6616 | "$P_CLI dtls=1 request_size=1 \ |
| 6617 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6618 | 0 \ |
| 6619 | -s "Read from client: 1 bytes read" |
| 6620 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6621 | # Tests for small server packets |
| 6622 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6623 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6624 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 6625 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6626 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6627 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6628 | 0 \ |
| 6629 | -c "Read from server: 1 bytes read" |
| 6630 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6631 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6632 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6633 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6634 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6635 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 6636 | 0 \ |
| 6637 | -c "Read from server: 1 bytes read" |
| 6638 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6639 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6640 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6641 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6642 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6643 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6644 | 0 \ |
| 6645 | -c "Read from server: 1 bytes read" |
| 6646 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6647 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6648 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 6649 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6650 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6651 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6652 | 0 \ |
| 6653 | -c "Read from server: 1 bytes read" |
| 6654 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6655 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6656 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 6657 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6658 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6659 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6660 | 0 \ |
| 6661 | -c "Read from server: 1 bytes read" |
| 6662 | |
| 6663 | # Tests for small server packets in DTLS |
| 6664 | |
| 6665 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6666 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6667 | run_test "Small server packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6668 | "$P_SRV dtls=1 response_size=1 force_version=dtls12" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6669 | "$P_CLI dtls=1 \ |
| 6670 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6671 | 0 \ |
| 6672 | -c "Read from server: 1 bytes read" |
| 6673 | |
| 6674 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6675 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6676 | run_test "Small server packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6677 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6678 | "$P_CLI dtls=1 \ |
| 6679 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6680 | 0 \ |
| 6681 | -c "Read from server: 1 bytes read" |
| 6682 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6683 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6684 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6685 | # How many fragments do we expect to write $1 bytes? |
| 6686 | fragments_for_write() { |
| 6687 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 6688 | } |
| 6689 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6690 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6691 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6692 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6693 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6694 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6695 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6696 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6697 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6698 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6699 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6700 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6701 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6702 | "$P_CLI request_size=16384 force_version=tls12 etm=0 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6703 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6704 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6705 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6706 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6707 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6708 | 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] | 6709 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6710 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6711 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6712 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6713 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6714 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6715 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6716 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6717 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6718 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6719 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6720 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6721 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6722 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6723 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6724 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6725 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6726 | 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] | 6727 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6728 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6729 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6730 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6731 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6732 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6733 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6734 | # The tests below fail when the server's OUT_CONTENT_LEN is less than 16384. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6735 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6736 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 6737 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6738 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6739 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6740 | 0 \ |
| 6741 | -c "Read from server: 16384 bytes read" |
| 6742 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6743 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6744 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6745 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6746 | "$P_CLI force_version=tls12 etm=0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6747 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6748 | 0 \ |
| 6749 | -s "16384 bytes written in 1 fragments" \ |
| 6750 | -c "Read from server: 16384 bytes read" |
| 6751 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6752 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6753 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6754 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6755 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6756 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6757 | 0 \ |
| 6758 | -c "Read from server: 16384 bytes read" |
| 6759 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6760 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6761 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 6762 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6763 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6764 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6765 | 0 \ |
| 6766 | -s "16384 bytes written in 1 fragments" \ |
| 6767 | -c "Read from server: 16384 bytes read" |
| 6768 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6769 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6770 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 6771 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6772 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6773 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6774 | 0 \ |
| 6775 | -c "Read from server: 16384 bytes read" |
| 6776 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6777 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6778 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 6779 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6780 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6781 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6782 | 0 \ |
| 6783 | -c "Read from server: 16384 bytes read" |
| 6784 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6785 | # Tests for restartable ECC |
| 6786 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6787 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 6788 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6789 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6790 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6791 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6792 | run_test "EC restart: TLS, default" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6793 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6794 | "$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] | 6795 | 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] | 6796 | debug_level=1" \ |
| 6797 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6798 | -C "x509_verify_cert.*4b00" \ |
| 6799 | -C "mbedtls_pk_verify.*4b00" \ |
| 6800 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6801 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6802 | |
| 6803 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6804 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6805 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6806 | run_test "EC restart: TLS, max_ops=0" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6807 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6808 | "$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] | 6809 | 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] | 6810 | debug_level=1 ec_max_ops=0" \ |
| 6811 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6812 | -C "x509_verify_cert.*4b00" \ |
| 6813 | -C "mbedtls_pk_verify.*4b00" \ |
| 6814 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6815 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6816 | |
| 6817 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6818 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6819 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6820 | run_test "EC restart: TLS, max_ops=65535" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6821 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6822 | "$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] | 6823 | 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] | 6824 | debug_level=1 ec_max_ops=65535" \ |
| 6825 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6826 | -C "x509_verify_cert.*4b00" \ |
| 6827 | -C "mbedtls_pk_verify.*4b00" \ |
| 6828 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6829 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6830 | |
| 6831 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6832 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6833 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6834 | run_test "EC restart: TLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6835 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6836 | "$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] | 6837 | 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] | 6838 | debug_level=1 ec_max_ops=1000" \ |
| 6839 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6840 | -c "x509_verify_cert.*4b00" \ |
| 6841 | -c "mbedtls_pk_verify.*4b00" \ |
| 6842 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6843 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6844 | |
| 6845 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6846 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6847 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6848 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6849 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6850 | crt_file=data_files/server5-badsign.crt \ |
| 6851 | key_file=data_files/server5.key" \ |
| 6852 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6853 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6854 | debug_level=1 ec_max_ops=1000" \ |
| 6855 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6856 | -c "x509_verify_cert.*4b00" \ |
| 6857 | -C "mbedtls_pk_verify.*4b00" \ |
| 6858 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6859 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6860 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6861 | -c "! mbedtls_ssl_handshake returned" \ |
| 6862 | -c "X509 - Certificate verification failed" |
| 6863 | |
| 6864 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6865 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6866 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6867 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6868 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6869 | crt_file=data_files/server5-badsign.crt \ |
| 6870 | key_file=data_files/server5.key" \ |
| 6871 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6872 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6873 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 6874 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6875 | -c "x509_verify_cert.*4b00" \ |
| 6876 | -c "mbedtls_pk_verify.*4b00" \ |
| 6877 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6878 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6879 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6880 | -C "! mbedtls_ssl_handshake returned" \ |
| 6881 | -C "X509 - Certificate verification failed" |
| 6882 | |
| 6883 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6884 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6885 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6886 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6887 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6888 | crt_file=data_files/server5-badsign.crt \ |
| 6889 | key_file=data_files/server5.key" \ |
| 6890 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6891 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6892 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 6893 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6894 | -C "x509_verify_cert.*4b00" \ |
| 6895 | -c "mbedtls_pk_verify.*4b00" \ |
| 6896 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6897 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6898 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6899 | -C "! mbedtls_ssl_handshake returned" \ |
| 6900 | -C "X509 - Certificate verification failed" |
| 6901 | |
| 6902 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6903 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6904 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6905 | run_test "EC restart: DTLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6906 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6907 | "$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] | 6908 | 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] | 6909 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 6910 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6911 | -c "x509_verify_cert.*4b00" \ |
| 6912 | -c "mbedtls_pk_verify.*4b00" \ |
| 6913 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6914 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6915 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6916 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6917 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6918 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6919 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6920 | "$P_SRV curves=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6921 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6922 | debug_level=1 ec_max_ops=1000" \ |
| 6923 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6924 | -c "x509_verify_cert.*4b00" \ |
| 6925 | -c "mbedtls_pk_verify.*4b00" \ |
| 6926 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6927 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6928 | |
| 6929 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6930 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6931 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6932 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6933 | "$P_SRV curves=secp256r1 psk=abc123" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6934 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 6935 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 6936 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6937 | -C "x509_verify_cert.*4b00" \ |
| 6938 | -C "mbedtls_pk_verify.*4b00" \ |
| 6939 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6940 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6941 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6942 | # Tests of asynchronous private key support in SSL |
| 6943 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6944 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6945 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6946 | run_test "SSL async private: sign, delay=0" \ |
| 6947 | "$P_SRV \ |
| 6948 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6949 | "$P_CLI" \ |
| 6950 | 0 \ |
| 6951 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6952 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6953 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6954 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6955 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6956 | run_test "SSL async private: sign, delay=1" \ |
| 6957 | "$P_SRV \ |
| 6958 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6959 | "$P_CLI" \ |
| 6960 | 0 \ |
| 6961 | -s "Async sign callback: using key slot " \ |
| 6962 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6963 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6964 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 6965 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6966 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 6967 | run_test "SSL async private: sign, delay=2" \ |
| 6968 | "$P_SRV \ |
| 6969 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 6970 | "$P_CLI" \ |
| 6971 | 0 \ |
| 6972 | -s "Async sign callback: using key slot " \ |
| 6973 | -U "Async sign callback: using key slot " \ |
| 6974 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 6975 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6976 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6977 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6978 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6979 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6980 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 6981 | run_test "SSL async private: sign, SNI" \ |
| 6982 | "$P_SRV debug_level=3 \ |
| 6983 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 6984 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6985 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6986 | "$P_CLI server_name=polarssl.example" \ |
| 6987 | 0 \ |
| 6988 | -s "Async sign callback: using key slot " \ |
| 6989 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6990 | -s "parse ServerName extension" \ |
| 6991 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6992 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6993 | |
| 6994 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6995 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6996 | run_test "SSL async private: decrypt, delay=0" \ |
| 6997 | "$P_SRV \ |
| 6998 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6999 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7000 | 0 \ |
| 7001 | -s "Async decrypt callback: using key slot " \ |
| 7002 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7003 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7004 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7005 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7006 | run_test "SSL async private: decrypt, delay=1" \ |
| 7007 | "$P_SRV \ |
| 7008 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7009 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7010 | 0 \ |
| 7011 | -s "Async decrypt callback: using key slot " \ |
| 7012 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7013 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7014 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7015 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7016 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7017 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 7018 | "$P_SRV psk=abc123 \ |
| 7019 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 7020 | "$P_CLI psk=abc123 \ |
| 7021 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 7022 | 0 \ |
| 7023 | -s "Async decrypt callback: using key slot " \ |
| 7024 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7025 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7026 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7027 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7028 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 7029 | "$P_SRV psk=abc123 \ |
| 7030 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7031 | "$P_CLI psk=abc123 \ |
| 7032 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 7033 | 0 \ |
| 7034 | -s "Async decrypt callback: using key slot " \ |
| 7035 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7036 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7037 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7038 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7039 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7040 | run_test "SSL async private: sign callback not present" \ |
| 7041 | "$P_SRV \ |
| 7042 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7043 | "$P_CLI; [ \$? -eq 1 ] && |
| 7044 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7045 | 0 \ |
| 7046 | -S "Async sign callback" \ |
| 7047 | -s "! mbedtls_ssl_handshake returned" \ |
| 7048 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 7049 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 7050 | -s "Successful connection" |
| 7051 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7052 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7053 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7054 | run_test "SSL async private: decrypt callback not present" \ |
| 7055 | "$P_SRV debug_level=1 \ |
| 7056 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 7057 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 7058 | [ \$? -eq 1 ] && $P_CLI" \ |
| 7059 | 0 \ |
| 7060 | -S "Async decrypt callback" \ |
| 7061 | -s "! mbedtls_ssl_handshake returned" \ |
| 7062 | -s "got no RSA private key" \ |
| 7063 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 7064 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7065 | |
| 7066 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7067 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7068 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7069 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7070 | "$P_SRV \ |
| 7071 | async_operations=s async_private_delay1=1 \ |
| 7072 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7073 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7074 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7075 | 0 \ |
| 7076 | -s "Async sign callback: using key slot 0," \ |
| 7077 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7078 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7079 | |
| 7080 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7081 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7082 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7083 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7084 | "$P_SRV \ |
| 7085 | async_operations=s async_private_delay2=1 \ |
| 7086 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7087 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7088 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7089 | 0 \ |
| 7090 | -s "Async sign callback: using key slot 0," \ |
| 7091 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7092 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7093 | |
| 7094 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7095 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7096 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 7097 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7098 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 7099 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7100 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7101 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7102 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7103 | 0 \ |
| 7104 | -s "Async sign callback: using key slot 1," \ |
| 7105 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7106 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7107 | |
| 7108 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7109 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7110 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7111 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7112 | "$P_SRV \ |
| 7113 | async_operations=s async_private_delay1=1 \ |
| 7114 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7115 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7116 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7117 | 0 \ |
| 7118 | -s "Async sign callback: no key matches this certificate." |
| 7119 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7120 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7121 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7122 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7123 | "$P_SRV \ |
| 7124 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7125 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7126 | "$P_CLI" \ |
| 7127 | 1 \ |
| 7128 | -s "Async sign callback: injected error" \ |
| 7129 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 7130 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7131 | -s "! mbedtls_ssl_handshake returned" |
| 7132 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7133 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7134 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7135 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7136 | "$P_SRV \ |
| 7137 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7138 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7139 | "$P_CLI" \ |
| 7140 | 1 \ |
| 7141 | -s "Async sign callback: using key slot " \ |
| 7142 | -S "Async resume" \ |
| 7143 | -s "Async cancel" |
| 7144 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7145 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7146 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7147 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7148 | "$P_SRV \ |
| 7149 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7150 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7151 | "$P_CLI" \ |
| 7152 | 1 \ |
| 7153 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7154 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 7155 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7156 | -s "! mbedtls_ssl_handshake returned" |
| 7157 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7158 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7159 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7160 | run_test "SSL async private: decrypt, error in start" \ |
| 7161 | "$P_SRV \ |
| 7162 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7163 | async_private_error=1" \ |
| 7164 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7165 | 1 \ |
| 7166 | -s "Async decrypt callback: injected error" \ |
| 7167 | -S "Async resume" \ |
| 7168 | -S "Async cancel" \ |
| 7169 | -s "! mbedtls_ssl_handshake returned" |
| 7170 | |
| 7171 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7172 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7173 | run_test "SSL async private: decrypt, cancel after start" \ |
| 7174 | "$P_SRV \ |
| 7175 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7176 | async_private_error=2" \ |
| 7177 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7178 | 1 \ |
| 7179 | -s "Async decrypt callback: using key slot " \ |
| 7180 | -S "Async resume" \ |
| 7181 | -s "Async cancel" |
| 7182 | |
| 7183 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7184 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7185 | run_test "SSL async private: decrypt, error in resume" \ |
| 7186 | "$P_SRV \ |
| 7187 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7188 | async_private_error=3" \ |
| 7189 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7190 | 1 \ |
| 7191 | -s "Async decrypt callback: using key slot " \ |
| 7192 | -s "Async resume callback: decrypt done but injected error" \ |
| 7193 | -S "Async cancel" \ |
| 7194 | -s "! mbedtls_ssl_handshake returned" |
| 7195 | |
| 7196 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7197 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7198 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7199 | "$P_SRV \ |
| 7200 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7201 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7202 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 7203 | 0 \ |
| 7204 | -s "Async cancel" \ |
| 7205 | -s "! mbedtls_ssl_handshake returned" \ |
| 7206 | -s "Async resume" \ |
| 7207 | -s "Successful connection" |
| 7208 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7209 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7210 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7211 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7212 | "$P_SRV \ |
| 7213 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7214 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7215 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 7216 | 0 \ |
| 7217 | -s "! mbedtls_ssl_handshake returned" \ |
| 7218 | -s "Async resume" \ |
| 7219 | -s "Successful connection" |
| 7220 | |
| 7221 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7222 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7223 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7224 | 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] | 7225 | "$P_SRV \ |
| 7226 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 7227 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7228 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7229 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 7230 | [ \$? -eq 1 ] && |
| 7231 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7232 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 7233 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7234 | -S "Async resume" \ |
| 7235 | -s "Async cancel" \ |
| 7236 | -s "! mbedtls_ssl_handshake returned" \ |
| 7237 | -s "Async sign callback: no key matches this certificate." \ |
| 7238 | -s "Successful connection" |
| 7239 | |
| 7240 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7241 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7242 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7243 | 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] | 7244 | "$P_SRV \ |
| 7245 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 7246 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7247 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7248 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 7249 | [ \$? -eq 1 ] && |
| 7250 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7251 | 0 \ |
| 7252 | -s "Async resume" \ |
| 7253 | -s "! mbedtls_ssl_handshake returned" \ |
| 7254 | -s "Async sign callback: no key matches this certificate." \ |
| 7255 | -s "Successful connection" |
| 7256 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7257 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7258 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7259 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7260 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7261 | "$P_SRV \ |
| 7262 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7263 | exchanges=2 renegotiation=1" \ |
| 7264 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7265 | 0 \ |
| 7266 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7267 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7268 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7269 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7270 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7271 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7272 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7273 | "$P_SRV \ |
| 7274 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7275 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7276 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 7277 | 0 \ |
| 7278 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7279 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7280 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7281 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7282 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7283 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7284 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7285 | "$P_SRV \ |
| 7286 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7287 | exchanges=2 renegotiation=1" \ |
| 7288 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 7289 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7290 | 0 \ |
| 7291 | -s "Async decrypt callback: using key slot " \ |
| 7292 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7293 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7294 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7295 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7296 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7297 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7298 | "$P_SRV \ |
| 7299 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7300 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7301 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 7302 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7303 | 0 \ |
| 7304 | -s "Async decrypt callback: using key slot " \ |
| 7305 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7306 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7307 | # Tests for ECC extensions (rfc 4492) |
| 7308 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7309 | requires_config_enabled MBEDTLS_AES_C |
| 7310 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7311 | requires_config_enabled MBEDTLS_SHA256_C |
| 7312 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7313 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7314 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 7315 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7316 | "$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] | 7317 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 7318 | -C "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7319 | -C "client hello, adding supported_point_formats extension" \ |
| 7320 | -S "found supported elliptic curves extension" \ |
| 7321 | -S "found supported point formats extension" |
| 7322 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7323 | requires_config_enabled MBEDTLS_AES_C |
| 7324 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7325 | requires_config_enabled MBEDTLS_SHA256_C |
| 7326 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7327 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7328 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7329 | "$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] | 7330 | "$P_CLI debug_level=3" \ |
| 7331 | 0 \ |
| 7332 | -C "found supported_point_formats extension" \ |
| 7333 | -S "server hello, supported_point_formats extension" |
| 7334 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7335 | requires_config_enabled MBEDTLS_AES_C |
| 7336 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7337 | requires_config_enabled MBEDTLS_SHA256_C |
| 7338 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7339 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7340 | run_test "Force an ECC ciphersuite in the client side" \ |
| 7341 | "$P_SRV debug_level=3" \ |
| 7342 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7343 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 7344 | -c "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7345 | -c "client hello, adding supported_point_formats extension" \ |
| 7346 | -s "found supported elliptic curves extension" \ |
| 7347 | -s "found supported point formats extension" |
| 7348 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7349 | requires_config_enabled MBEDTLS_AES_C |
| 7350 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7351 | requires_config_enabled MBEDTLS_SHA256_C |
| 7352 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7353 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7354 | run_test "Force an ECC ciphersuite in the server side" \ |
| 7355 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7356 | "$P_CLI debug_level=3" \ |
| 7357 | 0 \ |
| 7358 | -c "found supported_point_formats extension" \ |
| 7359 | -s "server hello, supported_point_formats extension" |
| 7360 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7361 | # Tests for DTLS HelloVerifyRequest |
| 7362 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7363 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7364 | run_test "DTLS cookie: enabled" \ |
| 7365 | "$P_SRV dtls=1 debug_level=2" \ |
| 7366 | "$P_CLI dtls=1 debug_level=2" \ |
| 7367 | 0 \ |
| 7368 | -s "cookie verification failed" \ |
| 7369 | -s "cookie verification passed" \ |
| 7370 | -S "cookie verification skipped" \ |
| 7371 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7372 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7373 | -S "SSL - The requested feature is not available" |
| 7374 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7375 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7376 | run_test "DTLS cookie: disabled" \ |
| 7377 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 7378 | "$P_CLI dtls=1 debug_level=2" \ |
| 7379 | 0 \ |
| 7380 | -S "cookie verification failed" \ |
| 7381 | -S "cookie verification passed" \ |
| 7382 | -s "cookie verification skipped" \ |
| 7383 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7384 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7385 | -S "SSL - The requested feature is not available" |
| 7386 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7387 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7388 | run_test "DTLS cookie: default (failing)" \ |
| 7389 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 7390 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 7391 | 1 \ |
| 7392 | -s "cookie verification failed" \ |
| 7393 | -S "cookie verification passed" \ |
| 7394 | -S "cookie verification skipped" \ |
| 7395 | -C "received hello verify request" \ |
| 7396 | -S "hello verification requested" \ |
| 7397 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7398 | |
| 7399 | requires_ipv6 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7400 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7401 | run_test "DTLS cookie: enabled, IPv6" \ |
| 7402 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 7403 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 7404 | 0 \ |
| 7405 | -s "cookie verification failed" \ |
| 7406 | -s "cookie verification passed" \ |
| 7407 | -S "cookie verification skipped" \ |
| 7408 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7409 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7410 | -S "SSL - The requested feature is not available" |
| 7411 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7412 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7413 | run_test "DTLS cookie: enabled, nbio" \ |
| 7414 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 7415 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7416 | 0 \ |
| 7417 | -s "cookie verification failed" \ |
| 7418 | -s "cookie verification passed" \ |
| 7419 | -S "cookie verification skipped" \ |
| 7420 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7421 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7422 | -S "SSL - The requested feature is not available" |
| 7423 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7424 | # Tests for client reconnecting from the same port with DTLS |
| 7425 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7426 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7427 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7428 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7429 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 7430 | "$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] | 7431 | 0 \ |
| 7432 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7433 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7434 | -S "Client initiated reconnection from same port" |
| 7435 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7436 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7437 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7438 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7439 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 7440 | "$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] | 7441 | 0 \ |
| 7442 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7443 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7444 | -s "Client initiated reconnection from same port" |
| 7445 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7446 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7447 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7448 | 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] | 7449 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 7450 | "$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] | 7451 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7452 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7453 | -s "Client initiated reconnection from same port" |
| 7454 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7455 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7456 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7457 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 7458 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 7459 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 7460 | 0 \ |
| 7461 | -S "The operation timed out" \ |
| 7462 | -s "Client initiated reconnection from same port" |
| 7463 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7464 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7465 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 7466 | "$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] | 7467 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 7468 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7469 | -s "The operation timed out" \ |
| 7470 | -S "Client initiated reconnection from same port" |
| 7471 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7472 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 7473 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 7474 | -p "$P_PXY inject_clihlo=1" \ |
| 7475 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 7476 | "$P_CLI dtls=1 exchanges=2" \ |
| 7477 | 0 \ |
| 7478 | -s "possible client reconnect from the same port" \ |
| 7479 | -S "Client initiated reconnection from same port" |
| 7480 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7481 | # Tests for various cases of client authentication with DTLS |
| 7482 | # (focused on handshake flows and message parsing) |
| 7483 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7484 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7485 | run_test "DTLS client auth: required" \ |
| 7486 | "$P_SRV dtls=1 auth_mode=required" \ |
| 7487 | "$P_CLI dtls=1" \ |
| 7488 | 0 \ |
| 7489 | -s "Verifying peer X.509 certificate... ok" |
| 7490 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7491 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7492 | run_test "DTLS client auth: optional, client has no cert" \ |
| 7493 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 7494 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 7495 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7496 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7497 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7498 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7499 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7500 | "$P_SRV dtls=1 auth_mode=none" \ |
| 7501 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 7502 | 0 \ |
| 7503 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7504 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7505 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7506 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 7507 | run_test "DTLS wrong PSK: badmac alert" \ |
| 7508 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 7509 | "$P_CLI dtls=1 psk=abc124" \ |
| 7510 | 1 \ |
| 7511 | -s "SSL - Verification of the message MAC failed" \ |
| 7512 | -c "SSL - A fatal alert message was received from our peer" |
| 7513 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7514 | # Tests for receiving fragmented handshake messages with DTLS |
| 7515 | |
| 7516 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7517 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7518 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 7519 | "$G_SRV -u --mtu 2048 -a" \ |
| 7520 | "$P_CLI dtls=1 debug_level=2" \ |
| 7521 | 0 \ |
| 7522 | -C "found fragmented DTLS handshake message" \ |
| 7523 | -C "error" |
| 7524 | |
| 7525 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7526 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7527 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 7528 | "$G_SRV -u --mtu 512" \ |
| 7529 | "$P_CLI dtls=1 debug_level=2" \ |
| 7530 | 0 \ |
| 7531 | -c "found fragmented DTLS handshake message" \ |
| 7532 | -C "error" |
| 7533 | |
| 7534 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7535 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7536 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 7537 | "$G_SRV -u --mtu 128" \ |
| 7538 | "$P_CLI dtls=1 debug_level=2" \ |
| 7539 | 0 \ |
| 7540 | -c "found fragmented DTLS handshake message" \ |
| 7541 | -C "error" |
| 7542 | |
| 7543 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7544 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7545 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 7546 | "$G_SRV -u --mtu 128" \ |
| 7547 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7548 | 0 \ |
| 7549 | -c "found fragmented DTLS handshake message" \ |
| 7550 | -C "error" |
| 7551 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7552 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7553 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7554 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7555 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 7556 | "$G_SRV -u --mtu 256" \ |
| 7557 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 7558 | 0 \ |
| 7559 | -c "found fragmented DTLS handshake message" \ |
| 7560 | -c "client hello, adding renegotiation extension" \ |
| 7561 | -c "found renegotiation extension" \ |
| 7562 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7563 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7564 | -C "error" \ |
| 7565 | -s "Extra-header:" |
| 7566 | |
| 7567 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7568 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7569 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7570 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 7571 | "$G_SRV -u --mtu 256" \ |
| 7572 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 7573 | 0 \ |
| 7574 | -c "found fragmented DTLS handshake message" \ |
| 7575 | -c "client hello, adding renegotiation extension" \ |
| 7576 | -c "found renegotiation extension" \ |
| 7577 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7578 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7579 | -C "error" \ |
| 7580 | -s "Extra-header:" |
| 7581 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7582 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 7583 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 7584 | "$O_SRV -dtls -mtu 2048" \ |
| 7585 | "$P_CLI dtls=1 debug_level=2" \ |
| 7586 | 0 \ |
| 7587 | -C "found fragmented DTLS handshake message" \ |
| 7588 | -C "error" |
| 7589 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7590 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 7591 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 7592 | "$O_SRV -dtls -mtu 768" \ |
| 7593 | "$P_CLI dtls=1 debug_level=2" \ |
| 7594 | 0 \ |
| 7595 | -c "found fragmented DTLS handshake message" \ |
| 7596 | -C "error" |
| 7597 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7598 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 7599 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 7600 | "$O_SRV -dtls -mtu 256" \ |
| 7601 | "$P_CLI dtls=1 debug_level=2" \ |
| 7602 | 0 \ |
| 7603 | -c "found fragmented DTLS handshake message" \ |
| 7604 | -C "error" |
| 7605 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7606 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 7607 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 7608 | "$O_SRV -dtls -mtu 256" \ |
| 7609 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7610 | 0 \ |
| 7611 | -c "found fragmented DTLS handshake message" \ |
| 7612 | -C "error" |
| 7613 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7614 | # Tests for sending fragmented handshake messages with DTLS |
| 7615 | # |
| 7616 | # Use client auth when we need the client to send large messages, |
| 7617 | # and use large cert chains on both sides too (the long chains we have all use |
| 7618 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 7619 | # Sizes reached (UDP payload): |
| 7620 | # - 2037B for server certificate |
| 7621 | # - 1542B for client certificate |
| 7622 | # - 1013B for newsessionticket |
| 7623 | # - all others below 512B |
| 7624 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 7625 | |
| 7626 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7627 | requires_config_enabled MBEDTLS_RSA_C |
| 7628 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7629 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7630 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7631 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7632 | run_test "DTLS fragmenting: none (for reference)" \ |
| 7633 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7634 | crt_file=data_files/server7_int-ca.crt \ |
| 7635 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7636 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7637 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7638 | "$P_CLI dtls=1 debug_level=2 \ |
| 7639 | crt_file=data_files/server8_int-ca2.crt \ |
| 7640 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7641 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7642 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7643 | 0 \ |
| 7644 | -S "found fragmented DTLS handshake message" \ |
| 7645 | -C "found fragmented DTLS handshake message" \ |
| 7646 | -C "error" |
| 7647 | |
| 7648 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7649 | requires_config_enabled MBEDTLS_RSA_C |
| 7650 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7651 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7652 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7653 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7654 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7655 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7656 | crt_file=data_files/server7_int-ca.crt \ |
| 7657 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7658 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7659 | max_frag_len=1024" \ |
| 7660 | "$P_CLI dtls=1 debug_level=2 \ |
| 7661 | crt_file=data_files/server8_int-ca2.crt \ |
| 7662 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7663 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7664 | max_frag_len=2048" \ |
| 7665 | 0 \ |
| 7666 | -S "found fragmented DTLS handshake message" \ |
| 7667 | -c "found fragmented DTLS handshake message" \ |
| 7668 | -C "error" |
| 7669 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7670 | # With the MFL extension, the server has no way of forcing |
| 7671 | # the client to not exceed a certain MTU; hence, the following |
| 7672 | # test can't be replicated with an MTU proxy such as the one |
| 7673 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7674 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7675 | requires_config_enabled MBEDTLS_RSA_C |
| 7676 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7677 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7678 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7679 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7680 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7681 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7682 | crt_file=data_files/server7_int-ca.crt \ |
| 7683 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7684 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7685 | max_frag_len=512" \ |
| 7686 | "$P_CLI dtls=1 debug_level=2 \ |
| 7687 | crt_file=data_files/server8_int-ca2.crt \ |
| 7688 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7689 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7690 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7691 | 0 \ |
| 7692 | -S "found fragmented DTLS handshake message" \ |
| 7693 | -c "found fragmented DTLS handshake message" \ |
| 7694 | -C "error" |
| 7695 | |
| 7696 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7697 | requires_config_enabled MBEDTLS_RSA_C |
| 7698 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7699 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7700 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7701 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7702 | 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] | 7703 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 7704 | crt_file=data_files/server7_int-ca.crt \ |
| 7705 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7706 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7707 | max_frag_len=2048" \ |
| 7708 | "$P_CLI dtls=1 debug_level=2 \ |
| 7709 | crt_file=data_files/server8_int-ca2.crt \ |
| 7710 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7711 | hs_timeout=2500-60000 \ |
| 7712 | max_frag_len=1024" \ |
| 7713 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7714 | -S "found fragmented DTLS handshake message" \ |
| 7715 | -c "found fragmented DTLS handshake message" \ |
| 7716 | -C "error" |
| 7717 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7718 | # While not required by the standard defining the MFL extension |
| 7719 | # (according to which it only applies to records, not to datagrams), |
| 7720 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7721 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7722 | # to the peer. |
| 7723 | # The next test checks that no datagrams significantly larger than the |
| 7724 | # negotiated MFL are sent. |
| 7725 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7726 | requires_config_enabled MBEDTLS_RSA_C |
| 7727 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7728 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7729 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7730 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7731 | 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] | 7732 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7733 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 7734 | crt_file=data_files/server7_int-ca.crt \ |
| 7735 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7736 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7737 | max_frag_len=2048" \ |
| 7738 | "$P_CLI dtls=1 debug_level=2 \ |
| 7739 | crt_file=data_files/server8_int-ca2.crt \ |
| 7740 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7741 | hs_timeout=2500-60000 \ |
| 7742 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7743 | 0 \ |
| 7744 | -S "found fragmented DTLS handshake message" \ |
| 7745 | -c "found fragmented DTLS handshake message" \ |
| 7746 | -C "error" |
| 7747 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7748 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7749 | requires_config_enabled MBEDTLS_RSA_C |
| 7750 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7751 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7752 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7753 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7754 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7755 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7756 | crt_file=data_files/server7_int-ca.crt \ |
| 7757 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7758 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7759 | max_frag_len=2048" \ |
| 7760 | "$P_CLI dtls=1 debug_level=2 \ |
| 7761 | crt_file=data_files/server8_int-ca2.crt \ |
| 7762 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7763 | hs_timeout=2500-60000 \ |
| 7764 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7765 | 0 \ |
| 7766 | -s "found fragmented DTLS handshake message" \ |
| 7767 | -c "found fragmented DTLS handshake message" \ |
| 7768 | -C "error" |
| 7769 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7770 | # While not required by the standard defining the MFL extension |
| 7771 | # (according to which it only applies to records, not to datagrams), |
| 7772 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7773 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7774 | # to the peer. |
| 7775 | # The next test checks that no datagrams significantly larger than the |
| 7776 | # negotiated MFL are sent. |
| 7777 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7778 | requires_config_enabled MBEDTLS_RSA_C |
| 7779 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7780 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7781 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7782 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7783 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 7784 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7785 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7786 | crt_file=data_files/server7_int-ca.crt \ |
| 7787 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7788 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7789 | max_frag_len=2048" \ |
| 7790 | "$P_CLI dtls=1 debug_level=2 \ |
| 7791 | crt_file=data_files/server8_int-ca2.crt \ |
| 7792 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7793 | hs_timeout=2500-60000 \ |
| 7794 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7795 | 0 \ |
| 7796 | -s "found fragmented DTLS handshake message" \ |
| 7797 | -c "found fragmented DTLS handshake message" \ |
| 7798 | -C "error" |
| 7799 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7800 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7801 | requires_config_enabled MBEDTLS_RSA_C |
| 7802 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7803 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7804 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7805 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 7806 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7807 | crt_file=data_files/server7_int-ca.crt \ |
| 7808 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7809 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7810 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7811 | "$P_CLI dtls=1 debug_level=2 \ |
| 7812 | crt_file=data_files/server8_int-ca2.crt \ |
| 7813 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7814 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7815 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7816 | 0 \ |
| 7817 | -S "found fragmented DTLS handshake message" \ |
| 7818 | -C "found fragmented DTLS handshake message" \ |
| 7819 | -C "error" |
| 7820 | |
| 7821 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7822 | requires_config_enabled MBEDTLS_RSA_C |
| 7823 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7824 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7825 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7826 | run_test "DTLS fragmenting: client (MTU)" \ |
| 7827 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7828 | crt_file=data_files/server7_int-ca.crt \ |
| 7829 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7830 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7831 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7832 | "$P_CLI dtls=1 debug_level=2 \ |
| 7833 | crt_file=data_files/server8_int-ca2.crt \ |
| 7834 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7835 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7836 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7837 | 0 \ |
| 7838 | -s "found fragmented DTLS handshake message" \ |
| 7839 | -C "found fragmented DTLS handshake message" \ |
| 7840 | -C "error" |
| 7841 | |
| 7842 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7843 | requires_config_enabled MBEDTLS_RSA_C |
| 7844 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7845 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7846 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7847 | run_test "DTLS fragmenting: server (MTU)" \ |
| 7848 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7849 | crt_file=data_files/server7_int-ca.crt \ |
| 7850 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7851 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7852 | mtu=512" \ |
| 7853 | "$P_CLI dtls=1 debug_level=2 \ |
| 7854 | crt_file=data_files/server8_int-ca2.crt \ |
| 7855 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7856 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7857 | mtu=2048" \ |
| 7858 | 0 \ |
| 7859 | -S "found fragmented DTLS handshake message" \ |
| 7860 | -c "found fragmented DTLS handshake message" \ |
| 7861 | -C "error" |
| 7862 | |
| 7863 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7864 | requires_config_enabled MBEDTLS_RSA_C |
| 7865 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7866 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7867 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7868 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7869 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7870 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7871 | crt_file=data_files/server7_int-ca.crt \ |
| 7872 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7873 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 7874 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7875 | "$P_CLI dtls=1 debug_level=2 \ |
| 7876 | crt_file=data_files/server8_int-ca2.crt \ |
| 7877 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7878 | hs_timeout=2500-60000 \ |
| 7879 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7880 | 0 \ |
| 7881 | -s "found fragmented DTLS handshake message" \ |
| 7882 | -c "found fragmented DTLS handshake message" \ |
| 7883 | -C "error" |
| 7884 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7885 | # 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] | 7886 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7887 | requires_config_enabled MBEDTLS_RSA_C |
| 7888 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7889 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7890 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7891 | requires_config_enabled MBEDTLS_AES_C |
| 7892 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7893 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7894 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7895 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 7896 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7897 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7898 | crt_file=data_files/server7_int-ca.crt \ |
| 7899 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7900 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7901 | mtu=512" \ |
| 7902 | "$P_CLI dtls=1 debug_level=2 \ |
| 7903 | crt_file=data_files/server8_int-ca2.crt \ |
| 7904 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7905 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7906 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7907 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7908 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7909 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7910 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7911 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7912 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7913 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7914 | # 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] | 7915 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 7916 | # retransmissions, but in some cases (like both the server and client using |
| 7917 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 7918 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 7919 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7920 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7921 | requires_config_enabled MBEDTLS_RSA_C |
| 7922 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7923 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7924 | requires_config_enabled MBEDTLS_AES_C |
| 7925 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7926 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7927 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7928 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7929 | -p "$P_PXY mtu=508" \ |
| 7930 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7931 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7932 | key_file=data_files/server7.key \ |
| 7933 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7934 | "$P_CLI dtls=1 debug_level=2 \ |
| 7935 | crt_file=data_files/server8_int-ca2.crt \ |
| 7936 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7937 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7938 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7939 | 0 \ |
| 7940 | -s "found fragmented DTLS handshake message" \ |
| 7941 | -c "found fragmented DTLS handshake message" \ |
| 7942 | -C "error" |
| 7943 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7944 | # 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] | 7945 | only_with_valgrind |
| 7946 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7947 | requires_config_enabled MBEDTLS_RSA_C |
| 7948 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7949 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7950 | requires_config_enabled MBEDTLS_AES_C |
| 7951 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7952 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7953 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7954 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7955 | -p "$P_PXY mtu=508" \ |
| 7956 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7957 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7958 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7959 | hs_timeout=250-10000" \ |
| 7960 | "$P_CLI dtls=1 debug_level=2 \ |
| 7961 | crt_file=data_files/server8_int-ca2.crt \ |
| 7962 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7963 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7964 | hs_timeout=250-10000" \ |
| 7965 | 0 \ |
| 7966 | -s "found fragmented DTLS handshake message" \ |
| 7967 | -c "found fragmented DTLS handshake message" \ |
| 7968 | -C "error" |
| 7969 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7970 | # 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] | 7971 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7972 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7973 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7974 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7975 | requires_config_enabled MBEDTLS_RSA_C |
| 7976 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7977 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7978 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7979 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7980 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7981 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7982 | crt_file=data_files/server7_int-ca.crt \ |
| 7983 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7984 | hs_timeout=10000-60000 \ |
| 7985 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7986 | "$P_CLI dtls=1 debug_level=2 \ |
| 7987 | crt_file=data_files/server8_int-ca2.crt \ |
| 7988 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7989 | hs_timeout=10000-60000 \ |
| 7990 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7991 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7992 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7993 | -s "found fragmented DTLS handshake message" \ |
| 7994 | -c "found fragmented DTLS handshake message" \ |
| 7995 | -C "error" |
| 7996 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7997 | # 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] | 7998 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 7999 | # OTOH the client might resend if the server is to slow to reset after sending |
| 8000 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8001 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8002 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8003 | requires_config_enabled MBEDTLS_RSA_C |
| 8004 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8005 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8006 | requires_config_enabled MBEDTLS_AES_C |
| 8007 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8008 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8009 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8010 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8011 | -p "$P_PXY mtu=512" \ |
| 8012 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8013 | crt_file=data_files/server7_int-ca.crt \ |
| 8014 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8015 | hs_timeout=10000-60000 \ |
| 8016 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8017 | "$P_CLI dtls=1 debug_level=2 \ |
| 8018 | crt_file=data_files/server8_int-ca2.crt \ |
| 8019 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8020 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8021 | hs_timeout=10000-60000 \ |
| 8022 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8023 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8024 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8025 | -s "found fragmented DTLS handshake message" \ |
| 8026 | -c "found fragmented DTLS handshake message" \ |
| 8027 | -C "error" |
| 8028 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8029 | not_with_valgrind # spurious autoreduction due to timeout |
| 8030 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8031 | requires_config_enabled MBEDTLS_RSA_C |
| 8032 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8033 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8034 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8035 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8036 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8037 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8038 | crt_file=data_files/server7_int-ca.crt \ |
| 8039 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8040 | hs_timeout=10000-60000 \ |
| 8041 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8042 | "$P_CLI dtls=1 debug_level=2 \ |
| 8043 | crt_file=data_files/server8_int-ca2.crt \ |
| 8044 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8045 | hs_timeout=10000-60000 \ |
| 8046 | mtu=1024 nbio=2" \ |
| 8047 | 0 \ |
| 8048 | -S "autoreduction" \ |
| 8049 | -s "found fragmented DTLS handshake message" \ |
| 8050 | -c "found fragmented DTLS handshake message" \ |
| 8051 | -C "error" |
| 8052 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8053 | # 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] | 8054 | not_with_valgrind # spurious autoreduction due to timeout |
| 8055 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8056 | requires_config_enabled MBEDTLS_RSA_C |
| 8057 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8058 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8059 | requires_config_enabled MBEDTLS_AES_C |
| 8060 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8061 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8062 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8063 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 8064 | -p "$P_PXY mtu=512" \ |
| 8065 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8066 | crt_file=data_files/server7_int-ca.crt \ |
| 8067 | key_file=data_files/server7.key \ |
| 8068 | hs_timeout=10000-60000 \ |
| 8069 | mtu=512 nbio=2" \ |
| 8070 | "$P_CLI dtls=1 debug_level=2 \ |
| 8071 | crt_file=data_files/server8_int-ca2.crt \ |
| 8072 | key_file=data_files/server8.key \ |
| 8073 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8074 | hs_timeout=10000-60000 \ |
| 8075 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8076 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8077 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8078 | -s "found fragmented DTLS handshake message" \ |
| 8079 | -c "found fragmented DTLS handshake message" \ |
| 8080 | -C "error" |
| 8081 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8082 | # 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] | 8083 | # This ensures things still work after session_reset(). |
| 8084 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8085 | # Since we don't support reading fragmented ClientHello yet, |
| 8086 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 8087 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8088 | # An autoreduction on the client-side might happen if the server is |
| 8089 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 8090 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8091 | # resumed listening, which would result in a spurious autoreduction. |
| 8092 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8093 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8094 | requires_config_enabled MBEDTLS_RSA_C |
| 8095 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8096 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8097 | requires_config_enabled MBEDTLS_AES_C |
| 8098 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8099 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8100 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8101 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 8102 | -p "$P_PXY mtu=1450" \ |
| 8103 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8104 | crt_file=data_files/server7_int-ca.crt \ |
| 8105 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8106 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8107 | mtu=1450" \ |
| 8108 | "$P_CLI dtls=1 debug_level=2 \ |
| 8109 | crt_file=data_files/server8_int-ca2.crt \ |
| 8110 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8111 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8112 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 8113 | 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] | 8114 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8115 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8116 | -s "found fragmented DTLS handshake message" \ |
| 8117 | -c "found fragmented DTLS handshake message" \ |
| 8118 | -C "error" |
| 8119 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8120 | # An autoreduction on the client-side might happen if the server is |
| 8121 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8122 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8123 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8124 | requires_config_enabled MBEDTLS_RSA_C |
| 8125 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8126 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8127 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8128 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8129 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8130 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8131 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8132 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 8133 | -p "$P_PXY mtu=512" \ |
| 8134 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8135 | crt_file=data_files/server7_int-ca.crt \ |
| 8136 | key_file=data_files/server7.key \ |
| 8137 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8138 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8139 | mtu=512" \ |
| 8140 | "$P_CLI dtls=1 debug_level=2 \ |
| 8141 | crt_file=data_files/server8_int-ca2.crt \ |
| 8142 | key_file=data_files/server8.key \ |
| 8143 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8144 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8145 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8146 | mtu=512" \ |
| 8147 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8148 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8149 | -s "found fragmented DTLS handshake message" \ |
| 8150 | -c "found fragmented DTLS handshake message" \ |
| 8151 | -C "error" |
| 8152 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8153 | # An autoreduction on the client-side might happen if the server is |
| 8154 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8155 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8156 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8157 | requires_config_enabled MBEDTLS_RSA_C |
| 8158 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8159 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8160 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8161 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8162 | requires_config_enabled MBEDTLS_AES_C |
| 8163 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8164 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8165 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8166 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 8167 | -p "$P_PXY mtu=512" \ |
| 8168 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8169 | crt_file=data_files/server7_int-ca.crt \ |
| 8170 | key_file=data_files/server7.key \ |
| 8171 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8172 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8173 | mtu=512" \ |
| 8174 | "$P_CLI dtls=1 debug_level=2 \ |
| 8175 | crt_file=data_files/server8_int-ca2.crt \ |
| 8176 | key_file=data_files/server8.key \ |
| 8177 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8178 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8179 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8180 | mtu=512" \ |
| 8181 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8182 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8183 | -s "found fragmented DTLS handshake message" \ |
| 8184 | -c "found fragmented DTLS handshake message" \ |
| 8185 | -C "error" |
| 8186 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8187 | # An autoreduction on the client-side might happen if the server is |
| 8188 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8189 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8190 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8191 | requires_config_enabled MBEDTLS_RSA_C |
| 8192 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8193 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8194 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8195 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8196 | requires_config_enabled MBEDTLS_AES_C |
| 8197 | requires_config_enabled MBEDTLS_CCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8198 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8199 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8200 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8201 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8202 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8203 | crt_file=data_files/server7_int-ca.crt \ |
| 8204 | key_file=data_files/server7.key \ |
| 8205 | exchanges=2 renegotiation=1 \ |
| 8206 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8207 | hs_timeout=10000-60000 \ |
| 8208 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8209 | "$P_CLI dtls=1 debug_level=2 \ |
| 8210 | crt_file=data_files/server8_int-ca2.crt \ |
| 8211 | key_file=data_files/server8.key \ |
| 8212 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8213 | hs_timeout=10000-60000 \ |
| 8214 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8215 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8216 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8217 | -s "found fragmented DTLS handshake message" \ |
| 8218 | -c "found fragmented DTLS handshake message" \ |
| 8219 | -C "error" |
| 8220 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8221 | # An autoreduction on the client-side might happen if the server is |
| 8222 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8223 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8224 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8225 | requires_config_enabled MBEDTLS_RSA_C |
| 8226 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8227 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8228 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8229 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8230 | requires_config_enabled MBEDTLS_AES_C |
| 8231 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8232 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8233 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8234 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8235 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8236 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8237 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8238 | crt_file=data_files/server7_int-ca.crt \ |
| 8239 | key_file=data_files/server7.key \ |
| 8240 | exchanges=2 renegotiation=1 \ |
| 8241 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8242 | hs_timeout=10000-60000 \ |
| 8243 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8244 | "$P_CLI dtls=1 debug_level=2 \ |
| 8245 | crt_file=data_files/server8_int-ca2.crt \ |
| 8246 | key_file=data_files/server8.key \ |
| 8247 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8248 | hs_timeout=10000-60000 \ |
| 8249 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8250 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8251 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8252 | -s "found fragmented DTLS handshake message" \ |
| 8253 | -c "found fragmented DTLS handshake message" \ |
| 8254 | -C "error" |
| 8255 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8256 | # An autoreduction on the client-side might happen if the server is |
| 8257 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8258 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8259 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8260 | requires_config_enabled MBEDTLS_RSA_C |
| 8261 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8262 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8263 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8264 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8265 | requires_config_enabled MBEDTLS_AES_C |
| 8266 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8267 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8268 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8269 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8270 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8271 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8272 | crt_file=data_files/server7_int-ca.crt \ |
| 8273 | key_file=data_files/server7.key \ |
| 8274 | exchanges=2 renegotiation=1 \ |
| 8275 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8276 | hs_timeout=10000-60000 \ |
| 8277 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8278 | "$P_CLI dtls=1 debug_level=2 \ |
| 8279 | crt_file=data_files/server8_int-ca2.crt \ |
| 8280 | key_file=data_files/server8.key \ |
| 8281 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8282 | hs_timeout=10000-60000 \ |
| 8283 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8284 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8285 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8286 | -s "found fragmented DTLS handshake message" \ |
| 8287 | -c "found fragmented DTLS handshake message" \ |
| 8288 | -C "error" |
| 8289 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8290 | # 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] | 8291 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8292 | requires_config_enabled MBEDTLS_RSA_C |
| 8293 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8294 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8295 | requires_config_enabled MBEDTLS_AES_C |
| 8296 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8297 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8298 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8299 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8300 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 8301 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8302 | "$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] | 8303 | crt_file=data_files/server7_int-ca.crt \ |
| 8304 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8305 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8306 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8307 | crt_file=data_files/server8_int-ca2.crt \ |
| 8308 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8309 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8310 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8311 | 0 \ |
| 8312 | -s "found fragmented DTLS handshake message" \ |
| 8313 | -c "found fragmented DTLS handshake message" \ |
| 8314 | -C "error" |
| 8315 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8316 | # 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] | 8317 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8318 | requires_config_enabled MBEDTLS_RSA_C |
| 8319 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8320 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8321 | requires_config_enabled MBEDTLS_AES_C |
| 8322 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8323 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8324 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8325 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8326 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 8327 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 8328 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8329 | crt_file=data_files/server7_int-ca.crt \ |
| 8330 | key_file=data_files/server7.key \ |
| 8331 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 8332 | "$P_CLI dtls=1 debug_level=2 \ |
| 8333 | crt_file=data_files/server8_int-ca2.crt \ |
| 8334 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8335 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8336 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 8337 | 0 \ |
| 8338 | -s "found fragmented DTLS handshake message" \ |
| 8339 | -c "found fragmented DTLS handshake message" \ |
| 8340 | -C "error" |
| 8341 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8342 | # interop tests for DTLS fragmentating with reliable connection |
| 8343 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8344 | # here and below we just want to test that the we fragment in a way that |
| 8345 | # pleases other implementations, so we don't need the peer to fragment |
| 8346 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8347 | requires_config_enabled MBEDTLS_RSA_C |
| 8348 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8349 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8350 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8351 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8352 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8353 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 8354 | "$G_SRV -u" \ |
| 8355 | "$P_CLI dtls=1 debug_level=2 \ |
| 8356 | crt_file=data_files/server8_int-ca2.crt \ |
| 8357 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8358 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8359 | 0 \ |
| 8360 | -c "fragmenting handshake message" \ |
| 8361 | -C "error" |
| 8362 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 8363 | # We use --insecure for the GnuTLS client because it expects |
| 8364 | # the hostname / IP it connects to to be the name used in the |
| 8365 | # certificate obtained from the server. Here, however, it |
| 8366 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 8367 | # as the server name in the certificate. This will make the |
| 8368 | # certifiate validation fail, but passing --insecure makes |
| 8369 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8370 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8371 | requires_config_enabled MBEDTLS_RSA_C |
| 8372 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8373 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8374 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 8375 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8376 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8377 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8378 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8379 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8380 | crt_file=data_files/server7_int-ca.crt \ |
| 8381 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8382 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8383 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8384 | 0 \ |
| 8385 | -s "fragmenting handshake message" |
| 8386 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8387 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8388 | requires_config_enabled MBEDTLS_RSA_C |
| 8389 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8390 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8391 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8392 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8393 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 8394 | "$O_SRV -dtls1_2 -verify 10" \ |
| 8395 | "$P_CLI dtls=1 debug_level=2 \ |
| 8396 | crt_file=data_files/server8_int-ca2.crt \ |
| 8397 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8398 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8399 | 0 \ |
| 8400 | -c "fragmenting handshake message" \ |
| 8401 | -C "error" |
| 8402 | |
| 8403 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8404 | requires_config_enabled MBEDTLS_RSA_C |
| 8405 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8406 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8407 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8408 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8409 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 8410 | "$P_SRV dtls=1 debug_level=2 \ |
| 8411 | crt_file=data_files/server7_int-ca.crt \ |
| 8412 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8413 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8414 | "$O_CLI -dtls1_2" \ |
| 8415 | 0 \ |
| 8416 | -s "fragmenting handshake message" |
| 8417 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8418 | # interop tests for DTLS fragmentating with unreliable connection |
| 8419 | # |
| 8420 | # again we just want to test that the we fragment in a way that |
| 8421 | # pleases other implementations, so we don't need the peer to fragment |
| 8422 | requires_gnutls_next |
| 8423 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8424 | requires_config_enabled MBEDTLS_RSA_C |
| 8425 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8426 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8427 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8428 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8429 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8430 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 8431 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8432 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8433 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8434 | crt_file=data_files/server8_int-ca2.crt \ |
| 8435 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8436 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8437 | 0 \ |
| 8438 | -c "fragmenting handshake message" \ |
| 8439 | -C "error" |
| 8440 | |
| 8441 | requires_gnutls_next |
| 8442 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8443 | requires_config_enabled MBEDTLS_RSA_C |
| 8444 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8445 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8446 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8447 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8448 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8449 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 8450 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8451 | "$P_SRV dtls=1 debug_level=2 \ |
| 8452 | crt_file=data_files/server7_int-ca.crt \ |
| 8453 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8454 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8455 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8456 | 0 \ |
| 8457 | -s "fragmenting handshake message" |
| 8458 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8459 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 8460 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8461 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8462 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8463 | ## (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] | 8464 | skip_next_test |
| 8465 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8466 | requires_config_enabled MBEDTLS_RSA_C |
| 8467 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8468 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8469 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8470 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8471 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8472 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 8473 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8474 | "$O_SRV -dtls1_2 -verify 10" \ |
| 8475 | "$P_CLI dtls=1 debug_level=2 \ |
| 8476 | crt_file=data_files/server8_int-ca2.crt \ |
| 8477 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8478 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8479 | 0 \ |
| 8480 | -c "fragmenting handshake message" \ |
| 8481 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8482 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8483 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8484 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8485 | requires_config_enabled MBEDTLS_RSA_C |
| 8486 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8487 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8488 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8489 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8490 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8491 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 8492 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8493 | "$P_SRV dtls=1 debug_level=2 \ |
| 8494 | crt_file=data_files/server7_int-ca.crt \ |
| 8495 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8496 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8497 | "$O_CLI -dtls1_2" \ |
| 8498 | 0 \ |
| 8499 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8500 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8501 | # Tests for DTLS-SRTP (RFC 5764) |
| 8502 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8503 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8504 | run_test "DTLS-SRTP all profiles supported" \ |
| 8505 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8506 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8507 | 0 \ |
| 8508 | -s "found use_srtp extension" \ |
| 8509 | -s "found srtp profile" \ |
| 8510 | -s "selected srtp profile" \ |
| 8511 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8512 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8513 | -c "client hello, adding use_srtp extension" \ |
| 8514 | -c "found use_srtp extension" \ |
| 8515 | -c "found srtp profile" \ |
| 8516 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8517 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8518 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8519 | -C "error" |
| 8520 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8521 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8522 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8523 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8524 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 8525 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8526 | "$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] | 8527 | 0 \ |
| 8528 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8529 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 8530 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8531 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8532 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8533 | -c "client hello, adding use_srtp extension" \ |
| 8534 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8535 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8536 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8537 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8538 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8539 | -C "error" |
| 8540 | |
| 8541 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8542 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8543 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8544 | "$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] | 8545 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8546 | 0 \ |
| 8547 | -s "found use_srtp extension" \ |
| 8548 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8549 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8550 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8551 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8552 | -c "client hello, adding use_srtp extension" \ |
| 8553 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8554 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8555 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8556 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8557 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8558 | -C "error" |
| 8559 | |
| 8560 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8561 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8562 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 8563 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8564 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8565 | 0 \ |
| 8566 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8567 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8568 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8569 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8570 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8571 | -c "client hello, adding use_srtp extension" \ |
| 8572 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8573 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8574 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8575 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8576 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8577 | -C "error" |
| 8578 | |
| 8579 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8580 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8581 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 8582 | "$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] | 8583 | "$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] | 8584 | 0 \ |
| 8585 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8586 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8587 | -S "selected srtp profile" \ |
| 8588 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8589 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8590 | -c "client hello, adding use_srtp extension" \ |
| 8591 | -C "found use_srtp extension" \ |
| 8592 | -C "found srtp profile" \ |
| 8593 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8594 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8595 | -C "error" |
| 8596 | |
| 8597 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8598 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8599 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 8600 | "$P_SRV dtls=1 debug_level=3" \ |
| 8601 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8602 | 0 \ |
| 8603 | -s "found use_srtp extension" \ |
| 8604 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8605 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8606 | -c "client hello, adding use_srtp extension" \ |
| 8607 | -C "found use_srtp extension" \ |
| 8608 | -C "found srtp profile" \ |
| 8609 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8610 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8611 | -C "error" |
| 8612 | |
| 8613 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8614 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8615 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 8616 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 8617 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8618 | 0 \ |
| 8619 | -s "found use_srtp extension" \ |
| 8620 | -s "found srtp profile" \ |
| 8621 | -s "selected srtp profile" \ |
| 8622 | -s "server hello, adding use_srtp extension" \ |
| 8623 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8624 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8625 | -c "client hello, adding use_srtp extension" \ |
| 8626 | -c "found use_srtp extension" \ |
| 8627 | -c "found srtp profile" \ |
| 8628 | -c "selected srtp profile" \ |
| 8629 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8630 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8631 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8632 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 8633 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8634 | -C "error" |
| 8635 | |
| 8636 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8637 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8638 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 8639 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8640 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8641 | 0 \ |
| 8642 | -s "found use_srtp extension" \ |
| 8643 | -s "found srtp profile" \ |
| 8644 | -s "selected srtp profile" \ |
| 8645 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8646 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 8647 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8648 | -S "dumping 'using mki' (8 bytes)" \ |
| 8649 | -c "client hello, adding use_srtp extension" \ |
| 8650 | -c "found use_srtp extension" \ |
| 8651 | -c "found srtp profile" \ |
| 8652 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8653 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 8654 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8655 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8656 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8657 | -C "dumping 'received mki' (8 bytes)" \ |
| 8658 | -C "error" |
| 8659 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8660 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8661 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8662 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 8663 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8664 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8665 | 0 \ |
| 8666 | -s "found use_srtp extension" \ |
| 8667 | -s "found srtp profile" \ |
| 8668 | -s "selected srtp profile" \ |
| 8669 | -s "server hello, adding use_srtp extension" \ |
| 8670 | -s "DTLS-SRTP key material is"\ |
| 8671 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 8672 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 8673 | |
| 8674 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8675 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8676 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 8677 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8678 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8679 | 0 \ |
| 8680 | -s "found use_srtp extension" \ |
| 8681 | -s "found srtp profile" \ |
| 8682 | -s "selected srtp profile" \ |
| 8683 | -s "server hello, adding use_srtp extension" \ |
| 8684 | -s "DTLS-SRTP key material is"\ |
| 8685 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 8686 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8687 | |
| 8688 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8689 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8690 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 8691 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8692 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8693 | 0 \ |
| 8694 | -s "found use_srtp extension" \ |
| 8695 | -s "found srtp profile" \ |
| 8696 | -s "selected srtp profile" \ |
| 8697 | -s "server hello, adding use_srtp extension" \ |
| 8698 | -s "DTLS-SRTP key material is"\ |
| 8699 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 8700 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8701 | |
| 8702 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8703 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8704 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 8705 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8706 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8707 | 0 \ |
| 8708 | -s "found use_srtp extension" \ |
| 8709 | -s "found srtp profile" \ |
| 8710 | -s "selected srtp profile" \ |
| 8711 | -s "server hello, adding use_srtp extension" \ |
| 8712 | -s "DTLS-SRTP key material is"\ |
| 8713 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 8714 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8715 | |
| 8716 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8717 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8718 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 8719 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8720 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8721 | 0 \ |
| 8722 | -s "found use_srtp extension" \ |
| 8723 | -s "found srtp profile" \ |
| 8724 | -s "selected srtp profile" \ |
| 8725 | -s "server hello, adding use_srtp extension" \ |
| 8726 | -s "DTLS-SRTP key material is"\ |
| 8727 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 8728 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8729 | |
| 8730 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8731 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8732 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 8733 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 8734 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8735 | 0 \ |
| 8736 | -s "found use_srtp extension" \ |
| 8737 | -s "found srtp profile" \ |
| 8738 | -S "selected srtp profile" \ |
| 8739 | -S "server hello, adding use_srtp extension" \ |
| 8740 | -S "DTLS-SRTP key material is"\ |
| 8741 | -C "SRTP Extension negotiated, profile" |
| 8742 | |
| 8743 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8744 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8745 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 8746 | "$P_SRV dtls=1 debug_level=3" \ |
| 8747 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8748 | 0 \ |
| 8749 | -s "found use_srtp extension" \ |
| 8750 | -S "server hello, adding use_srtp extension" \ |
| 8751 | -S "DTLS-SRTP key material is"\ |
| 8752 | -C "SRTP Extension negotiated, profile" |
| 8753 | |
| 8754 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8755 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8756 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 8757 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8758 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8759 | 0 \ |
| 8760 | -c "client hello, adding use_srtp extension" \ |
| 8761 | -c "found use_srtp extension" \ |
| 8762 | -c "found srtp profile" \ |
| 8763 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 8764 | -c "DTLS-SRTP key material is"\ |
| 8765 | -C "error" |
| 8766 | |
| 8767 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8768 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8769 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 8770 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8771 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8772 | 0 \ |
| 8773 | -c "client hello, adding use_srtp extension" \ |
| 8774 | -c "found use_srtp extension" \ |
| 8775 | -c "found srtp profile" \ |
| 8776 | -c "selected srtp profile" \ |
| 8777 | -c "DTLS-SRTP key material is"\ |
| 8778 | -C "error" |
| 8779 | |
| 8780 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8781 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8782 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 8783 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8784 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8785 | 0 \ |
| 8786 | -c "client hello, adding use_srtp extension" \ |
| 8787 | -c "found use_srtp extension" \ |
| 8788 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8789 | -c "selected srtp profile" \ |
| 8790 | -c "DTLS-SRTP key material is"\ |
| 8791 | -C "error" |
| 8792 | |
| 8793 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8794 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8795 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 8796 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8797 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8798 | 0 \ |
| 8799 | -c "client hello, adding use_srtp extension" \ |
| 8800 | -c "found use_srtp extension" \ |
| 8801 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8802 | -c "selected srtp profile" \ |
| 8803 | -c "DTLS-SRTP key material is"\ |
| 8804 | -C "error" |
| 8805 | |
| 8806 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8807 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8808 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 8809 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8810 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8811 | 0 \ |
| 8812 | -c "client hello, adding use_srtp extension" \ |
| 8813 | -c "found use_srtp extension" \ |
| 8814 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8815 | -c "selected srtp profile" \ |
| 8816 | -c "DTLS-SRTP key material is"\ |
| 8817 | -C "error" |
| 8818 | |
| 8819 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8820 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8821 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 8822 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8823 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 8824 | 0 \ |
| 8825 | -c "client hello, adding use_srtp extension" \ |
| 8826 | -C "found use_srtp extension" \ |
| 8827 | -C "found srtp profile" \ |
| 8828 | -C "selected srtp profile" \ |
| 8829 | -C "DTLS-SRTP key material is"\ |
| 8830 | -C "error" |
| 8831 | |
| 8832 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8833 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8834 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 8835 | "$O_SRV -dtls" \ |
| 8836 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8837 | 0 \ |
| 8838 | -c "client hello, adding use_srtp extension" \ |
| 8839 | -C "found use_srtp extension" \ |
| 8840 | -C "found srtp profile" \ |
| 8841 | -C "selected srtp profile" \ |
| 8842 | -C "DTLS-SRTP key material is"\ |
| 8843 | -C "error" |
| 8844 | |
| 8845 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8846 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8847 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 8848 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8849 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8850 | 0 \ |
| 8851 | -c "client hello, adding use_srtp extension" \ |
| 8852 | -c "found use_srtp extension" \ |
| 8853 | -c "found srtp profile" \ |
| 8854 | -c "selected srtp profile" \ |
| 8855 | -c "DTLS-SRTP key material is"\ |
| 8856 | -c "DTLS-SRTP no mki value negotiated"\ |
| 8857 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8858 | -C "dumping 'received mki' (8 bytes)" \ |
| 8859 | -C "error" |
| 8860 | |
| 8861 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8862 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8863 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8864 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8865 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8866 | "$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] | 8867 | 0 \ |
| 8868 | -s "found use_srtp extension" \ |
| 8869 | -s "found srtp profile" \ |
| 8870 | -s "selected srtp profile" \ |
| 8871 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8872 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8873 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 8874 | |
| 8875 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8876 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8877 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8878 | 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] | 8879 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8880 | "$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] | 8881 | 0 \ |
| 8882 | -s "found use_srtp extension" \ |
| 8883 | -s "found srtp profile" \ |
| 8884 | -s "selected srtp profile" \ |
| 8885 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8886 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8887 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 8888 | |
| 8889 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8890 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8891 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8892 | 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] | 8893 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8894 | "$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] | 8895 | 0 \ |
| 8896 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8897 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8898 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8899 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8900 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8901 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 8902 | |
| 8903 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8904 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8905 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8906 | 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] | 8907 | "$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] | 8908 | "$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] | 8909 | 0 \ |
| 8910 | -s "found use_srtp extension" \ |
| 8911 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8912 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8913 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8914 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8915 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 8916 | |
| 8917 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8918 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8919 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8920 | 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] | 8921 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8922 | "$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] | 8923 | 0 \ |
| 8924 | -s "found use_srtp extension" \ |
| 8925 | -s "found srtp profile" \ |
| 8926 | -s "selected srtp profile" \ |
| 8927 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8928 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8929 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 8930 | |
| 8931 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8932 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8933 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8934 | 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] | 8935 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 8936 | "$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] | 8937 | 0 \ |
| 8938 | -s "found use_srtp extension" \ |
| 8939 | -s "found srtp profile" \ |
| 8940 | -S "selected srtp profile" \ |
| 8941 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8942 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8943 | -C "SRTP profile:" |
| 8944 | |
| 8945 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8946 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8947 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8948 | 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] | 8949 | "$P_SRV dtls=1 debug_level=3" \ |
| 8950 | "$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] | 8951 | 0 \ |
| 8952 | -s "found use_srtp extension" \ |
| 8953 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8954 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8955 | -C "SRTP profile:" |
| 8956 | |
| 8957 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8958 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8959 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8960 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 8961 | "$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" \ |
| 8962 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8963 | 0 \ |
| 8964 | -c "client hello, adding use_srtp extension" \ |
| 8965 | -c "found use_srtp extension" \ |
| 8966 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8967 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8968 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8969 | -C "error" |
| 8970 | |
| 8971 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8972 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8973 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8974 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 8975 | "$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" \ |
| 8976 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8977 | 0 \ |
| 8978 | -c "client hello, adding use_srtp extension" \ |
| 8979 | -c "found use_srtp extension" \ |
| 8980 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8981 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8982 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8983 | -C "error" |
| 8984 | |
| 8985 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8986 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8987 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8988 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 8989 | "$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" \ |
| 8990 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8991 | 0 \ |
| 8992 | -c "client hello, adding use_srtp extension" \ |
| 8993 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8994 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8995 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8996 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8997 | -C "error" |
| 8998 | |
| 8999 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9000 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9001 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9002 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 9003 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9004 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9005 | 0 \ |
| 9006 | -c "client hello, adding use_srtp extension" \ |
| 9007 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9008 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9009 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9010 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9011 | -C "error" |
| 9012 | |
| 9013 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9014 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9015 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9016 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 9017 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9018 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9019 | 0 \ |
| 9020 | -c "client hello, adding use_srtp extension" \ |
| 9021 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9022 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9023 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9024 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9025 | -C "error" |
| 9026 | |
| 9027 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9028 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9029 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9030 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 9031 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9032 | "$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] | 9033 | 0 \ |
| 9034 | -c "client hello, adding use_srtp extension" \ |
| 9035 | -C "found use_srtp extension" \ |
| 9036 | -C "found srtp profile" \ |
| 9037 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9038 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9039 | -C "error" |
| 9040 | |
| 9041 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9042 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9043 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9044 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 9045 | "$G_SRV -u" \ |
| 9046 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9047 | 0 \ |
| 9048 | -c "client hello, adding use_srtp extension" \ |
| 9049 | -C "found use_srtp extension" \ |
| 9050 | -C "found srtp profile" \ |
| 9051 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9052 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9053 | -C "error" |
| 9054 | |
| 9055 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9056 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9057 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9058 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 9059 | "$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" \ |
| 9060 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9061 | 0 \ |
| 9062 | -c "client hello, adding use_srtp extension" \ |
| 9063 | -c "found use_srtp extension" \ |
| 9064 | -c "found srtp profile" \ |
| 9065 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9066 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 9067 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9068 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9069 | -c "dumping 'received mki' (8 bytes)" \ |
| 9070 | -C "error" |
| 9071 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 9072 | # Tests for specific things with "unreliable" UDP connection |
| 9073 | |
| 9074 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9075 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 9076 | run_test "DTLS proxy: reference" \ |
| 9077 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9078 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 9079 | "$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] | 9080 | 0 \ |
| 9081 | -C "replayed record" \ |
| 9082 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 9083 | -C "Buffer record from epoch" \ |
| 9084 | -S "Buffer record from epoch" \ |
| 9085 | -C "ssl_buffer_message" \ |
| 9086 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 9087 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9088 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 9089 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9090 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 9091 | -c "HTTP/1.0 200 OK" |
| 9092 | |
| 9093 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9094 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9095 | run_test "DTLS proxy: duplicate every packet" \ |
| 9096 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9097 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 9098 | "$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] | 9099 | 0 \ |
| 9100 | -c "replayed record" \ |
| 9101 | -s "replayed record" \ |
| 9102 | -c "record from another epoch" \ |
| 9103 | -s "record from another epoch" \ |
| 9104 | -S "resend" \ |
| 9105 | -s "Extra-header:" \ |
| 9106 | -c "HTTP/1.0 200 OK" |
| 9107 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9108 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9109 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 9110 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9111 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 9112 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9113 | 0 \ |
| 9114 | -c "replayed record" \ |
| 9115 | -S "replayed record" \ |
| 9116 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9117 | -s "record from another epoch" \ |
| 9118 | -c "resend" \ |
| 9119 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9120 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9121 | -c "HTTP/1.0 200 OK" |
| 9122 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9123 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9124 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 9125 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9126 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 9127 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9128 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9129 | -c "next record in same datagram" \ |
| 9130 | -s "next record in same datagram" |
| 9131 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9132 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9133 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 9134 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9135 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 9136 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9137 | 0 \ |
| 9138 | -c "next record in same datagram" \ |
| 9139 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9140 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9141 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9142 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 9143 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9144 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 9145 | "$P_CLI dtls=1 dgram_packing=0 debug_level=1 read_timeout=100" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9146 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9147 | -c "discarding invalid record (mac)" \ |
| 9148 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9149 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9150 | -c "HTTP/1.0 200 OK" \ |
| 9151 | -S "too many records with bad MAC" \ |
| 9152 | -S "Verification of the message MAC failed" |
| 9153 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9154 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9155 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 9156 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9157 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 9158 | "$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] | 9159 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9160 | -C "discarding invalid record (mac)" \ |
| 9161 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9162 | -S "Extra-header:" \ |
| 9163 | -C "HTTP/1.0 200 OK" \ |
| 9164 | -s "too many records with bad MAC" \ |
| 9165 | -s "Verification of the message MAC failed" |
| 9166 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9167 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9168 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 9169 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9170 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 9171 | "$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] | 9172 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9173 | -c "discarding invalid record (mac)" \ |
| 9174 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9175 | -s "Extra-header:" \ |
| 9176 | -c "HTTP/1.0 200 OK" \ |
| 9177 | -S "too many records with bad MAC" \ |
| 9178 | -S "Verification of the message MAC failed" |
| 9179 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9180 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9181 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 9182 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9183 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 9184 | "$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] | 9185 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9186 | -c "discarding invalid record (mac)" \ |
| 9187 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9188 | -s "Extra-header:" \ |
| 9189 | -c "HTTP/1.0 200 OK" \ |
| 9190 | -s "too many records with bad MAC" \ |
| 9191 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9192 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9193 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9194 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 9195 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 9196 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 9197 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9198 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9199 | -c "record from another epoch" \ |
| 9200 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9201 | -s "Extra-header:" \ |
| 9202 | -c "HTTP/1.0 200 OK" |
| 9203 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 9204 | # Tests for reordering support with DTLS |
| 9205 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9206 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9207 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 9208 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9209 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9210 | hs_timeout=2500-60000" \ |
| 9211 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9212 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 9213 | 0 \ |
| 9214 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9215 | -c "Next handshake message has been buffered - load"\ |
| 9216 | -S "Buffering HS message" \ |
| 9217 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9218 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9219 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9220 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9221 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 9222 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9223 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9224 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 9225 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9226 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9227 | hs_timeout=2500-60000" \ |
| 9228 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9229 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9230 | 0 \ |
| 9231 | -c "Buffering HS message" \ |
| 9232 | -c "found fragmented DTLS handshake message"\ |
| 9233 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 9234 | -c "Next handshake message has been buffered - load"\ |
| 9235 | -S "Buffering HS message" \ |
| 9236 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9237 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9238 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9239 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 9240 | -S "Remember CCS message" |
| 9241 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9242 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 9243 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 9244 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 9245 | # while keeping the ServerKeyExchange. |
| 9246 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9247 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9248 | 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] | 9249 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9250 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9251 | hs_timeout=2500-60000" \ |
| 9252 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9253 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9254 | 0 \ |
| 9255 | -c "Buffering HS message" \ |
| 9256 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9257 | -C "attempt to make space by freeing buffered messages" \ |
| 9258 | -S "Buffering HS message" \ |
| 9259 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9260 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9261 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9262 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9263 | -S "Remember CCS message" |
| 9264 | |
| 9265 | # The size constraints ensure that the delayed certificate message can't |
| 9266 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 9267 | # when dropping it first. |
| 9268 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 9269 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9270 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9271 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 9272 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9273 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9274 | hs_timeout=2500-60000" \ |
| 9275 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9276 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9277 | 0 \ |
| 9278 | -c "Buffering HS message" \ |
| 9279 | -c "attempt to make space by freeing buffered future messages" \ |
| 9280 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9281 | -S "Buffering HS message" \ |
| 9282 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9283 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9284 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9285 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9286 | -S "Remember CCS message" |
| 9287 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9288 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9289 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 9290 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9291 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 9292 | hs_timeout=2500-60000" \ |
| 9293 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9294 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9295 | 0 \ |
| 9296 | -C "Buffering HS message" \ |
| 9297 | -C "Next handshake message has been buffered - load"\ |
| 9298 | -s "Buffering HS message" \ |
| 9299 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9300 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9301 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9302 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9303 | -S "Remember CCS message" |
| 9304 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9305 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9306 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 9307 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9308 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9309 | hs_timeout=2500-60000" \ |
| 9310 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9311 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9312 | 0 \ |
| 9313 | -C "Buffering HS message" \ |
| 9314 | -C "Next handshake message has been buffered - load"\ |
| 9315 | -S "Buffering HS message" \ |
| 9316 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9317 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9318 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9319 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9320 | -S "Remember CCS message" |
| 9321 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9322 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9323 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 9324 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9325 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9326 | hs_timeout=2500-60000" \ |
| 9327 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9328 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9329 | 0 \ |
| 9330 | -C "Buffering HS message" \ |
| 9331 | -C "Next handshake message has been buffered - load"\ |
| 9332 | -S "Buffering HS message" \ |
| 9333 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9334 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9335 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9336 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9337 | -s "Remember CCS message" |
| 9338 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9339 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9340 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9341 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9342 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9343 | hs_timeout=2500-60000" \ |
| 9344 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9345 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 9346 | 0 \ |
| 9347 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9348 | -s "Found buffered record from current epoch - load" \ |
| 9349 | -c "Buffer record from epoch 1" \ |
| 9350 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9351 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9352 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 9353 | # from the server are delayed, so that the encrypted Finished message |
| 9354 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 9355 | # in afterwards, the encrypted Finished message must be freed in order |
| 9356 | # to make space for the NewSessionTicket to be reassembled. |
| 9357 | # This works only in very particular circumstances: |
| 9358 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 9359 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 9360 | # the encrypted Finished message. |
| 9361 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 9362 | # needs to be fragmented. |
| 9363 | # - All messages sent by the server must be small enough to be either sent |
| 9364 | # without fragmentation or be reassembled within the bounds of |
| 9365 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 9366 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 9367 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 9368 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9369 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9370 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 9371 | -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] | 9372 | "$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] | 9373 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 9374 | 0 \ |
| 9375 | -s "Buffer record from epoch 1" \ |
| 9376 | -s "Found buffered record from current epoch - load" \ |
| 9377 | -c "Buffer record from epoch 1" \ |
| 9378 | -C "Found buffered record from current epoch - load" \ |
| 9379 | -c "Enough space available after freeing future epoch record" |
| 9380 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 9381 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 9382 | |
| 9383 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9384 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9385 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 9386 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9387 | "$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] | 9388 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9389 | "$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] | 9390 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9391 | 0 \ |
| 9392 | -s "Extra-header:" \ |
| 9393 | -c "HTTP/1.0 200 OK" |
| 9394 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9395 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9396 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9397 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 9398 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9399 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 9400 | "$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] | 9401 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9402 | 0 \ |
| 9403 | -s "Extra-header:" \ |
| 9404 | -c "HTTP/1.0 200 OK" |
| 9405 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9406 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9407 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9408 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 9409 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9410 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 9411 | "$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] | 9412 | 0 \ |
| 9413 | -s "Extra-header:" \ |
| 9414 | -c "HTTP/1.0 200 OK" |
| 9415 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9416 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9417 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9418 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 9419 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9420 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 9421 | "$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] | 9422 | 0 \ |
| 9423 | -s "Extra-header:" \ |
| 9424 | -c "HTTP/1.0 200 OK" |
| 9425 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9426 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9427 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9428 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 9429 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9430 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 9431 | "$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] | 9432 | 0 \ |
| 9433 | -s "Extra-header:" \ |
| 9434 | -c "HTTP/1.0 200 OK" |
| 9435 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9436 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9437 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9438 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 9439 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9440 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 9441 | "$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] | 9442 | 0 \ |
| 9443 | -s "Extra-header:" \ |
| 9444 | -c "HTTP/1.0 200 OK" |
| 9445 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9446 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9447 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9448 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 9449 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9450 | "$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] | 9451 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9452 | "$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] | 9453 | 0 \ |
| 9454 | -s "Extra-header:" \ |
| 9455 | -c "HTTP/1.0 200 OK" |
| 9456 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9457 | client_needs_more_time 4 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9458 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame^] | 9459 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 9460 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 9461 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9462 | "$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] | 9463 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9464 | "$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] | 9465 | 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] | 9466 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9467 | 0 \ |
| 9468 | -s "a session has been resumed" \ |
| 9469 | -c "a session has been resumed" \ |
| 9470 | -s "Extra-header:" \ |
| 9471 | -c "HTTP/1.0 200 OK" |
| 9472 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9473 | client_needs_more_time 4 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9474 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame^] | 9475 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 9476 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 9477 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9478 | "$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] | 9479 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9480 | "$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] | 9481 | 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] | 9482 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 9483 | 0 \ |
| 9484 | -s "a session has been resumed" \ |
| 9485 | -c "a session has been resumed" \ |
| 9486 | -s "Extra-header:" \ |
| 9487 | -c "HTTP/1.0 200 OK" |
| 9488 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9489 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9490 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9491 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9492 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 9493 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9494 | "$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] | 9495 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9496 | "$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] | 9497 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 9498 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9499 | 0 \ |
| 9500 | -c "=> renegotiate" \ |
| 9501 | -s "=> renegotiate" \ |
| 9502 | -s "Extra-header:" \ |
| 9503 | -c "HTTP/1.0 200 OK" |
| 9504 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9505 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9506 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9507 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9508 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 9509 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9510 | "$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] | 9511 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9512 | "$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] | 9513 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9514 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9515 | 0 \ |
| 9516 | -c "=> renegotiate" \ |
| 9517 | -s "=> renegotiate" \ |
| 9518 | -s "Extra-header:" \ |
| 9519 | -c "HTTP/1.0 200 OK" |
| 9520 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9521 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9522 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9523 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9524 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 9525 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9526 | "$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] | 9527 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9528 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9529 | "$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] | 9530 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9531 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9532 | 0 \ |
| 9533 | -c "=> renegotiate" \ |
| 9534 | -s "=> renegotiate" \ |
| 9535 | -s "Extra-header:" \ |
| 9536 | -c "HTTP/1.0 200 OK" |
| 9537 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9538 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9539 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9540 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9541 | 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] | 9542 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9543 | "$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] | 9544 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9545 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9546 | "$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] | 9547 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9548 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9549 | 0 \ |
| 9550 | -c "=> renegotiate" \ |
| 9551 | -s "=> renegotiate" \ |
| 9552 | -s "Extra-header:" \ |
| 9553 | -c "HTTP/1.0 200 OK" |
| 9554 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9555 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 9556 | ## all versions installed on the CI machines), reported here: |
| 9557 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 9558 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 9559 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 9560 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9561 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9562 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9563 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9564 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 9565 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 9566 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9567 | "$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] | 9568 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 9569 | -c "HTTP/1.0 200 OK" |
| 9570 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9571 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9572 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9573 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9574 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9575 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 9576 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 9577 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9578 | "$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] | 9579 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9580 | -c "HTTP/1.0 200 OK" |
| 9581 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9582 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9583 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9584 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9585 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9586 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 9587 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 9588 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9589 | "$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] | 9590 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9591 | -c "HTTP/1.0 200 OK" |
| 9592 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 9593 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9594 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9595 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9596 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9597 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 9598 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 9599 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9600 | "$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] | 9601 | 0 \ |
| 9602 | -s "Extra-header:" \ |
| 9603 | -c "Extra-header:" |
| 9604 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9605 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9606 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9607 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9608 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9609 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 9610 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9611 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9612 | "$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] | 9613 | 0 \ |
| 9614 | -s "Extra-header:" \ |
| 9615 | -c "Extra-header:" |
| 9616 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9617 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9618 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9619 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9620 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9621 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 9622 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9623 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9624 | "$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] | 9625 | 0 \ |
| 9626 | -s "Extra-header:" \ |
| 9627 | -c "Extra-header:" |
| 9628 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9629 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 9630 | run_test "export keys functionality" \ |
| 9631 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 9632 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 9633 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 9634 | -c "EAP-TLS key material is:"\ |
| 9635 | -s "EAP-TLS key material is:"\ |
| 9636 | -c "EAP-TLS IV is:" \ |
| 9637 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 9638 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 9639 | # openssl feature tests: check if tls1.3 exists. |
| 9640 | requires_openssl_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9641 | run_test "TLS 1.3: Test openssl tls1_3 feature" \ |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 9642 | "$O_NEXT_SRV -tls1_3 -msg" \ |
| 9643 | "$O_NEXT_CLI -tls1_3 -msg" \ |
| 9644 | 0 \ |
| 9645 | -c "TLS 1.3" \ |
| 9646 | -s "TLS 1.3" |
| 9647 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 9648 | # 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] | 9649 | requires_gnutls_tls1_3 |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 9650 | requires_gnutls_next_no_ticket |
| 9651 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9652 | run_test "TLS 1.3: Test gnutls tls1_3 feature" \ |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 9653 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE --disable-client-cert " \ |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 9654 | "$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] | 9655 | 0 \ |
| 9656 | -s "Version: TLS1.3" \ |
| 9657 | -c "Version: TLS1.3" |
| 9658 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 9659 | # TLS1.3 test cases |
| 9660 | # TODO: remove or rewrite this test case if #4832 is resolved. |
| 9661 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9662 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 9663 | skip_handshake_stage_check |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9664 | run_test "TLS 1.3: Not supported version check: tls12 and tls13" \ |
Xiaofei Bai | d25fab6 | 2021-12-02 06:36:27 +0000 | [diff] [blame] | 9665 | "$P_SRV debug_level=1 min_version=tls12 max_version=tls13" \ |
| 9666 | "$P_CLI debug_level=1 min_version=tls12 max_version=tls13" \ |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 9667 | 1 \ |
| 9668 | -s "SSL - The requested feature is not available" \ |
| 9669 | -c "SSL - The requested feature is not available" \ |
| 9670 | -s "Hybrid TLS 1.2 + TLS 1.3 configurations are not yet supported" \ |
| 9671 | -c "Hybrid TLS 1.2 + TLS 1.3 configurations are not yet supported" |
| 9672 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9673 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9674 | run_test "TLS 1.3: handshake dispatch test: tls13 only" \ |
Xiaofei Bai | d25fab6 | 2021-12-02 06:36:27 +0000 | [diff] [blame] | 9675 | "$P_SRV debug_level=2 min_version=tls13 max_version=tls13" \ |
| 9676 | "$P_CLI debug_level=2 min_version=tls13 max_version=tls13" \ |
Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 9677 | 1 \ |
Jerry Yu | e3b3412 | 2021-09-28 17:53:35 +0800 | [diff] [blame] | 9678 | -s "tls13 server state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 9679 | -c "tls13 client state: MBEDTLS_SSL_HELLO_REQUEST" |
Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 9680 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 9681 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9682 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9683 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9684 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9685 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9686 | run_test "TLS 1.3: minimal feature sets - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9687 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
Xiaofei Bai | d25fab6 | 2021-12-02 06:36:27 +0000 | [diff] [blame] | 9688 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 9689 | 0 \ |
Jerry Yu | cdcc55f | 2021-11-11 13:26:33 +0800 | [diff] [blame] | 9690 | -c "tls13 client state: MBEDTLS_SSL_HELLO_REQUEST(0)" \ |
| 9691 | -c "tls13 client state: MBEDTLS_SSL_SERVER_HELLO(2)" \ |
| 9692 | -c "tls13 client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS(19)" \ |
| 9693 | -c "tls13 client state: MBEDTLS_SSL_CERTIFICATE_REQUEST(5)" \ |
| 9694 | -c "tls13 client state: MBEDTLS_SSL_SERVER_CERTIFICATE(3)" \ |
| 9695 | -c "tls13 client state: MBEDTLS_SSL_CERTIFICATE_VERIFY(9)" \ |
| 9696 | -c "tls13 client state: MBEDTLS_SSL_SERVER_FINISHED(13)" \ |
| 9697 | -c "tls13 client state: MBEDTLS_SSL_CLIENT_FINISHED(11)" \ |
| 9698 | -c "tls13 client state: MBEDTLS_SSL_FLUSH_BUFFERS(14)" \ |
| 9699 | -c "tls13 client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP(15)" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 9700 | -c "<= ssl_tls13_process_server_hello" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 9701 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 9702 | -c "ECDH curve: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 9703 | -c "=> ssl_tls13_process_server_hello" \ |
Jerry Yu | daac359 | 2021-10-29 20:01:42 +0800 | [diff] [blame] | 9704 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 9705 | -c "Certificate verification flags clear" \ |
Jerry Yu | 5398c10 | 2021-11-05 13:32:38 +0800 | [diff] [blame] | 9706 | -c "=> parse certificate verify" \ |
| 9707 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 9708 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 9709 | -c "<= parse finished message" \ |
Gilles Peskine | c63a1e0 | 2022-01-13 01:10:24 +0100 | [diff] [blame] | 9710 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 9711 | -c "HTTP/1.0 200 ok" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 9712 | |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 9713 | requires_gnutls_tls1_3 |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 9714 | requires_gnutls_next_no_ticket |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9715 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9716 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9717 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9718 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9719 | run_test "TLS 1.3: minimal feature sets - gnutls" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9720 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --disable-client-cert" \ |
Xiaofei Bai | d25fab6 | 2021-12-02 06:36:27 +0000 | [diff] [blame] | 9721 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 9722 | 0 \ |
Jerry Yu | cdcc55f | 2021-11-11 13:26:33 +0800 | [diff] [blame] | 9723 | -s "SERVER HELLO was queued" \ |
| 9724 | -c "tls13 client state: MBEDTLS_SSL_HELLO_REQUEST(0)" \ |
| 9725 | -c "tls13 client state: MBEDTLS_SSL_SERVER_HELLO(2)" \ |
| 9726 | -c "tls13 client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS(19)" \ |
| 9727 | -c "tls13 client state: MBEDTLS_SSL_CERTIFICATE_REQUEST(5)" \ |
| 9728 | -c "tls13 client state: MBEDTLS_SSL_SERVER_CERTIFICATE(3)" \ |
| 9729 | -c "tls13 client state: MBEDTLS_SSL_CERTIFICATE_VERIFY(9)" \ |
| 9730 | -c "tls13 client state: MBEDTLS_SSL_SERVER_FINISHED(13)" \ |
| 9731 | -c "tls13 client state: MBEDTLS_SSL_CLIENT_FINISHED(11)" \ |
| 9732 | -c "tls13 client state: MBEDTLS_SSL_FLUSH_BUFFERS(14)" \ |
| 9733 | -c "tls13 client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP(15)" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 9734 | -c "<= ssl_tls13_process_server_hello" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 9735 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 9736 | -c "ECDH curve: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 9737 | -c "=> ssl_tls13_process_server_hello" \ |
Jerry Yu | daac359 | 2021-10-29 20:01:42 +0800 | [diff] [blame] | 9738 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 9739 | -c "Certificate verification flags clear" \ |
Jerry Yu | 5398c10 | 2021-11-05 13:32:38 +0800 | [diff] [blame] | 9740 | -c "=> parse certificate verify" \ |
| 9741 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 9742 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 9743 | -c "<= parse finished message" \ |
Gilles Peskine | 860429f | 2022-02-12 00:44:48 +0100 | [diff] [blame] | 9744 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 9745 | -c "HTTP/1.0 200 OK" |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 9746 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9747 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9748 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9749 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9750 | skip_handshake_stage_check |
| 9751 | requires_gnutls_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9752 | run_test "TLS 1.3:Not supported version check:gnutls: srv max TLS 1.0" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9753 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0 -d 4" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9754 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9755 | 1 \ |
| 9756 | -s "Client's version: 3.3" \ |
| 9757 | -c "is a fatal alert message (msg 40)" \ |
| 9758 | -S "Version: TLS1.0" \ |
| 9759 | -C "Protocol is TLSv1.0" |
| 9760 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9761 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9762 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9763 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9764 | skip_handshake_stage_check |
| 9765 | requires_gnutls_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9766 | run_test "TLS 1.3:Not supported version check:gnutls: srv max TLS 1.1" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9767 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1 -d 4" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9768 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9769 | 1 \ |
| 9770 | -s "Client's version: 3.3" \ |
| 9771 | -c "is a fatal alert message (msg 40)" \ |
| 9772 | -S "Version: TLS1.1" \ |
| 9773 | -C "Protocol is TLSv1.1" |
| 9774 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9775 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9776 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9777 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9778 | skip_handshake_stage_check |
| 9779 | requires_gnutls_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9780 | run_test "TLS 1.3:Not supported version check:gnutls: srv max TLS 1.2" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9781 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2 -d 4" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9782 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9783 | 1 \ |
| 9784 | -s "Client's version: 3.3" \ |
| 9785 | -c "is a fatal alert message (msg 40)" \ |
| 9786 | -S "Version: TLS1.2" \ |
| 9787 | -C "Protocol is TLSv1.2" |
| 9788 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9789 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9790 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9791 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9792 | skip_handshake_stage_check |
| 9793 | requires_openssl_next |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9794 | run_test "TLS 1.3:Not supported version check:openssl: srv max TLS 1.0" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9795 | "$O_NEXT_SRV -msg -tls1" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9796 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9797 | 1 \ |
| 9798 | -s "fatal protocol_version" \ |
| 9799 | -c "is a fatal alert message (msg 70)" \ |
| 9800 | -S "Version: TLS1.0" \ |
| 9801 | -C "Protocol : TLSv1.0" |
| 9802 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9803 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9804 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9805 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9806 | skip_handshake_stage_check |
| 9807 | requires_openssl_next |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9808 | run_test "TLS 1.3:Not supported version check:openssl: srv max TLS 1.1" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9809 | "$O_NEXT_SRV -msg -tls1_1" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9810 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9811 | 1 \ |
| 9812 | -s "fatal protocol_version" \ |
| 9813 | -c "is a fatal alert message (msg 70)" \ |
| 9814 | -S "Version: TLS1.1" \ |
| 9815 | -C "Protocol : TLSv1.1" |
| 9816 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9817 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9818 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9819 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9820 | skip_handshake_stage_check |
| 9821 | requires_openssl_next |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9822 | run_test "TLS 1.3:Not supported version check:openssl: srv max TLS 1.2" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9823 | "$O_NEXT_SRV -msg -tls1_2" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9824 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9825 | 1 \ |
| 9826 | -s "fatal protocol_version" \ |
| 9827 | -c "is a fatal alert message (msg 70)" \ |
| 9828 | -S "Version: TLS1.2" \ |
| 9829 | -C "Protocol : TLSv1.2" |
| 9830 | |
Jerry Yu | 936dffd | 2021-11-22 18:34:36 +0800 | [diff] [blame] | 9831 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9832 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9833 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9834 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9835 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9836 | run_test "TLS 1.3: CertificateRequest check - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9837 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9838 | "$P_CLI debug_level=4 force_version=tls13 " \ |
Jerry Yu | 936dffd | 2021-11-22 18:34:36 +0800 | [diff] [blame] | 9839 | 1 \ |
Xiaofei Bai | 5d8598e | 2022-01-11 05:56:06 +0000 | [diff] [blame] | 9840 | -c "=> parse certificate request" \ |
Xiaofei Bai | 69fcd39 | 2022-01-20 08:25:00 +0000 | [diff] [blame] | 9841 | -c "got a certificate request" \ |
Xiaofei Bai | 5d8598e | 2022-01-11 05:56:06 +0000 | [diff] [blame] | 9842 | -c "<= parse certificate request" |
Jerry Yu | 936dffd | 2021-11-22 18:34:36 +0800 | [diff] [blame] | 9843 | |
| 9844 | requires_gnutls_tls1_3 |
| 9845 | requires_gnutls_next_no_ticket |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9846 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9847 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9848 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9849 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9850 | run_test "TLS 1.3: CertificateRequest check - gnutls" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9851 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9852 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
Jerry Yu | 936dffd | 2021-11-22 18:34:36 +0800 | [diff] [blame] | 9853 | 1 \ |
Xiaofei Bai | 5d8598e | 2022-01-11 05:56:06 +0000 | [diff] [blame] | 9854 | -c "=> parse certificate request" \ |
Xiaofei Bai | 69fcd39 | 2022-01-20 08:25:00 +0000 | [diff] [blame] | 9855 | -c "got a certificate request" \ |
Xiaofei Bai | 5d8598e | 2022-01-11 05:56:06 +0000 | [diff] [blame] | 9856 | -c "<= parse certificate request" |
Jerry Yu | 936dffd | 2021-11-22 18:34:36 +0800 | [diff] [blame] | 9857 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9858 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9859 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9860 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9861 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 9862 | requires_openssl_tls1_3 |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 9863 | run_test "TLS 1.3: HelloRetryRequest check, ciphersuite TLS_AES_128_GCM_SHA256 - openssl" \ |
| 9864 | "$O_NEXT_SRV -ciphersuites TLS_AES_128_GCM_SHA256 -sigalgs ecdsa_secp256r1_sha256 -groups P-256 -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
| 9865 | "$P_CLI debug_level=4 force_version=tls13" \ |
| 9866 | 0 \ |
| 9867 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 9868 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
| 9869 | -c "tls13 client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 9870 | -c "HTTP/1.0 200 ok" |
| 9871 | |
| 9872 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 9873 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 9874 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9875 | requires_config_enabled MBEDTLS_SSL_CLI_C |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 9876 | requires_openssl_tls1_3 |
| 9877 | run_test "TLS 1.3: HelloRetryRequest check, ciphersuite TLS_AES_256_GCM_SHA384 - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9878 | "$O_NEXT_SRV -ciphersuites TLS_AES_256_GCM_SHA384 -sigalgs ecdsa_secp256r1_sha256 -groups P-256 -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9879 | "$P_CLI debug_level=4 force_version=tls13" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 9880 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 9881 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 9882 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
| 9883 | -c "tls13 client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 9884 | -c "HTTP/1.0 200 ok" |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 9885 | |
| 9886 | requires_gnutls_tls1_3 |
| 9887 | requires_gnutls_next_no_ticket |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9888 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9889 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9890 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9891 | requires_config_enabled MBEDTLS_SSL_CLI_C |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 9892 | run_test "TLS 1.3: HelloRetryRequest check, ciphersuite TLS_AES_128_GCM_SHA256 - gnutls" \ |
| 9893 | "$G_NEXT_SRV -d 4 --priority=NONE:+GROUP-SECP256R1:+AES-128-GCM:+SHA256:+AEAD:+SIGN-ECDSA-SECP256R1-SHA256:+VERS-TLS1.3:%NO_TICKETS --disable-client-cert" \ |
| 9894 | "$P_CLI debug_level=4 force_version=tls13" \ |
| 9895 | 0 \ |
| 9896 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 9897 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
| 9898 | -c "tls13 client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 9899 | -c "HTTP/1.0 200 OK" |
| 9900 | |
| 9901 | requires_gnutls_tls1_3 |
| 9902 | requires_gnutls_next_no_ticket |
| 9903 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 9904 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 9905 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9906 | requires_config_enabled MBEDTLS_SSL_CLI_C |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 9907 | run_test "TLS 1.3: HelloRetryRequest check, ciphersuite TLS_AES_256_GCM_SHA384 - gnutls" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 9908 | "$G_NEXT_SRV -d 4 --priority=NONE:+GROUP-SECP256R1:+AES-256-GCM:+SHA384:+AEAD:+SIGN-ECDSA-SECP256R1-SHA256:+VERS-TLS1.3:%NO_TICKETS --disable-client-cert" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9909 | "$P_CLI debug_level=4 force_version=tls13" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 9910 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 9911 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 9912 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
| 9913 | -c "tls13 client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 9914 | -c "HTTP/1.0 200 OK" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9915 | |
Gilles Peskine | 2baaf60 | 2022-01-07 15:46:12 +0100 | [diff] [blame] | 9916 | for i in opt-testcases/*.sh |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 9917 | do |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 9918 | TEST_SUITE_NAME=${i##*/} |
| 9919 | TEST_SUITE_NAME=${TEST_SUITE_NAME%.*} |
| 9920 | . "$i" |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 9921 | done |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 9922 | unset TEST_SUITE_NAME |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 9923 | |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9924 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9925 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9926 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9927 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9928 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 9929 | run_test "TLS 1.3 m->O both peers do not support middlebox compatibility" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9930 | "$O_NEXT_SRV -msg -tls1_3 -no_middlebox -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
| 9931 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
| 9932 | 0 \ |
| 9933 | -c "HTTP/1.0 200 ok" |
| 9934 | |
| 9935 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9936 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9937 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9938 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9939 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 9940 | run_test "TLS 1.3 m->O server with middlebox compat support, not client" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9941 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
| 9942 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
| 9943 | 1 \ |
| 9944 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 9945 | |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 9946 | requires_gnutls_tls1_3 |
| 9947 | requires_gnutls_next_no_ticket |
| 9948 | requires_gnutls_next_disable_tls13_compat |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9949 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 9950 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 9951 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9952 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 9953 | run_test "TLS 1.3 m->G both peers do not support middlebox compatibility" \ |
| 9954 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE --disable-client-cert" \ |
| 9955 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
| 9956 | 0 \ |
| 9957 | -c "HTTP/1.0 200 OK" |
| 9958 | |
| 9959 | requires_gnutls_tls1_3 |
| 9960 | requires_gnutls_next_no_ticket |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9961 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 9962 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 9963 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9964 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 9965 | run_test "TLS 1.3 m->G server with middlebox compat support, not client" \ |
| 9966 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --disable-client-cert" \ |
| 9967 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
| 9968 | 1 \ |
| 9969 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 9970 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 9971 | # Test heap memory usage after handshake |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9972 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 9973 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 9974 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 9975 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9976 | requires_max_content_len 16384 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 9977 | run_tests_memory_after_hanshake |
| 9978 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 9979 | # Final report |
| 9980 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9981 | echo "------------------------------------------------------------------------" |
| 9982 | |
| 9983 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 9984 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9985 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 9986 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9987 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 9988 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 9989 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9990 | |
| 9991 | exit $FAILS |