Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 3 | # ssl-opt.sh |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 4 | # |
Bence Szépkúti | 1e14827 | 2020-08-07 13:07:28 +0200 | [diff] [blame] | 5 | # Copyright The Mbed TLS Contributors |
Bence Szépkúti | c7da1fe | 2020-05-26 01:54:15 +0200 | [diff] [blame] | 6 | # SPDX-License-Identifier: Apache-2.0 |
| 7 | # |
| 8 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 9 | # not use this file except in compliance with the License. |
| 10 | # You may obtain a copy of the License at |
| 11 | # |
| 12 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 13 | # |
| 14 | # Unless required by applicable law or agreed to in writing, software |
| 15 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 16 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 17 | # See the License for the specific language governing permissions and |
| 18 | # limitations under the License. |
| 19 | # |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 20 | # Purpose |
| 21 | # |
| 22 | # Executes tests to prove various TLS/SSL options and extensions. |
| 23 | # |
| 24 | # The goal is not to cover every ciphersuite/version, but instead to cover |
| 25 | # specific options (max fragment length, truncated hmac, etc) or procedures |
| 26 | # (session resumption from cache or ticket, renego, etc). |
| 27 | # |
| 28 | # The tests assume a build with default options, with exceptions expressed |
| 29 | # with a dependency. The tests focus on functionality and do not consider |
| 30 | # performance. |
| 31 | # |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 32 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 33 | set -u |
| 34 | |
Jaeden Amero | 6e70eb2 | 2019-07-03 13:51:04 +0100 | [diff] [blame] | 35 | # Limit the size of each log to 10 GiB, in case of failures with this script |
| 36 | # where it may output seemingly unlimited length error logs. |
| 37 | ulimit -f 20971520 |
| 38 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 39 | ORIGINAL_PWD=$PWD |
| 40 | if ! cd "$(dirname "$0")"; then |
| 41 | exit 125 |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 42 | fi |
| 43 | |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 44 | # default values, can be overridden by the environment |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 45 | : ${P_SRV:=../programs/ssl/ssl_server2} |
| 46 | : ${P_CLI:=../programs/ssl/ssl_client2} |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 47 | : ${P_PXY:=../programs/test/udp_proxy} |
Jerry Yu | d04fd35 | 2021-12-06 16:52:57 +0800 | [diff] [blame] | 48 | : ${P_QUERY:=../programs/test/query_compile_time_config} |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 49 | : ${OPENSSL_CMD:=openssl} # OPENSSL would conflict with the build system |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 50 | : ${GNUTLS_CLI:=gnutls-cli} |
| 51 | : ${GNUTLS_SERV:=gnutls-serv} |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 52 | : ${PERL:=perl} |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 53 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 54 | guess_config_name() { |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 55 | if git diff --quiet ../include/mbedtls/mbedtls_config.h 2>/dev/null; then |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 56 | echo "default" |
| 57 | else |
| 58 | echo "unknown" |
| 59 | fi |
| 60 | } |
| 61 | : ${MBEDTLS_TEST_OUTCOME_FILE=} |
| 62 | : ${MBEDTLS_TEST_CONFIGURATION:="$(guess_config_name)"} |
| 63 | : ${MBEDTLS_TEST_PLATFORM:="$(uname -s | tr -c \\n0-9A-Za-z _)-$(uname -m | tr -c \\n0-9A-Za-z _)"} |
| 64 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 65 | O_SRV="$OPENSSL_CMD s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 66 | O_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_CMD s_client" |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 67 | G_SRV="$GNUTLS_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 68 | G_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_CLI --x509cafile data_files/test-ca_cat12.crt" |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 69 | TCP_CLIENT="$PERL scripts/tcp_client.pl" |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 70 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 71 | # alternative versions of OpenSSL and GnuTLS (no default path) |
| 72 | |
| 73 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 74 | O_LEGACY_SRV="$OPENSSL_LEGACY s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
| 75 | O_LEGACY_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_LEGACY s_client" |
| 76 | else |
| 77 | O_LEGACY_SRV=false |
| 78 | O_LEGACY_CLI=false |
| 79 | fi |
| 80 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 81 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
XiaokangQian | 30f5560 | 2021-11-24 01:54:50 +0000 | [diff] [blame] | 82 | O_NEXT_SRV="$OPENSSL_NEXT s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 83 | O_NEXT_SRV_NO_CERT="$OPENSSL_NEXT s_server -www " |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 84 | O_NEXT_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_NEXT s_client" |
| 85 | else |
| 86 | O_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 87 | O_NEXT_SRV_NO_CERT=false |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 88 | O_NEXT_CLI=false |
| 89 | fi |
| 90 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 91 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 92 | G_NEXT_SRV="$GNUTLS_NEXT_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 93 | G_NEXT_SRV_NO_CERT="$GNUTLS_NEXT_SERV" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 94 | else |
| 95 | G_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 96 | G_NEXT_SRV_NO_CERT=false |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 97 | fi |
| 98 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 99 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 100 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile data_files/test-ca_cat12.crt" |
| 101 | else |
| 102 | G_NEXT_CLI=false |
| 103 | fi |
| 104 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 105 | TESTS=0 |
| 106 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 107 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 108 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 109 | CONFIG_H='../include/mbedtls/mbedtls_config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 110 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 111 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 112 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 113 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 114 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 115 | SHOW_TEST_NUMBER=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 116 | RUN_TEST_NUMBER='' |
| 117 | |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 118 | PRESERVE_LOGS=0 |
| 119 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 120 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 121 | # port which is this plus 10000. Each port number may be independently |
| 122 | # overridden by a command line option. |
| 123 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 124 | PXY_PORT=$((SRV_PORT + 10000)) |
| 125 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 126 | print_usage() { |
| 127 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 128 | printf " -h|--help\tPrint this help.\n" |
| 129 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 130 | printf " -f|--filter\tOnly matching tests are executed (substring or BRE)\n" |
| 131 | printf " -e|--exclude\tMatching tests are excluded (substring or BRE)\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 132 | printf " -n|--number\tExecute only numbered test (comma-separated, e.g. '245,256')\n" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 133 | printf " -s|--show-numbers\tShow test numbers in front of test names\n" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 134 | printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 135 | printf " --outcome-file\tFile where test outcomes are written\n" |
| 136 | printf " \t(default: \$MBEDTLS_TEST_OUTCOME_FILE, none if empty)\n" |
| 137 | printf " --port \tTCP/UDP port (default: randomish 1xxxx)\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 138 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 139 | printf " --seed \tInteger seed value to use for this test run\n" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 140 | } |
| 141 | |
| 142 | get_options() { |
| 143 | while [ $# -gt 0 ]; do |
| 144 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 145 | -f|--filter) |
| 146 | shift; FILTER=$1 |
| 147 | ;; |
| 148 | -e|--exclude) |
| 149 | shift; EXCLUDE=$1 |
| 150 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 151 | -m|--memcheck) |
| 152 | MEMCHECK=1 |
| 153 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 154 | -n|--number) |
| 155 | shift; RUN_TEST_NUMBER=$1 |
| 156 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 157 | -s|--show-numbers) |
| 158 | SHOW_TEST_NUMBER=1 |
| 159 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 160 | -p|--preserve-logs) |
| 161 | PRESERVE_LOGS=1 |
| 162 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 163 | --port) |
| 164 | shift; SRV_PORT=$1 |
| 165 | ;; |
| 166 | --proxy-port) |
| 167 | shift; PXY_PORT=$1 |
| 168 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 169 | --seed) |
| 170 | shift; SEED="$1" |
| 171 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 172 | -h|--help) |
| 173 | print_usage |
| 174 | exit 0 |
| 175 | ;; |
| 176 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 177 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 178 | print_usage |
| 179 | exit 1 |
| 180 | ;; |
| 181 | esac |
| 182 | shift |
| 183 | done |
| 184 | } |
| 185 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 186 | # Make the outcome file path relative to the original directory, not |
| 187 | # to .../tests |
| 188 | case "$MBEDTLS_TEST_OUTCOME_FILE" in |
| 189 | [!/]*) |
| 190 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" |
| 191 | ;; |
| 192 | esac |
| 193 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 194 | # Read boolean configuration options from mbedtls_config.h for easy and quick |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 195 | # testing. Skip non-boolean options (with something other than spaces |
| 196 | # and a comment after "#define SYMBOL"). The variable contains a |
| 197 | # space-separated list of symbols. |
Jerry Yu | d0fcf7f | 2021-12-10 18:45:51 +0800 | [diff] [blame] | 198 | CONFIGS_ENABLED=" $(echo `$P_QUERY -l` )" |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 199 | # Skip next test; use this macro to skip tests which are legitimate |
| 200 | # in theory and expected to be re-introduced at some point, but |
| 201 | # aren't expected to succeed at the moment due to problems outside |
| 202 | # our control (such as bugs in other TLS implementations). |
| 203 | skip_next_test() { |
| 204 | SKIP_NEXT="YES" |
| 205 | } |
| 206 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 207 | # skip next test if the flag is not enabled in mbedtls_config.h |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 208 | requires_config_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 209 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 210 | *" $1"[\ =]*) :;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 211 | *) SKIP_NEXT="YES";; |
| 212 | esac |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 213 | } |
| 214 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 215 | # skip next test if the flag is enabled in mbedtls_config.h |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 216 | requires_config_disabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 217 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 218 | *" $1"[\ =]*) SKIP_NEXT="YES";; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 219 | esac |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 220 | } |
| 221 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 222 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 223 | # This function uses the query_config command line option to query the |
| 224 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 225 | # program. The command will always return a success value if the |
| 226 | # configuration is defined and the value will be printed to stdout. |
| 227 | # |
| 228 | # Note that if the configuration is not defined or is defined to nothing, |
| 229 | # the output of this function will be an empty string. |
| 230 | ${P_SRV} "query_config=${1}" |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 231 | } |
| 232 | |
| 233 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 234 | VAL="$( get_config_value_or_default "$1" )" |
| 235 | if [ -z "$VAL" ]; then |
| 236 | # Should never happen |
| 237 | echo "Mbed TLS configuration $1 is not defined" |
| 238 | exit 1 |
| 239 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 240 | SKIP_NEXT="YES" |
| 241 | fi |
| 242 | } |
| 243 | |
| 244 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 245 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 246 | if [ -z "$VAL" ]; then |
| 247 | # Should never happen |
| 248 | echo "Mbed TLS configuration $1 is not defined" |
| 249 | exit 1 |
| 250 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 251 | SKIP_NEXT="YES" |
| 252 | fi |
| 253 | } |
| 254 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 255 | requires_config_value_equals() { |
| 256 | VAL=$( get_config_value_or_default "$1" ) |
| 257 | if [ -z "$VAL" ]; then |
| 258 | # Should never happen |
| 259 | echo "Mbed TLS configuration $1 is not defined" |
| 260 | exit 1 |
| 261 | elif [ "$VAL" -ne "$2" ]; then |
| 262 | SKIP_NEXT="YES" |
| 263 | fi |
| 264 | } |
| 265 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 266 | # Space-separated list of ciphersuites supported by this build of |
| 267 | # Mbed TLS. |
| 268 | P_CIPHERSUITES=" $($P_CLI --help 2>/dev/null | |
XiaokangQian | 4b82ca1 | 2021-11-18 08:27:17 +0000 | [diff] [blame] | 269 | grep 'TLS-\|TLS1-3' | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 270 | tr -s ' \n' ' ')" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 271 | requires_ciphersuite_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 272 | case $P_CIPHERSUITES in |
| 273 | *" $1 "*) :;; |
| 274 | *) SKIP_NEXT="YES";; |
| 275 | esac |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 276 | } |
| 277 | |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 278 | # maybe_requires_ciphersuite_enabled CMD [RUN_TEST_OPTION...] |
| 279 | # If CMD (call to a TLS client or server program) requires a specific |
| 280 | # ciphersuite, arrange to only run the test case if this ciphersuite is |
Dave Rodgman | c424098 | 2021-06-29 19:53:16 +0100 | [diff] [blame] | 281 | # enabled. |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 282 | maybe_requires_ciphersuite_enabled() { |
| 283 | case "$1" in |
| 284 | *\ force_ciphersuite=*) :;; |
| 285 | *) return;; # No specific required ciphersuite |
| 286 | esac |
| 287 | ciphersuite="${1##*\ force_ciphersuite=}" |
| 288 | ciphersuite="${ciphersuite%%[!-0-9A-Z_a-z]*}" |
| 289 | shift |
| 290 | |
Dave Rodgman | c424098 | 2021-06-29 19:53:16 +0100 | [diff] [blame] | 291 | requires_ciphersuite_enabled "$ciphersuite" |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 292 | |
| 293 | unset ciphersuite |
| 294 | } |
| 295 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 296 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 297 | requires_openssl_with_fallback_scsv() { |
| 298 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 299 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 300 | then |
| 301 | OPENSSL_HAS_FBSCSV="YES" |
| 302 | else |
| 303 | OPENSSL_HAS_FBSCSV="NO" |
| 304 | fi |
| 305 | fi |
| 306 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 307 | SKIP_NEXT="YES" |
| 308 | fi |
| 309 | } |
| 310 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 311 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 312 | requires_max_content_len() { |
| 313 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 314 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 315 | } |
| 316 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 317 | # skip next test if GnuTLS isn't available |
| 318 | requires_gnutls() { |
| 319 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 320 | if ( which "$GNUTLS_CLI" && which "$GNUTLS_SERV" ) >/dev/null 2>&1; then |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 321 | GNUTLS_AVAILABLE="YES" |
| 322 | else |
| 323 | GNUTLS_AVAILABLE="NO" |
| 324 | fi |
| 325 | fi |
| 326 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 327 | SKIP_NEXT="YES" |
| 328 | fi |
| 329 | } |
| 330 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 331 | # skip next test if GnuTLS-next isn't available |
| 332 | requires_gnutls_next() { |
| 333 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 334 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 335 | GNUTLS_NEXT_AVAILABLE="YES" |
| 336 | else |
| 337 | GNUTLS_NEXT_AVAILABLE="NO" |
| 338 | fi |
| 339 | fi |
| 340 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 341 | SKIP_NEXT="YES" |
| 342 | fi |
| 343 | } |
| 344 | |
| 345 | # skip next test if OpenSSL-legacy isn't available |
| 346 | requires_openssl_legacy() { |
| 347 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 348 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 349 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 350 | else |
| 351 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 352 | fi |
| 353 | fi |
| 354 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 355 | SKIP_NEXT="YES" |
| 356 | fi |
| 357 | } |
| 358 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 359 | requires_openssl_next() { |
| 360 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then |
| 361 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then |
| 362 | OPENSSL_NEXT_AVAILABLE="YES" |
| 363 | else |
| 364 | OPENSSL_NEXT_AVAILABLE="NO" |
| 365 | fi |
| 366 | fi |
| 367 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 368 | SKIP_NEXT="YES" |
| 369 | fi |
| 370 | } |
| 371 | |
| 372 | # skip next test if tls1_3 is not available |
| 373 | requires_openssl_tls1_3() { |
| 374 | requires_openssl_next |
| 375 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 376 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 377 | fi |
| 378 | if [ -z "${OPENSSL_TLS1_3_AVAILABLE:-}" ]; then |
| 379 | if $OPENSSL_NEXT s_client -help 2>&1 | grep tls1_3 >/dev/null |
| 380 | then |
| 381 | OPENSSL_TLS1_3_AVAILABLE="YES" |
| 382 | else |
| 383 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 384 | fi |
| 385 | fi |
| 386 | if [ "$OPENSSL_TLS1_3_AVAILABLE" = "NO" ]; then |
| 387 | SKIP_NEXT="YES" |
| 388 | fi |
| 389 | } |
| 390 | |
| 391 | # skip next test if tls1_3 is not available |
| 392 | requires_gnutls_tls1_3() { |
| 393 | requires_gnutls_next |
| 394 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 395 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 396 | fi |
| 397 | if [ -z "${GNUTLS_TLS1_3_AVAILABLE:-}" ]; then |
| 398 | if $GNUTLS_NEXT_CLI -l 2>&1 | grep VERS-TLS1.3 >/dev/null |
| 399 | then |
| 400 | GNUTLS_TLS1_3_AVAILABLE="YES" |
| 401 | else |
| 402 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 403 | fi |
| 404 | fi |
| 405 | if [ "$GNUTLS_TLS1_3_AVAILABLE" = "NO" ]; then |
| 406 | SKIP_NEXT="YES" |
| 407 | fi |
| 408 | } |
| 409 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 410 | # Check %NO_TICKETS option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 411 | requires_gnutls_next_no_ticket() { |
| 412 | requires_gnutls_next |
| 413 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 414 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 415 | fi |
| 416 | if [ -z "${GNUTLS_NO_TICKETS_AVAILABLE:-}" ]; then |
| 417 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep NO_TICKETS >/dev/null |
| 418 | then |
| 419 | GNUTLS_NO_TICKETS_AVAILABLE="YES" |
| 420 | else |
| 421 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 422 | fi |
| 423 | fi |
| 424 | if [ "$GNUTLS_NO_TICKETS_AVAILABLE" = "NO" ]; then |
| 425 | SKIP_NEXT="YES" |
| 426 | fi |
| 427 | } |
| 428 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 429 | # Check %DISABLE_TLS13_COMPAT_MODE option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 430 | requires_gnutls_next_disable_tls13_compat() { |
| 431 | requires_gnutls_next |
| 432 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 433 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 434 | fi |
| 435 | if [ -z "${GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE:-}" ]; then |
| 436 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep DISABLE_TLS13_COMPAT_MODE >/dev/null |
| 437 | then |
| 438 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="YES" |
| 439 | else |
| 440 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 441 | fi |
| 442 | fi |
| 443 | if [ "$GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE" = "NO" ]; then |
| 444 | SKIP_NEXT="YES" |
| 445 | fi |
| 446 | } |
| 447 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 448 | # skip next test if IPv6 isn't available on this host |
| 449 | requires_ipv6() { |
| 450 | if [ -z "${HAS_IPV6:-}" ]; then |
| 451 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 452 | SRV_PID=$! |
| 453 | sleep 1 |
| 454 | kill $SRV_PID >/dev/null 2>&1 |
| 455 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 456 | HAS_IPV6="NO" |
| 457 | else |
| 458 | HAS_IPV6="YES" |
| 459 | fi |
| 460 | rm -r $SRV_OUT |
| 461 | fi |
| 462 | |
| 463 | if [ "$HAS_IPV6" = "NO" ]; then |
| 464 | SKIP_NEXT="YES" |
| 465 | fi |
| 466 | } |
| 467 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 468 | # skip next test if it's i686 or uname is not available |
| 469 | requires_not_i686() { |
| 470 | if [ -z "${IS_I686:-}" ]; then |
| 471 | IS_I686="YES" |
| 472 | if which "uname" >/dev/null 2>&1; then |
| 473 | if [ -z "$(uname -a | grep i686)" ]; then |
| 474 | IS_I686="NO" |
| 475 | fi |
| 476 | fi |
| 477 | fi |
| 478 | if [ "$IS_I686" = "YES" ]; then |
| 479 | SKIP_NEXT="YES" |
| 480 | fi |
| 481 | } |
| 482 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 483 | # Calculate the input & output maximum content lengths set in the config |
David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 484 | MAX_CONTENT_LEN=16384 |
Yuto Takano | 2be6f1a | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 485 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 486 | MAX_OUT_LEN=$( get_config_value_or_default "MBEDTLS_SSL_OUT_CONTENT_LEN" ) |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 487 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 488 | # Calculate the maximum content length that fits both |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 489 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 490 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 491 | fi |
| 492 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 493 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 494 | fi |
| 495 | |
| 496 | # skip the next test if the SSL output buffer is less than 16KB |
| 497 | requires_full_size_output_buffer() { |
| 498 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 499 | SKIP_NEXT="YES" |
| 500 | fi |
| 501 | } |
| 502 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 503 | # skip the next test if valgrind is in use |
| 504 | not_with_valgrind() { |
| 505 | if [ "$MEMCHECK" -gt 0 ]; then |
| 506 | SKIP_NEXT="YES" |
| 507 | fi |
| 508 | } |
| 509 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 510 | # skip the next test if valgrind is NOT in use |
| 511 | only_with_valgrind() { |
| 512 | if [ "$MEMCHECK" -eq 0 ]; then |
| 513 | SKIP_NEXT="YES" |
| 514 | fi |
| 515 | } |
| 516 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 517 | # multiply the client timeout delay by the given factor for the next test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 518 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 519 | CLI_DELAY_FACTOR=$1 |
| 520 | } |
| 521 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 522 | # wait for the given seconds after the client finished in the next test |
| 523 | server_needs_more_time() { |
| 524 | SRV_DELAY_SECONDS=$1 |
| 525 | } |
| 526 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 527 | # print_name <name> |
| 528 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 529 | TESTS=$(( $TESTS + 1 )) |
| 530 | LINE="" |
| 531 | |
| 532 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 533 | LINE="$TESTS " |
| 534 | fi |
| 535 | |
| 536 | LINE="$LINE$1" |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 537 | printf "%s " "$LINE" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 538 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 539 | for i in `seq 1 $LEN`; do printf '.'; done |
| 540 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 541 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 542 | } |
| 543 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 544 | # record_outcome <outcome> [<failure-reason>] |
| 545 | # The test name must be in $NAME. |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 546 | # Use $TEST_SUITE_NAME as the test suite name if set. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 547 | record_outcome() { |
| 548 | echo "$1" |
| 549 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 550 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 551 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 552 | "${TEST_SUITE_NAME:-ssl-opt}" "$NAME" \ |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 553 | "$1" "${2-}" \ |
| 554 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 555 | fi |
| 556 | } |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 557 | unset TEST_SUITE_NAME |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 558 | |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 559 | # True if the presence of the given pattern in a log definitely indicates |
| 560 | # that the test has failed. False if the presence is inconclusive. |
| 561 | # |
| 562 | # Inputs: |
| 563 | # * $1: pattern found in the logs |
| 564 | # * $TIMES_LEFT: >0 if retrying is an option |
| 565 | # |
| 566 | # Outputs: |
| 567 | # * $outcome: set to a retry reason if the pattern is inconclusive, |
| 568 | # unchanged otherwise. |
| 569 | # * Return value: 1 if the pattern is inconclusive, |
| 570 | # 0 if the failure is definitive. |
| 571 | log_pattern_presence_is_conclusive() { |
| 572 | # If we've run out of attempts, then don't retry no matter what. |
| 573 | if [ $TIMES_LEFT -eq 0 ]; then |
| 574 | return 0 |
| 575 | fi |
| 576 | case $1 in |
| 577 | "resend") |
| 578 | # An undesired resend may have been caused by the OS dropping or |
| 579 | # delaying a packet at an inopportune time. |
| 580 | outcome="RETRY(resend)" |
| 581 | return 1;; |
| 582 | esac |
| 583 | } |
| 584 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 585 | # fail <message> |
| 586 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 587 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 588 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 589 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 590 | mv $SRV_OUT o-srv-${TESTS}.log |
| 591 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 592 | if [ -n "$PXY_CMD" ]; then |
| 593 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 594 | fi |
| 595 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 596 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 597 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 598 | echo " ! server output:" |
| 599 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 600 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 601 | echo " ! client output:" |
| 602 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 603 | if [ -n "$PXY_CMD" ]; then |
| 604 | echo " ! ========================================================" |
| 605 | echo " ! proxy output:" |
| 606 | cat o-pxy-${TESTS}.log |
| 607 | fi |
| 608 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 609 | fi |
| 610 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 611 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 612 | } |
| 613 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 614 | # is_polar <cmd_line> |
| 615 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 616 | case "$1" in |
| 617 | *ssl_client2*) true;; |
| 618 | *ssl_server2*) true;; |
| 619 | *) false;; |
| 620 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 621 | } |
| 622 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 623 | # openssl s_server doesn't have -www with DTLS |
| 624 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 625 | case "$SRV_CMD" in |
| 626 | *s_server*-dtls*) |
| 627 | NEEDS_INPUT=1 |
| 628 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 629 | *) NEEDS_INPUT=0;; |
| 630 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 631 | } |
| 632 | |
| 633 | # provide input to commands that need it |
| 634 | provide_input() { |
| 635 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 636 | return |
| 637 | fi |
| 638 | |
| 639 | while true; do |
| 640 | echo "HTTP/1.0 200 OK" |
| 641 | sleep 1 |
| 642 | done |
| 643 | } |
| 644 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 645 | # has_mem_err <log_file_name> |
| 646 | has_mem_err() { |
| 647 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 648 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 649 | then |
| 650 | return 1 # false: does not have errors |
| 651 | else |
| 652 | return 0 # true: has errors |
| 653 | fi |
| 654 | } |
| 655 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 656 | # Wait for process $2 named $3 to be listening on port $1. Print error to $4. |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 657 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 658 | wait_app_start() { |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 659 | newline=' |
| 660 | ' |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 661 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 662 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 663 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 664 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 665 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 666 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 667 | # Make a tight loop, server normally takes less than 1s to start. |
Paul Elliott | 58ed8a7 | 2021-10-19 17:56:39 +0100 | [diff] [blame] | 668 | while true; do |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 669 | SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -F p) |
| 670 | # When we use a proxy, it will be listening on the same port we |
| 671 | # are checking for as well as the server and lsof will list both. |
| 672 | # If multiple PIDs are returned, each one will be on a separate |
| 673 | # line, each prepended with 'p'. |
| 674 | case ${newline}${SERVER_PIDS}${newline} in |
| 675 | *${newline}p${2}${newline}*) break;; |
| 676 | esac |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 677 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 678 | echo "$3 START TIMEOUT" |
| 679 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 680 | break |
| 681 | fi |
| 682 | # Linux and *BSD support decimal arguments to sleep. On other |
| 683 | # OSes this may be a tight loop. |
| 684 | sleep 0.1 2>/dev/null || true |
| 685 | done |
| 686 | } |
| 687 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 688 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 689 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 690 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 691 | } |
| 692 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 693 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 694 | # Wait for server process $2 to be listening on port $1. |
| 695 | wait_server_start() { |
| 696 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 697 | } |
| 698 | |
| 699 | # Wait for proxy process $2 to be listening on port $1. |
| 700 | wait_proxy_start() { |
| 701 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 702 | } |
| 703 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 704 | # Given the client or server debug output, parse the unix timestamp that is |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 705 | # included in the first 4 bytes of the random bytes and check that it's within |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 706 | # acceptable bounds |
| 707 | check_server_hello_time() { |
| 708 | # Extract the time from the debug (lvl 3) output of the client |
Andres Amaya Garcia | 67d8da5 | 2017-09-15 15:49:24 +0100 | [diff] [blame] | 709 | SERVER_HELLO_TIME="$(sed -n 's/.*server hello, current time: //p' < "$1")" |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 710 | # Get the Unix timestamp for now |
| 711 | CUR_TIME=$(date +'%s') |
| 712 | THRESHOLD_IN_SECS=300 |
| 713 | |
| 714 | # Check if the ServerHello time was printed |
| 715 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 716 | return 1 |
| 717 | fi |
| 718 | |
| 719 | # Check the time in ServerHello is within acceptable bounds |
| 720 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 721 | # The time in ServerHello is at least 5 minutes before now |
| 722 | return 1 |
| 723 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 724 | # The time in ServerHello is at least 5 minutes later than now |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 725 | return 1 |
| 726 | else |
| 727 | return 0 |
| 728 | fi |
| 729 | } |
| 730 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 731 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 732 | handshake_memory_get() { |
| 733 | OUTPUT_VARIABLE="$1" |
| 734 | OUTPUT_FILE="$2" |
| 735 | |
| 736 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 737 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 738 | |
| 739 | # Check if memory usage was read |
| 740 | if [ -z "$MEM_USAGE" ]; then |
| 741 | echo "Error: Can not read the value of handshake memory usage" |
| 742 | return 1 |
| 743 | else |
| 744 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 745 | return 0 |
| 746 | fi |
| 747 | } |
| 748 | |
| 749 | # Get handshake memory usage from server or client output and check if this value |
| 750 | # is not higher than the maximum given by the first argument |
| 751 | handshake_memory_check() { |
| 752 | MAX_MEMORY="$1" |
| 753 | OUTPUT_FILE="$2" |
| 754 | |
| 755 | # Get memory usage |
| 756 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 757 | return 1 |
| 758 | fi |
| 759 | |
| 760 | # Check if memory usage is below max value |
| 761 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 762 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 763 | "but should be below $MAX_MEMORY bytes" |
| 764 | return 1 |
| 765 | else |
| 766 | return 0 |
| 767 | fi |
| 768 | } |
| 769 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 770 | # wait for client to terminate and set CLI_EXIT |
| 771 | # must be called right after starting the client |
| 772 | wait_client_done() { |
| 773 | CLI_PID=$! |
| 774 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 775 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 776 | CLI_DELAY_FACTOR=1 |
| 777 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 778 | ( sleep $CLI_DELAY; echo "===CLIENT_TIMEOUT===" >> $CLI_OUT; kill $CLI_PID ) & |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 779 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 780 | |
| 781 | wait $CLI_PID |
| 782 | CLI_EXIT=$? |
| 783 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 784 | kill $DOG_PID >/dev/null 2>&1 |
| 785 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 786 | |
| 787 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 788 | |
| 789 | sleep $SRV_DELAY_SECONDS |
| 790 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 791 | } |
| 792 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 793 | # check if the given command uses dtls and sets global variable DTLS |
| 794 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 795 | case "$1" in |
Paul Elliott | 1428f25 | 2021-10-12 16:02:55 +0100 | [diff] [blame] | 796 | *dtls=1*|*-dtls*|*-u*) DTLS=1;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 797 | *) DTLS=0;; |
| 798 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 799 | } |
| 800 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 801 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 802 | is_gnutls() { |
| 803 | case "$1" in |
| 804 | *gnutls-cli*) |
| 805 | CMD_IS_GNUTLS=1 |
| 806 | ;; |
| 807 | *gnutls-serv*) |
| 808 | CMD_IS_GNUTLS=1 |
| 809 | ;; |
| 810 | *) |
| 811 | CMD_IS_GNUTLS=0 |
| 812 | ;; |
| 813 | esac |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 814 | } |
| 815 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 816 | # Compare file content |
| 817 | # Usage: find_in_both pattern file1 file2 |
| 818 | # extract from file1 the first line matching the pattern |
| 819 | # check in file2 that the same line can be found |
| 820 | find_in_both() { |
| 821 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 822 | if [ -z "$srv_pattern" ]; then |
| 823 | return 1; |
| 824 | fi |
| 825 | |
| 826 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 827 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 828 | else |
| 829 | return 1; |
| 830 | fi |
| 831 | } |
| 832 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 833 | SKIP_HANDSHAKE_CHECK="NO" |
| 834 | skip_handshake_stage_check() { |
| 835 | SKIP_HANDSHAKE_CHECK="YES" |
| 836 | } |
| 837 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 838 | # Analyze the commands that will be used in a test. |
| 839 | # |
| 840 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass |
| 841 | # extra arguments or go through wrappers. |
| 842 | # Set $DTLS (0=TLS, 1=DTLS). |
| 843 | analyze_test_commands() { |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 844 | # update DTLS variable |
| 845 | detect_dtls "$SRV_CMD" |
| 846 | |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 847 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 848 | # as it provides timing info that's useful to debug failures |
Manuel Pégourié-Gonnard | 70fce98 | 2020-06-25 09:54:46 +0200 | [diff] [blame] | 849 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 850 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 851 | case " $SRV_CMD " in |
| 852 | *' server_addr=::1 '*) |
| 853 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 854 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 855 | fi |
| 856 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 857 | # update CMD_IS_GNUTLS variable |
| 858 | is_gnutls "$SRV_CMD" |
| 859 | |
| 860 | # if the server uses gnutls but doesn't set priority, explicitly |
| 861 | # set the default priority |
| 862 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 863 | case "$SRV_CMD" in |
| 864 | *--priority*) :;; |
| 865 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 866 | esac |
| 867 | fi |
| 868 | |
| 869 | # update CMD_IS_GNUTLS variable |
| 870 | is_gnutls "$CLI_CMD" |
| 871 | |
| 872 | # if the client uses gnutls but doesn't set priority, explicitly |
| 873 | # set the default priority |
| 874 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 875 | case "$CLI_CMD" in |
| 876 | *--priority*) :;; |
| 877 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 878 | esac |
| 879 | fi |
| 880 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 881 | # fix client port |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 882 | if [ -n "$PXY_CMD" ]; then |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 883 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 884 | else |
| 885 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 886 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 887 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 888 | # prepend valgrind to our commands if active |
| 889 | if [ "$MEMCHECK" -gt 0 ]; then |
| 890 | if is_polar "$SRV_CMD"; then |
| 891 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 892 | fi |
| 893 | if is_polar "$CLI_CMD"; then |
| 894 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 895 | fi |
| 896 | fi |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 897 | } |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 898 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 899 | # Check for failure conditions after a test case. |
| 900 | # |
| 901 | # Inputs from run_test: |
| 902 | # * positional parameters: test options (see run_test documentation) |
| 903 | # * $CLI_EXIT: client return code |
| 904 | # * $CLI_EXPECT: expected client return code |
| 905 | # * $SRV_RET: server return code |
| 906 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 907 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 908 | # |
| 909 | # Outputs: |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 910 | # * $outcome: one of PASS/RETRY*/FAIL |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 911 | check_test_failure() { |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 912 | outcome=FAIL |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 913 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 914 | if [ $TIMES_LEFT -gt 0 ] && |
| 915 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null |
| 916 | then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 917 | outcome="RETRY(client-timeout)" |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 918 | return |
| 919 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 920 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 921 | # check if the client and server went at least to the handshake stage |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 922 | # (useful to avoid tests with only negative assertions and non-zero |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 923 | # expected client exit to incorrectly succeed in case of catastrophic |
| 924 | # failure) |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 925 | if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ] |
| 926 | then |
| 927 | if is_polar "$SRV_CMD"; then |
| 928 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
| 929 | else |
| 930 | fail "server or client failed to reach handshake stage" |
| 931 | return |
| 932 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 933 | fi |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 934 | if is_polar "$CLI_CMD"; then |
| 935 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
| 936 | else |
| 937 | fail "server or client failed to reach handshake stage" |
| 938 | return |
| 939 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 940 | fi |
| 941 | fi |
| 942 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 943 | SKIP_HANDSHAKE_CHECK="NO" |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 944 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 945 | # exit with status 0 when interrupted by a signal, and we don't really |
| 946 | # care anyway), in case e.g. the server reports a memory leak. |
| 947 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 948 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 949 | return |
| 950 | fi |
| 951 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 952 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 953 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 954 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 955 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 956 | fail "bad client exit code (expected $CLI_EXPECT, got $CLI_EXIT)" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 957 | return |
| 958 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 959 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 960 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 961 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 962 | # lines with 'Serious error when reading debug info', are valgrind issues as well |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 963 | while [ $# -gt 0 ] |
| 964 | do |
| 965 | case $1 in |
| 966 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 967 | if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then :; else |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 968 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 969 | return |
| 970 | fi |
| 971 | ;; |
| 972 | |
| 973 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 974 | if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then :; else |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 975 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 976 | return |
| 977 | fi |
| 978 | ;; |
| 979 | |
| 980 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 981 | if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 982 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 983 | fail "pattern '$2' MUST NOT be present in the Server output" |
| 984 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 985 | return |
| 986 | fi |
| 987 | ;; |
| 988 | |
| 989 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 990 | if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 991 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 992 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 993 | fi |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 994 | return |
| 995 | fi |
| 996 | ;; |
| 997 | |
| 998 | # The filtering in the following two options (-u and -U) do the following |
| 999 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 1000 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1001 | # - keep one of each non-unique line |
| 1002 | # - count how many lines remain |
| 1003 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 1004 | # if there were no duplicates. |
| 1005 | "-U") |
| 1006 | if [ $(grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep -A1 "$2" | grep -v "$2" | sort | uniq -d | wc -l) -gt 1 ]; then |
| 1007 | fail "lines following pattern '$2' must be unique in Server output" |
| 1008 | return |
| 1009 | fi |
| 1010 | ;; |
| 1011 | |
| 1012 | "-u") |
| 1013 | if [ $(grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep -A1 "$2" | grep -v "$2" | sort | uniq -d | wc -l) -gt 1 ]; then |
| 1014 | fail "lines following pattern '$2' must be unique in Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1015 | return |
| 1016 | fi |
| 1017 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 1018 | "-F") |
| 1019 | if ! $2 "$SRV_OUT"; then |
| 1020 | fail "function call to '$2' failed on Server output" |
| 1021 | return |
| 1022 | fi |
| 1023 | ;; |
| 1024 | "-f") |
| 1025 | if ! $2 "$CLI_OUT"; then |
| 1026 | fail "function call to '$2' failed on Client output" |
| 1027 | return |
| 1028 | fi |
| 1029 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1030 | "-g") |
| 1031 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 1032 | fail "function call to '$2' failed on Server and Client output" |
| 1033 | return |
| 1034 | fi |
| 1035 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1036 | |
| 1037 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1038 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1039 | exit 1 |
| 1040 | esac |
| 1041 | shift 2 |
| 1042 | done |
| 1043 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1044 | # check valgrind's results |
| 1045 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1046 | if is_polar "$SRV_CMD" && has_mem_err $SRV_OUT; then |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1047 | fail "Server has memory errors" |
| 1048 | return |
| 1049 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1050 | if is_polar "$CLI_CMD" && has_mem_err $CLI_OUT; then |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1051 | fail "Client has memory errors" |
| 1052 | return |
| 1053 | fi |
| 1054 | fi |
| 1055 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1056 | # if we're here, everything is ok |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1057 | outcome=PASS |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1058 | } |
| 1059 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1060 | # Run the current test case: start the server and if applicable the proxy, run |
| 1061 | # the client, wait for all processes to finish or time out. |
| 1062 | # |
| 1063 | # Inputs: |
| 1064 | # * $NAME: test case name |
| 1065 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run |
| 1066 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs |
| 1067 | # |
| 1068 | # Outputs: |
| 1069 | # * $CLI_EXIT: client return code |
| 1070 | # * $SRV_RET: server return code |
| 1071 | do_run_test_once() { |
| 1072 | # run the commands |
| 1073 | if [ -n "$PXY_CMD" ]; then |
| 1074 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
| 1075 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 1076 | PXY_PID=$! |
| 1077 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
| 1078 | fi |
| 1079 | |
| 1080 | check_osrv_dtls |
| 1081 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
| 1082 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 1083 | SRV_PID=$! |
| 1084 | wait_server_start "$SRV_PORT" "$SRV_PID" |
| 1085 | |
| 1086 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
| 1087 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 1088 | wait_client_done |
| 1089 | |
| 1090 | sleep 0.05 |
| 1091 | |
| 1092 | # terminate the server (and the proxy) |
| 1093 | kill $SRV_PID |
| 1094 | wait $SRV_PID |
| 1095 | SRV_RET=$? |
| 1096 | |
| 1097 | if [ -n "$PXY_CMD" ]; then |
| 1098 | kill $PXY_PID >/dev/null 2>&1 |
| 1099 | wait $PXY_PID |
| 1100 | fi |
| 1101 | } |
| 1102 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1103 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
| 1104 | # Options: -s pattern pattern that must be present in server output |
| 1105 | # -c pattern pattern that must be present in client output |
| 1106 | # -u pattern lines after pattern must be unique in client output |
| 1107 | # -f call shell function on client output |
| 1108 | # -S pattern pattern that must be absent in server output |
| 1109 | # -C pattern pattern that must be absent in client output |
| 1110 | # -U pattern lines after pattern must be unique in server output |
| 1111 | # -F call shell function on server output |
| 1112 | # -g call shell function on server and client output |
| 1113 | run_test() { |
| 1114 | NAME="$1" |
| 1115 | shift 1 |
| 1116 | |
| 1117 | if is_excluded "$NAME"; then |
| 1118 | SKIP_NEXT="NO" |
| 1119 | # There was no request to run the test, so don't record its outcome. |
| 1120 | return |
| 1121 | fi |
| 1122 | |
| 1123 | print_name "$NAME" |
| 1124 | |
| 1125 | # Do we only run numbered tests? |
| 1126 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 1127 | case ",$RUN_TEST_NUMBER," in |
| 1128 | *",$TESTS,"*) :;; |
| 1129 | *) SKIP_NEXT="YES";; |
| 1130 | esac |
| 1131 | fi |
| 1132 | |
| 1133 | # does this test use a proxy? |
| 1134 | if [ "X$1" = "X-p" ]; then |
| 1135 | PXY_CMD="$2" |
| 1136 | shift 2 |
| 1137 | else |
| 1138 | PXY_CMD="" |
| 1139 | fi |
| 1140 | |
| 1141 | # get commands and client output |
| 1142 | SRV_CMD="$1" |
| 1143 | CLI_CMD="$2" |
| 1144 | CLI_EXPECT="$3" |
| 1145 | shift 3 |
| 1146 | |
| 1147 | # Check if test uses files |
| 1148 | case "$SRV_CMD $CLI_CMD" in |
| 1149 | *data_files/*) |
| 1150 | requires_config_enabled MBEDTLS_FS_IO;; |
| 1151 | esac |
| 1152 | |
| 1153 | # If the client or serve requires a ciphersuite, check that it's enabled. |
| 1154 | maybe_requires_ciphersuite_enabled "$SRV_CMD" "$@" |
| 1155 | maybe_requires_ciphersuite_enabled "$CLI_CMD" "$@" |
| 1156 | |
| 1157 | # should we skip? |
| 1158 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 1159 | SKIP_NEXT="NO" |
| 1160 | record_outcome "SKIP" |
| 1161 | SKIPS=$(( $SKIPS + 1 )) |
| 1162 | return |
| 1163 | fi |
| 1164 | |
| 1165 | analyze_test_commands "$@" |
| 1166 | |
| 1167 | TIMES_LEFT=2 |
| 1168 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1169 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1170 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1171 | do_run_test_once |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1172 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1173 | check_test_failure "$@" |
| 1174 | case $outcome in |
| 1175 | PASS) break;; |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1176 | RETRY*) printf "$outcome ";; |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1177 | FAIL) return;; |
| 1178 | esac |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1179 | done |
| 1180 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1181 | # If we get this far, the test case passed. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1182 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1183 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1184 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1185 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1186 | if [ -n "$PXY_CMD" ]; then |
| 1187 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1188 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1189 | fi |
| 1190 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1191 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1192 | } |
| 1193 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1194 | run_test_psa() { |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1195 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1196 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1197 | run_test "PSA-supported ciphersuite: $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1198 | "$P_SRV debug_level=3 force_version=tls12" \ |
| 1199 | "$P_CLI debug_level=3 force_version=tls12 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1200 | 0 \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1201 | -c "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1202 | -c "calc PSA finished" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1203 | -s "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1204 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1205 | -C "Failed to setup PSA-based cipher context"\ |
| 1206 | -S "Failed to setup PSA-based cipher context"\ |
| 1207 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1208 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1209 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1210 | -S "error" \ |
| 1211 | -C "error" |
| 1212 | } |
| 1213 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1214 | run_test_psa_force_curve() { |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1215 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1216 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1217 | run_test "PSA - ECDH with $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1218 | "$P_SRV debug_level=4 force_version=tls12 curves=$1" \ |
| 1219 | "$P_CLI debug_level=4 force_version=tls12 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 curves=$1" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1220 | 0 \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1221 | -c "PSA calc verify" \ |
| 1222 | -c "calc PSA finished" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1223 | -s "PSA calc verify" \ |
| 1224 | -s "calc PSA finished" \ |
| 1225 | -C "Failed to setup PSA-based cipher context"\ |
| 1226 | -S "Failed to setup PSA-based cipher context"\ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1227 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1228 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1229 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1230 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1231 | -C "error" |
| 1232 | } |
| 1233 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1234 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1235 | # a maximum fragment length. |
| 1236 | # first argument ($1) is MFL for SSL client |
| 1237 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1238 | run_test_memory_after_hanshake_with_mfl() |
| 1239 | { |
| 1240 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1241 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1242 | |
| 1243 | # Leave some margin for robustness |
| 1244 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1245 | |
| 1246 | run_test "Handshake memory usage (MFL $1)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1247 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
| 1248 | "$P_CLI debug_level=3 force_version=tls12 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1249 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1250 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1251 | 0 \ |
| 1252 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1253 | } |
| 1254 | |
| 1255 | |
| 1256 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1257 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1258 | run_tests_memory_after_hanshake() |
| 1259 | { |
| 1260 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1261 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1262 | |
| 1263 | # first test with default MFU is to get reference memory usage |
| 1264 | MEMORY_USAGE_MFL_16K=0 |
| 1265 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1266 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
| 1267 | "$P_CLI debug_level=3 force_version=tls12 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1268 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1269 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1270 | 0 \ |
| 1271 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1272 | |
| 1273 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1274 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1275 | |
| 1276 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1277 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1278 | |
| 1279 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1280 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1281 | |
| 1282 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1283 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1284 | } |
| 1285 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1286 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1287 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1288 | rm -f context_srv.txt |
| 1289 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1290 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1291 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1292 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1293 | 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] | 1294 | exit 1 |
| 1295 | } |
| 1296 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1297 | # |
| 1298 | # MAIN |
| 1299 | # |
| 1300 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1301 | get_options "$@" |
| 1302 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1303 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1304 | # patterns rather than regular expressions, use a case statement instead |
| 1305 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1306 | # detects simple cases: plain substring, everything, nothing. |
| 1307 | # |
| 1308 | # As an exception, the character '.' is treated as an ordinary character |
| 1309 | # if it is the only special character in the string. This is because it's |
| 1310 | # rare to need "any one character", but needing a literal '.' is common |
| 1311 | # (e.g. '-f "DTLS 1.2"'). |
| 1312 | need_grep= |
| 1313 | case "$FILTER" in |
| 1314 | '^$') simple_filter=;; |
| 1315 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1316 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1317 | need_grep=1;; |
| 1318 | *) # No regexp or shell-pattern special character |
| 1319 | simple_filter="*$FILTER*";; |
| 1320 | esac |
| 1321 | case "$EXCLUDE" in |
| 1322 | '^$') simple_exclude=;; |
| 1323 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1324 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1325 | need_grep=1;; |
| 1326 | *) # No regexp or shell-pattern special character |
| 1327 | simple_exclude="*$EXCLUDE*";; |
| 1328 | esac |
| 1329 | if [ -n "$need_grep" ]; then |
| 1330 | is_excluded () { |
| 1331 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1332 | } |
| 1333 | else |
| 1334 | is_excluded () { |
| 1335 | case "$1" in |
| 1336 | $simple_exclude) true;; |
| 1337 | $simple_filter) false;; |
| 1338 | *) true;; |
| 1339 | esac |
| 1340 | } |
| 1341 | fi |
| 1342 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1343 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1344 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1345 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1346 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1347 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1348 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1349 | exit 1 |
| 1350 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1351 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1352 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1353 | exit 1 |
| 1354 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1355 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1356 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1357 | exit 1 |
| 1358 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1359 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1360 | if which valgrind >/dev/null 2>&1; then :; else |
| 1361 | echo "Memcheck not possible. Valgrind not found" |
| 1362 | exit 1 |
| 1363 | fi |
| 1364 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1365 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 1366 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1367 | exit 1 |
| 1368 | fi |
| 1369 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1370 | # used by watchdog |
| 1371 | MAIN_PID="$$" |
| 1372 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1373 | # We use somewhat arbitrary delays for tests: |
| 1374 | # - how long do we wait for the server to start (when lsof not available)? |
| 1375 | # - how long do we allow for the client to finish? |
| 1376 | # (not to check performance, just to avoid waiting indefinitely) |
| 1377 | # Things are slower with valgrind, so give extra time here. |
| 1378 | # |
| 1379 | # Note: without lsof, there is a trade-off between the running time of this |
| 1380 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1381 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1382 | # 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] | 1383 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1384 | START_DELAY=6 |
| 1385 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1386 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1387 | START_DELAY=2 |
| 1388 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1389 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1390 | |
| 1391 | # some particular tests need more time: |
| 1392 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1393 | # - for the server, we sleep for a number of seconds after the client exits |
| 1394 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1395 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1396 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1397 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1398 | # 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] | 1399 | # +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] | 1400 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 1401 | # 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] | 1402 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1403 | 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] | 1404 | 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] | 1405 | O_SRV="$O_SRV -accept $SRV_PORT" |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1406 | 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] | 1407 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1408 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1409 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1410 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1411 | 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] | 1412 | 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] | 1413 | fi |
| 1414 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 1415 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 1416 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1417 | 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] | 1418 | 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] | 1419 | fi |
| 1420 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1421 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1422 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1423 | 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] | 1424 | fi |
| 1425 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1426 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1427 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1428 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1429 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1430 | # Allow SHA-1, because many of our test certificates use it |
| 1431 | P_SRV="$P_SRV allow_sha1=1" |
| 1432 | P_CLI="$P_CLI allow_sha1=1" |
| 1433 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1434 | # Also pick a unique name for intermediate files |
| 1435 | SRV_OUT="srv_out.$$" |
| 1436 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1437 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1438 | SESSION="session.$$" |
| 1439 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1440 | SKIP_NEXT="NO" |
| 1441 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1442 | trap cleanup INT TERM HUP |
| 1443 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1444 | # Basic test |
| 1445 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1446 | # Checks that: |
| 1447 | # - 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] | 1448 | # - the expected parameters are selected |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1449 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1450 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1451 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1452 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1453 | "$P_CLI" \ |
| 1454 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1455 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1456 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1457 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 1458 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1459 | -S "error" \ |
| 1460 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1461 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1462 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1463 | run_test "Default, DTLS" \ |
| 1464 | "$P_SRV dtls=1" \ |
| 1465 | "$P_CLI dtls=1" \ |
| 1466 | 0 \ |
| 1467 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1468 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1469 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1470 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1471 | run_test "TLS client auth: required" \ |
| 1472 | "$P_SRV auth_mode=required" \ |
| 1473 | "$P_CLI" \ |
| 1474 | 0 \ |
| 1475 | -s "Verifying peer X.509 certificate... ok" |
| 1476 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1477 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 1478 | run_test "key size: TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1479 | "$P_SRV" \ |
| 1480 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1481 | 0 \ |
| 1482 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1483 | -c "Key size is 256" |
| 1484 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1485 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 1486 | run_test "key size: TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1487 | "$P_SRV" \ |
| 1488 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1489 | 0 \ |
| 1490 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1491 | -c "Key size is 128" |
| 1492 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1493 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1494 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1495 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1496 | requires_config_enabled MBEDTLS_SHA256_C |
| 1497 | run_test "TLS: password protected client key" \ |
| 1498 | "$P_SRV auth_mode=required" \ |
| 1499 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1500 | 0 |
| 1501 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1502 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1503 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1504 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1505 | requires_config_enabled MBEDTLS_SHA256_C |
| 1506 | run_test "TLS: password protected server key" \ |
| 1507 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1508 | "$P_CLI" \ |
| 1509 | 0 |
| 1510 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1511 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1512 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1513 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1514 | requires_config_enabled MBEDTLS_RSA_C |
| 1515 | requires_config_enabled MBEDTLS_SHA256_C |
| 1516 | run_test "TLS: password protected server key, two certificates" \ |
| 1517 | "$P_SRV \ |
| 1518 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1519 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1520 | "$P_CLI" \ |
| 1521 | 0 |
| 1522 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1523 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1524 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1525 | run_test "CA callback on client" \ |
| 1526 | "$P_SRV debug_level=3" \ |
| 1527 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1528 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1529 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1530 | -S "error" \ |
| 1531 | -C "error" |
| 1532 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1533 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1534 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1535 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1536 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1537 | requires_config_enabled MBEDTLS_SHA256_C |
| 1538 | run_test "CA callback on server" \ |
| 1539 | "$P_SRV auth_mode=required" \ |
| 1540 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1541 | key_file=data_files/server5.key" \ |
| 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 "Verifying peer X.509 certificate... ok" \ |
| 1545 | -S "error" \ |
| 1546 | -C "error" |
| 1547 | |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1548 | # Test using an opaque private key for client authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1549 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1550 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1551 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1552 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1553 | requires_config_enabled MBEDTLS_SHA256_C |
| 1554 | run_test "Opaque key for client authentication" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1555 | "$P_SRV auth_mode=required crt_file=data_files/server5.crt \ |
| 1556 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1557 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1558 | key_file=data_files/server5.key" \ |
| 1559 | 0 \ |
| 1560 | -c "key type: Opaque" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1561 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1562 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1563 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1564 | -S "error" \ |
| 1565 | -C "error" |
| 1566 | |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1567 | # Test using an opaque private key for server authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1568 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1569 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1570 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1571 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1572 | requires_config_enabled MBEDTLS_SHA256_C |
| 1573 | run_test "Opaque key for server authentication" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1574 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
| 1575 | key_file=data_files/server5.key" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1576 | "$P_CLI crt_file=data_files/server5.crt \ |
| 1577 | key_file=data_files/server5.key" \ |
| 1578 | 0 \ |
| 1579 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1580 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 1581 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1582 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1583 | -S "error" \ |
| 1584 | -C "error" |
| 1585 | |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1586 | # Test using an opaque private key for client/server authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1587 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1588 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1589 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1590 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1591 | requires_config_enabled MBEDTLS_SHA256_C |
| 1592 | run_test "Opaque key for client/server authentication" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1593 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
| 1594 | key_file=data_files/server5.key" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1595 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1596 | key_file=data_files/server5.key" \ |
| 1597 | 0 \ |
| 1598 | -c "key type: Opaque" \ |
| 1599 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1600 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 1601 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1602 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1603 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1604 | -S "error" \ |
| 1605 | -C "error" |
| 1606 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1607 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 1608 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 1609 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 1610 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 1611 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 1612 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 1613 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 1614 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 1615 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 1616 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 1617 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 1618 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1619 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1620 | run_test_psa_force_curve "secp521r1" |
| 1621 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 1622 | run_test_psa_force_curve "brainpoolP512r1" |
| 1623 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 1624 | run_test_psa_force_curve "secp384r1" |
| 1625 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1626 | run_test_psa_force_curve "brainpoolP384r1" |
| 1627 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1628 | run_test_psa_force_curve "secp256r1" |
| 1629 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1630 | run_test_psa_force_curve "secp256k1" |
| 1631 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1632 | run_test_psa_force_curve "brainpoolP256r1" |
| 1633 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1634 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1635 | ## SECP224K1 is buggy via the PSA API |
| 1636 | ## (https://github.com/ARMmbed/mbedtls/issues/3541), |
| 1637 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 1638 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 1639 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 1640 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1641 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1642 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1643 | run_test_psa_force_curve "secp192r1" |
| 1644 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1645 | run_test_psa_force_curve "secp192k1" |
| 1646 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1647 | # Test current time in ServerHello |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1648 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1649 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 1650 | run_test "ServerHello contains gmt_unix_time" \ |
| 1651 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1652 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1653 | 0 \ |
| 1654 | -f "check_server_hello_time" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1655 | -F "check_server_hello_time" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1656 | |
| 1657 | # Test for uniqueness of IVs in AEAD ciphersuites |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1658 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1659 | run_test "Unique IV in GCM" \ |
| 1660 | "$P_SRV exchanges=20 debug_level=4" \ |
| 1661 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 1662 | 0 \ |
| 1663 | -u "IV used" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1664 | -U "IV used" |
| 1665 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1666 | # Tests for certificate verification callback |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1667 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1668 | run_test "Configuration-specific CRT verification callback" \ |
| 1669 | "$P_SRV debug_level=3" \ |
| 1670 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1671 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1672 | -S "error" \ |
| 1673 | -c "Verify requested for " \ |
| 1674 | -c "Use configuration-specific verification callback" \ |
| 1675 | -C "Use context-specific verification callback" \ |
| 1676 | -C "error" |
| 1677 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1678 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1679 | run_test "Context-specific CRT verification callback" \ |
| 1680 | "$P_SRV debug_level=3" \ |
| 1681 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 1682 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1683 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1684 | -c "Verify requested for " \ |
| 1685 | -c "Use context-specific verification callback" \ |
| 1686 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1687 | -C "error" |
| 1688 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1689 | # Tests for SHA-1 support |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1690 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1691 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1692 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1693 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1694 | 1 \ |
| 1695 | -c "The certificate is signed with an unacceptable hash" |
| 1696 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1697 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1698 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1699 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1700 | "$P_CLI allow_sha1=1" \ |
| 1701 | 0 |
| 1702 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1703 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1704 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1705 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1706 | "$P_CLI allow_sha1=0" \ |
| 1707 | 0 |
| 1708 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1709 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1710 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1711 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1712 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1713 | 1 \ |
| 1714 | -s "The certificate is signed with an unacceptable hash" |
| 1715 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1716 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1717 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1718 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1719 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1720 | 0 |
| 1721 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1722 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1723 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1724 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1725 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1726 | 0 |
| 1727 | |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1728 | # Dummy TLS 1.3 test |
| 1729 | # Currently only checking that passing TLS 1.3 key exchange modes to |
| 1730 | # ssl_client2/ssl_server2 example programs works. |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 1731 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1732 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1733 | run_test "TLS 1.3, key exchange mode parameter passing: PSK only" \ |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 1734 | "$P_SRV tls13_kex_modes=psk debug_level=4" \ |
| 1735 | "$P_CLI tls13_kex_modes=psk debug_level=4" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1736 | 0 |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 1737 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1738 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1739 | run_test "TLS 1.3, key exchange mode parameter passing: PSK-ephemeral only" \ |
| 1740 | "$P_SRV tls13_kex_modes=psk_ephemeral" \ |
| 1741 | "$P_CLI tls13_kex_modes=psk_ephemeral" \ |
| 1742 | 0 |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 1743 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1744 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1745 | 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] | 1746 | "$P_SRV tls13_kex_modes=ephemeral" \ |
| 1747 | "$P_CLI tls13_kex_modes=ephemeral" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1748 | 0 |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 1749 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1750 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1751 | run_test "TLS 1.3, key exchange mode parameter passing: All ephemeral" \ |
| 1752 | "$P_SRV tls13_kex_modes=ephemeral_all" \ |
| 1753 | "$P_CLI tls13_kex_modes=ephemeral_all" \ |
| 1754 | 0 |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 1755 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1756 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1757 | run_test "TLS 1.3, key exchange mode parameter passing: All PSK" \ |
| 1758 | "$P_SRV tls13_kex_modes=psk_all" \ |
| 1759 | "$P_CLI tls13_kex_modes=psk_all" \ |
| 1760 | 0 |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 1761 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1762 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1763 | run_test "TLS 1.3, key exchange mode parameter passing: All" \ |
| 1764 | "$P_SRV tls13_kex_modes=all" \ |
| 1765 | "$P_CLI tls13_kex_modes=all" \ |
| 1766 | 0 |
| 1767 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1768 | # Tests for datagram packing |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1769 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1770 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1771 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1772 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1773 | 0 \ |
| 1774 | -c "next record in same datagram" \ |
| 1775 | -s "next record in same datagram" |
| 1776 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1777 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1778 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1779 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1780 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1781 | 0 \ |
| 1782 | -s "next record in same datagram" \ |
| 1783 | -C "next record in same datagram" |
| 1784 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1785 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1786 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1787 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1788 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1789 | 0 \ |
| 1790 | -S "next record in same datagram" \ |
| 1791 | -c "next record in same datagram" |
| 1792 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1793 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1794 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1795 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1796 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1797 | 0 \ |
| 1798 | -S "next record in same datagram" \ |
| 1799 | -C "next record in same datagram" |
| 1800 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1801 | # Tests for Context serialization |
| 1802 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1803 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1804 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1805 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1806 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1807 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1808 | 0 \ |
| 1809 | -c "Deserializing connection..." \ |
| 1810 | -S "Deserializing connection..." |
| 1811 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1812 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1813 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1814 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 1815 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1816 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1817 | 0 \ |
| 1818 | -c "Deserializing connection..." \ |
| 1819 | -S "Deserializing connection..." |
| 1820 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1821 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1822 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1823 | run_test "Context serialization, client serializes, GCM" \ |
| 1824 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1825 | "$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] | 1826 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1827 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1828 | -S "Deserializing connection..." |
| 1829 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1830 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1831 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1832 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1833 | run_test "Context serialization, client serializes, with CID" \ |
| 1834 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1835 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1836 | 0 \ |
| 1837 | -c "Deserializing connection..." \ |
| 1838 | -S "Deserializing connection..." |
| 1839 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1840 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1841 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1842 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1843 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1844 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1845 | 0 \ |
| 1846 | -C "Deserializing connection..." \ |
| 1847 | -s "Deserializing connection..." |
| 1848 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1849 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1850 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1851 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 1852 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1853 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1854 | 0 \ |
| 1855 | -C "Deserializing connection..." \ |
| 1856 | -s "Deserializing connection..." |
| 1857 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1858 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1859 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1860 | run_test "Context serialization, server serializes, GCM" \ |
| 1861 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1862 | "$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] | 1863 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1864 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1865 | -s "Deserializing connection..." |
| 1866 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1867 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1868 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1869 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1870 | run_test "Context serialization, server serializes, with CID" \ |
| 1871 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1872 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1873 | 0 \ |
| 1874 | -C "Deserializing connection..." \ |
| 1875 | -s "Deserializing connection..." |
| 1876 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1877 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1878 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1879 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1880 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1881 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1882 | 0 \ |
| 1883 | -c "Deserializing connection..." \ |
| 1884 | -s "Deserializing connection..." |
| 1885 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1886 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1887 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1888 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 1889 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1890 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1891 | 0 \ |
| 1892 | -c "Deserializing connection..." \ |
| 1893 | -s "Deserializing connection..." |
| 1894 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1895 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1896 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1897 | run_test "Context serialization, both serialize, GCM" \ |
| 1898 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1899 | "$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] | 1900 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1901 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1902 | -s "Deserializing connection..." |
| 1903 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1904 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1905 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1906 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1907 | run_test "Context serialization, both serialize, with CID" \ |
| 1908 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1909 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1910 | 0 \ |
| 1911 | -c "Deserializing connection..." \ |
| 1912 | -s "Deserializing connection..." |
| 1913 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1914 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1915 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1916 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1917 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1918 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1919 | 0 \ |
| 1920 | -c "Deserializing connection..." \ |
| 1921 | -S "Deserializing connection..." |
| 1922 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1923 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1924 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1925 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 1926 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1927 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1928 | 0 \ |
| 1929 | -c "Deserializing connection..." \ |
| 1930 | -S "Deserializing connection..." |
| 1931 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1932 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1933 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1934 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 1935 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1936 | "$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] | 1937 | 0 \ |
| 1938 | -c "Deserializing connection..." \ |
| 1939 | -S "Deserializing connection..." |
| 1940 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1941 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1942 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1943 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1944 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 1945 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1946 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1947 | 0 \ |
| 1948 | -c "Deserializing connection..." \ |
| 1949 | -S "Deserializing connection..." |
| 1950 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1951 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1952 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1953 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1954 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1955 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1956 | 0 \ |
| 1957 | -C "Deserializing connection..." \ |
| 1958 | -s "Deserializing connection..." |
| 1959 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1960 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1961 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1962 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 1963 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1964 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1965 | 0 \ |
| 1966 | -C "Deserializing connection..." \ |
| 1967 | -s "Deserializing connection..." |
| 1968 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1969 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1970 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1971 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 1972 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1973 | "$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] | 1974 | 0 \ |
| 1975 | -C "Deserializing connection..." \ |
| 1976 | -s "Deserializing connection..." |
| 1977 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1978 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1979 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1980 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1981 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 1982 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1983 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1984 | 0 \ |
| 1985 | -C "Deserializing connection..." \ |
| 1986 | -s "Deserializing connection..." |
| 1987 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1988 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1989 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1990 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1991 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1992 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1993 | 0 \ |
| 1994 | -c "Deserializing connection..." \ |
| 1995 | -s "Deserializing connection..." |
| 1996 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1997 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1998 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1999 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 2000 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2001 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2002 | 0 \ |
| 2003 | -c "Deserializing connection..." \ |
| 2004 | -s "Deserializing connection..." |
| 2005 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2006 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2007 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2008 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 2009 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2010 | "$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] | 2011 | 0 \ |
| 2012 | -c "Deserializing connection..." \ |
| 2013 | -s "Deserializing connection..." |
| 2014 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2015 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2016 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2017 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2018 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 2019 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2020 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2021 | 0 \ |
| 2022 | -c "Deserializing connection..." \ |
| 2023 | -s "Deserializing connection..." |
| 2024 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2025 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 2026 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2027 | run_test "Saving the serialized context to a file" \ |
| 2028 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 2029 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 2030 | 0 \ |
| 2031 | -s "Save serialized context to a file... ok" \ |
| 2032 | -c "Save serialized context to a file... ok" |
| 2033 | rm -f context_srv.txt |
| 2034 | rm -f context_cli.txt |
| 2035 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2036 | # Tests for DTLS Connection ID extension |
| 2037 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2038 | # So far, the CID API isn't implemented, so we can't |
| 2039 | # grep for output witnessing its use. This needs to be |
| 2040 | # changed once the CID extension is implemented. |
| 2041 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2042 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2043 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2044 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2045 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 2046 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2047 | 0 \ |
| 2048 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2049 | -s "found CID extension" \ |
| 2050 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2051 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2052 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2053 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2054 | -C "found CID extension" \ |
| 2055 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2056 | -C "Copy CIDs into SSL transform" \ |
| 2057 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2058 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2059 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2060 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2061 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2062 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2063 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 2064 | 0 \ |
| 2065 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2066 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2067 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2068 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2069 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2070 | -C "found CID extension" \ |
| 2071 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2072 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 2073 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2074 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2075 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2076 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2077 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2078 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2079 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 2080 | 0 \ |
| 2081 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2082 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2083 | -c "client hello, adding CID extension" \ |
| 2084 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2085 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2086 | -s "server hello, adding CID extension" \ |
| 2087 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2088 | -c "Use of CID extension negotiated" \ |
| 2089 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2090 | -c "Copy CIDs into SSL transform" \ |
| 2091 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2092 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2093 | -s "Use of Connection ID has been negotiated" \ |
| 2094 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2095 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2096 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2097 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2098 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2099 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2100 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 2101 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 2102 | 0 \ |
| 2103 | -c "Enable use of CID extension." \ |
| 2104 | -s "Enable use of CID extension." \ |
| 2105 | -c "client hello, adding CID extension" \ |
| 2106 | -s "found CID extension" \ |
| 2107 | -s "Use of CID extension negotiated" \ |
| 2108 | -s "server hello, adding CID extension" \ |
| 2109 | -c "found CID extension" \ |
| 2110 | -c "Use of CID extension negotiated" \ |
| 2111 | -s "Copy CIDs into SSL transform" \ |
| 2112 | -c "Copy CIDs into SSL transform" \ |
| 2113 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2114 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2115 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2116 | -c "Use of Connection ID has been negotiated" \ |
| 2117 | -c "ignoring unexpected CID" \ |
| 2118 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2119 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2120 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2121 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2122 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 2123 | -p "$P_PXY mtu=800" \ |
| 2124 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2125 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2126 | 0 \ |
| 2127 | -c "Enable use of CID extension." \ |
| 2128 | -s "Enable use of CID extension." \ |
| 2129 | -c "client hello, adding CID extension" \ |
| 2130 | -s "found CID extension" \ |
| 2131 | -s "Use of CID extension negotiated" \ |
| 2132 | -s "server hello, adding CID extension" \ |
| 2133 | -c "found CID extension" \ |
| 2134 | -c "Use of CID extension negotiated" \ |
| 2135 | -s "Copy CIDs into SSL transform" \ |
| 2136 | -c "Copy CIDs into SSL transform" \ |
| 2137 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2138 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2139 | -s "Use of Connection ID has been negotiated" \ |
| 2140 | -c "Use of Connection ID has been negotiated" |
| 2141 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2142 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2143 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2144 | 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] | 2145 | -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] | 2146 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2147 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2148 | 0 \ |
| 2149 | -c "Enable use of CID extension." \ |
| 2150 | -s "Enable use of CID extension." \ |
| 2151 | -c "client hello, adding CID extension" \ |
| 2152 | -s "found CID extension" \ |
| 2153 | -s "Use of CID extension negotiated" \ |
| 2154 | -s "server hello, adding CID extension" \ |
| 2155 | -c "found CID extension" \ |
| 2156 | -c "Use of CID extension negotiated" \ |
| 2157 | -s "Copy CIDs into SSL transform" \ |
| 2158 | -c "Copy CIDs into SSL transform" \ |
| 2159 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2160 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2161 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2162 | -c "Use of Connection ID has been negotiated" \ |
| 2163 | -c "ignoring unexpected CID" \ |
| 2164 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2165 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2166 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2167 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2168 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2169 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2170 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2171 | 0 \ |
| 2172 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2173 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2174 | -c "client hello, adding CID extension" \ |
| 2175 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2176 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2177 | -s "server hello, adding CID extension" \ |
| 2178 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2179 | -c "Use of CID extension negotiated" \ |
| 2180 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2181 | -c "Copy CIDs into SSL transform" \ |
| 2182 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2183 | -s "Peer CID (length 0 Bytes):" \ |
| 2184 | -s "Use of Connection ID has been negotiated" \ |
| 2185 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2186 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2187 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2188 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2189 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2190 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2191 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2192 | 0 \ |
| 2193 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2194 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2195 | -c "client hello, adding CID extension" \ |
| 2196 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2197 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2198 | -s "server hello, adding CID extension" \ |
| 2199 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2200 | -c "Use of CID extension negotiated" \ |
| 2201 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2202 | -c "Copy CIDs into SSL transform" \ |
| 2203 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2204 | -c "Peer CID (length 0 Bytes):" \ |
| 2205 | -s "Use of Connection ID has been negotiated" \ |
| 2206 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2207 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2208 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2209 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2210 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2211 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2212 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2213 | 0 \ |
| 2214 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2215 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2216 | -c "client hello, adding CID extension" \ |
| 2217 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2218 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2219 | -s "server hello, adding CID extension" \ |
| 2220 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2221 | -c "Use of CID extension negotiated" \ |
| 2222 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2223 | -c "Copy CIDs into SSL transform" \ |
| 2224 | -S "Use of Connection ID has been negotiated" \ |
| 2225 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2226 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2227 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2228 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2229 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty, AES-128-CCM-8" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2230 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2231 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2232 | 0 \ |
| 2233 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2234 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2235 | -c "client hello, adding CID extension" \ |
| 2236 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2237 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2238 | -s "server hello, adding CID extension" \ |
| 2239 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2240 | -c "Use of CID extension negotiated" \ |
| 2241 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2242 | -c "Copy CIDs into SSL transform" \ |
| 2243 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2244 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2245 | -s "Use of Connection ID has been negotiated" \ |
| 2246 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2247 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2248 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2249 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2250 | 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] | 2251 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2252 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2253 | 0 \ |
| 2254 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2255 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2256 | -c "client hello, adding CID extension" \ |
| 2257 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2258 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2259 | -s "server hello, adding CID extension" \ |
| 2260 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2261 | -c "Use of CID extension negotiated" \ |
| 2262 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2263 | -c "Copy CIDs into SSL transform" \ |
| 2264 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2265 | -s "Peer CID (length 0 Bytes):" \ |
| 2266 | -s "Use of Connection ID has been negotiated" \ |
| 2267 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2268 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2269 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2270 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2271 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty, AES-128-CCM-8" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2272 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2273 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2274 | 0 \ |
| 2275 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2276 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2277 | -c "client hello, adding CID extension" \ |
| 2278 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2279 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2280 | -s "server hello, adding CID extension" \ |
| 2281 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2282 | -c "Use of CID extension negotiated" \ |
| 2283 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2284 | -c "Copy CIDs into SSL transform" \ |
| 2285 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2286 | -c "Peer CID (length 0 Bytes):" \ |
| 2287 | -s "Use of Connection ID has been negotiated" \ |
| 2288 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2289 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2290 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2291 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2292 | 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] | 2293 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2294 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2295 | 0 \ |
| 2296 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2297 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2298 | -c "client hello, adding CID extension" \ |
| 2299 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2300 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2301 | -s "server hello, adding CID extension" \ |
| 2302 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2303 | -c "Use of CID extension negotiated" \ |
| 2304 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2305 | -c "Copy CIDs into SSL transform" \ |
| 2306 | -S "Use of Connection ID has been negotiated" \ |
| 2307 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2308 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2309 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2310 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2311 | 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] | 2312 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2313 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2314 | 0 \ |
| 2315 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2316 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2317 | -c "client hello, adding CID extension" \ |
| 2318 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2319 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2320 | -s "server hello, adding CID extension" \ |
| 2321 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2322 | -c "Use of CID extension negotiated" \ |
| 2323 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2324 | -c "Copy CIDs into SSL transform" \ |
| 2325 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2326 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2327 | -s "Use of Connection ID has been negotiated" \ |
| 2328 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2329 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2330 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2331 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2332 | 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] | 2333 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2334 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2335 | 0 \ |
| 2336 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2337 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2338 | -c "client hello, adding CID extension" \ |
| 2339 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2340 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2341 | -s "server hello, adding CID extension" \ |
| 2342 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2343 | -c "Use of CID extension negotiated" \ |
| 2344 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2345 | -c "Copy CIDs into SSL transform" \ |
| 2346 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2347 | -s "Peer CID (length 0 Bytes):" \ |
| 2348 | -s "Use of Connection ID has been negotiated" \ |
| 2349 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2350 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2351 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2352 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2353 | 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] | 2354 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2355 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2356 | 0 \ |
| 2357 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2358 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2359 | -c "client hello, adding CID extension" \ |
| 2360 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2361 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2362 | -s "server hello, adding CID extension" \ |
| 2363 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2364 | -c "Use of CID extension negotiated" \ |
| 2365 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2366 | -c "Copy CIDs into SSL transform" \ |
| 2367 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2368 | -c "Peer CID (length 0 Bytes):" \ |
| 2369 | -s "Use of Connection ID has been negotiated" \ |
| 2370 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2371 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2372 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2373 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2374 | 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] | 2375 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2376 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2377 | 0 \ |
| 2378 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2379 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2380 | -c "client hello, adding CID extension" \ |
| 2381 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2382 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2383 | -s "server hello, adding CID extension" \ |
| 2384 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2385 | -c "Use of CID extension negotiated" \ |
| 2386 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2387 | -c "Copy CIDs into SSL transform" \ |
| 2388 | -S "Use of Connection ID has been negotiated" \ |
| 2389 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2390 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2391 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2392 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 2393 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2394 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2395 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2396 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2397 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2398 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2399 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2400 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2401 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2402 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2403 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2404 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2405 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2406 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2407 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2408 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2409 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2410 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2411 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2412 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2413 | 0 \ |
| 2414 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2415 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2416 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2417 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2418 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2419 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2420 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2421 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2422 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2423 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2424 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2425 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2426 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 2427 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2428 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2429 | 0 \ |
| 2430 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2431 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2432 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2433 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2434 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2435 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2436 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2437 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2438 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2439 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2440 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2441 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2442 | 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] | 2443 | -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] | 2444 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2445 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2446 | 0 \ |
| 2447 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2448 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2449 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2450 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2451 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2452 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2453 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2454 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2455 | -c "ignoring unexpected CID" \ |
| 2456 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2457 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2458 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2459 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2460 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2461 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2462 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2463 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2464 | 0 \ |
| 2465 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2466 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2467 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2468 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2469 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2470 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2471 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2472 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2473 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2474 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2475 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2476 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2477 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 2478 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2479 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2480 | 0 \ |
| 2481 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2482 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2483 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2484 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2485 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2486 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2487 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2488 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2489 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2490 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2491 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2492 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2493 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2494 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2495 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2496 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2497 | 0 \ |
| 2498 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2499 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2500 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2501 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2502 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2503 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2504 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2505 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2506 | -c "ignoring unexpected CID" \ |
| 2507 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2508 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2509 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2510 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2511 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2512 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2513 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2514 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2515 | 0 \ |
| 2516 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2517 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2518 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2519 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2520 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2521 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 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 | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2525 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2526 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 2527 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2528 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 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 | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2539 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2540 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2541 | -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] | 2542 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2543 | "$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" \ |
| 2544 | 0 \ |
| 2545 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2546 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2547 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2548 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2549 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2550 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2551 | -c "ignoring unexpected CID" \ |
| 2552 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2553 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2554 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2555 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2556 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2557 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2558 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2559 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2560 | 0 \ |
| 2561 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2562 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2563 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2564 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2565 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2566 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2567 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2568 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2569 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 2570 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2571 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2572 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2573 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2574 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2575 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2576 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2577 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2578 | 0 \ |
| 2579 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2580 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2581 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2582 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2583 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2584 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2585 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2586 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2587 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2588 | -c "ignoring unexpected CID" \ |
| 2589 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2590 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2591 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2592 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2593 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2594 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 2595 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2596 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2597 | 0 \ |
| 2598 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2599 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2600 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2601 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2602 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2603 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2604 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2605 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2606 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2607 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2608 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2609 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2610 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2611 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2612 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2613 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2614 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2615 | 0 \ |
| 2616 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2617 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2618 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2619 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2620 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2621 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2622 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2623 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2624 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2625 | -c "ignoring unexpected CID" \ |
| 2626 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2627 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 2628 | # 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] | 2629 | # tests check that the buffer contents are reallocated when the message is |
| 2630 | # larger than the buffer. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2631 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2632 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2633 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2634 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2635 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 2636 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2637 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 2638 | 0 \ |
| 2639 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2640 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2641 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2642 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2643 | -s "Reallocating in_buf" \ |
| 2644 | -s "Reallocating out_buf" |
| 2645 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2646 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2647 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2648 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2649 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2650 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 2651 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2652 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 2653 | 0 \ |
| 2654 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2655 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2656 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2657 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2658 | -s "Reallocating in_buf" \ |
| 2659 | -s "Reallocating out_buf" |
| 2660 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2661 | # Tests for Encrypt-then-MAC extension |
| 2662 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2663 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2664 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2665 | "$P_SRV debug_level=3 \ |
| 2666 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2667 | "$P_CLI debug_level=3" \ |
| 2668 | 0 \ |
| 2669 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2670 | -s "found encrypt then mac extension" \ |
| 2671 | -s "server hello, adding encrypt then mac extension" \ |
| 2672 | -c "found encrypt_then_mac extension" \ |
| 2673 | -c "using encrypt then mac" \ |
| 2674 | -s "using encrypt then mac" |
| 2675 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2676 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2677 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2678 | "$P_SRV debug_level=3 etm=0 \ |
| 2679 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2680 | "$P_CLI debug_level=3 etm=1" \ |
| 2681 | 0 \ |
| 2682 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2683 | -s "found encrypt then mac extension" \ |
| 2684 | -S "server hello, adding encrypt then mac extension" \ |
| 2685 | -C "found encrypt_then_mac extension" \ |
| 2686 | -C "using encrypt then mac" \ |
| 2687 | -S "using encrypt then mac" |
| 2688 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2689 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2690 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 2691 | "$P_SRV debug_level=3 etm=1 \ |
| 2692 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 2693 | "$P_CLI debug_level=3 etm=1" \ |
| 2694 | 0 \ |
| 2695 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2696 | -s "found encrypt then mac extension" \ |
| 2697 | -S "server hello, adding encrypt then mac extension" \ |
| 2698 | -C "found encrypt_then_mac extension" \ |
| 2699 | -C "using encrypt then mac" \ |
| 2700 | -S "using encrypt then mac" |
| 2701 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2702 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2703 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2704 | "$P_SRV debug_level=3 etm=1 \ |
| 2705 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2706 | "$P_CLI debug_level=3 etm=0" \ |
| 2707 | 0 \ |
| 2708 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2709 | -S "found encrypt then mac extension" \ |
| 2710 | -S "server hello, adding encrypt then mac extension" \ |
| 2711 | -C "found encrypt_then_mac extension" \ |
| 2712 | -C "using encrypt then mac" \ |
| 2713 | -S "using encrypt then mac" |
| 2714 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2715 | # Tests for Extended Master Secret extension |
| 2716 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2717 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2718 | run_test "Extended Master Secret: default" \ |
| 2719 | "$P_SRV debug_level=3" \ |
| 2720 | "$P_CLI debug_level=3" \ |
| 2721 | 0 \ |
| 2722 | -c "client hello, adding extended_master_secret extension" \ |
| 2723 | -s "found extended master secret extension" \ |
| 2724 | -s "server hello, adding extended master secret extension" \ |
| 2725 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2726 | -c "session hash for extended master secret" \ |
| 2727 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2728 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2729 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2730 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 2731 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 2732 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 2733 | 0 \ |
| 2734 | -c "client hello, adding extended_master_secret extension" \ |
| 2735 | -s "found extended master secret extension" \ |
| 2736 | -S "server hello, adding extended master secret extension" \ |
| 2737 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2738 | -C "session hash for extended master secret" \ |
| 2739 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2740 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2741 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2742 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 2743 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 2744 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 2745 | 0 \ |
| 2746 | -C "client hello, adding extended_master_secret extension" \ |
| 2747 | -S "found extended master secret extension" \ |
| 2748 | -S "server hello, adding extended master secret extension" \ |
| 2749 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2750 | -C "session hash for extended master secret" \ |
| 2751 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2752 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2753 | # Test sending and receiving empty application data records |
| 2754 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2755 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2756 | run_test "Encrypt then MAC: empty application data record" \ |
| 2757 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 2758 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 2759 | 0 \ |
| 2760 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2761 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2762 | -c "0 bytes written in 1 fragments" |
| 2763 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2764 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2765 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2766 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 2767 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 2768 | 0 \ |
| 2769 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2770 | -c "0 bytes written in 1 fragments" |
| 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, DTLS: empty application data record" \ |
| 2774 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 2775 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 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, DTLS: 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 dtls=1" \ |
| 2784 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 2785 | 0 \ |
| 2786 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2787 | -c "0 bytes written in 1 fragments" |
| 2788 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2789 | # Tests for CBC 1/n-1 record splitting |
| 2790 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2791 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2792 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 2793 | "$P_SRV" \ |
| 2794 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 2795 | request_size=123 force_version=tls12" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2796 | 0 \ |
| 2797 | -s "Read from client: 123 bytes read" \ |
| 2798 | -S "Read from client: 1 bytes read" \ |
| 2799 | -S "122 bytes read" |
| 2800 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2801 | # Tests for Session Tickets |
| 2802 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2803 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2804 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2805 | "$P_SRV debug_level=3 tickets=1" \ |
| 2806 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2807 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2808 | -c "client hello, adding session ticket extension" \ |
| 2809 | -s "found session ticket extension" \ |
| 2810 | -s "server hello, adding session ticket extension" \ |
| 2811 | -c "found session_ticket extension" \ |
| 2812 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2813 | -S "session successfully restored from cache" \ |
| 2814 | -s "session successfully restored from ticket" \ |
| 2815 | -s "a session has been resumed" \ |
| 2816 | -c "a session has been resumed" |
| 2817 | |
Jerry Yu | baa4934 | 2022-02-15 10:26:40 +0800 | [diff] [blame] | 2818 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 2819 | run_test "Session resume using tickets: manual rotation" \ |
| 2820 | "$P_SRV debug_level=3 tickets=1 ticket_rotate=1" \ |
| 2821 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2822 | 0 \ |
| 2823 | -c "client hello, adding session ticket extension" \ |
| 2824 | -s "found session ticket extension" \ |
| 2825 | -s "server hello, adding session ticket extension" \ |
| 2826 | -c "found session_ticket extension" \ |
| 2827 | -c "parse new session ticket" \ |
| 2828 | -S "session successfully restored from cache" \ |
| 2829 | -s "session successfully restored from ticket" \ |
| 2830 | -s "a session has been resumed" \ |
| 2831 | -c "a session has been resumed" |
| 2832 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2833 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2834 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2835 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2836 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2837 | 0 \ |
| 2838 | -c "client hello, adding session ticket extension" \ |
| 2839 | -s "found session ticket extension" \ |
| 2840 | -s "server hello, adding session ticket extension" \ |
| 2841 | -c "found session_ticket extension" \ |
| 2842 | -c "parse new session ticket" \ |
| 2843 | -S "session successfully restored from cache" \ |
| 2844 | -s "session successfully restored from ticket" \ |
| 2845 | -s "a session has been resumed" \ |
| 2846 | -c "a session has been resumed" |
| 2847 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2848 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2849 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2850 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2851 | "$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] | 2852 | 0 \ |
| 2853 | -c "client hello, adding session ticket extension" \ |
| 2854 | -s "found session ticket extension" \ |
| 2855 | -s "server hello, adding session ticket extension" \ |
| 2856 | -c "found session_ticket extension" \ |
| 2857 | -c "parse new session ticket" \ |
| 2858 | -S "session successfully restored from cache" \ |
| 2859 | -S "session successfully restored from ticket" \ |
| 2860 | -S "a session has been resumed" \ |
| 2861 | -C "a session has been resumed" |
| 2862 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2863 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2864 | run_test "Session resume using tickets: session copy" \ |
| 2865 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2866 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 2867 | 0 \ |
| 2868 | -c "client hello, adding session ticket extension" \ |
| 2869 | -s "found session ticket extension" \ |
| 2870 | -s "server hello, adding session ticket extension" \ |
| 2871 | -c "found session_ticket extension" \ |
| 2872 | -c "parse new session ticket" \ |
| 2873 | -S "session successfully restored from cache" \ |
| 2874 | -s "session successfully restored from ticket" \ |
| 2875 | -s "a session has been resumed" \ |
| 2876 | -c "a session has been resumed" |
| 2877 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2878 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2879 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2880 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2881 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2882 | 0 \ |
| 2883 | -c "client hello, adding session ticket extension" \ |
| 2884 | -c "found session_ticket extension" \ |
| 2885 | -c "parse new session ticket" \ |
| 2886 | -c "a session has been resumed" |
| 2887 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2888 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2889 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2890 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2891 | "( $O_CLI -sess_out $SESSION; \ |
| 2892 | $O_CLI -sess_in $SESSION; \ |
| 2893 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2894 | 0 \ |
| 2895 | -s "found session ticket extension" \ |
| 2896 | -s "server hello, adding session ticket extension" \ |
| 2897 | -S "session successfully restored from cache" \ |
| 2898 | -s "session successfully restored from ticket" \ |
| 2899 | -s "a session has been resumed" |
| 2900 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2901 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 2902 | run_test "Session resume using tickets: AES-128-GCM" \ |
| 2903 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-GCM" \ |
| 2904 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2905 | 0 \ |
| 2906 | -c "client hello, adding session ticket extension" \ |
| 2907 | -s "found session ticket extension" \ |
| 2908 | -s "server hello, adding session ticket extension" \ |
| 2909 | -c "found session_ticket extension" \ |
| 2910 | -c "parse new session ticket" \ |
| 2911 | -S "session successfully restored from cache" \ |
| 2912 | -s "session successfully restored from ticket" \ |
| 2913 | -s "a session has been resumed" \ |
| 2914 | -c "a session has been resumed" |
| 2915 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2916 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 2917 | run_test "Session resume using tickets: AES-192-GCM" \ |
| 2918 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-GCM" \ |
| 2919 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2920 | 0 \ |
| 2921 | -c "client hello, adding session ticket extension" \ |
| 2922 | -s "found session ticket extension" \ |
| 2923 | -s "server hello, adding session ticket extension" \ |
| 2924 | -c "found session_ticket extension" \ |
| 2925 | -c "parse new session ticket" \ |
| 2926 | -S "session successfully restored from cache" \ |
| 2927 | -s "session successfully restored from ticket" \ |
| 2928 | -s "a session has been resumed" \ |
| 2929 | -c "a session has been resumed" |
| 2930 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2931 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 2932 | run_test "Session resume using tickets: AES-128-CCM" \ |
| 2933 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-CCM" \ |
| 2934 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2935 | 0 \ |
| 2936 | -c "client hello, adding session ticket extension" \ |
| 2937 | -s "found session ticket extension" \ |
| 2938 | -s "server hello, adding session ticket extension" \ |
| 2939 | -c "found session_ticket extension" \ |
| 2940 | -c "parse new session ticket" \ |
| 2941 | -S "session successfully restored from cache" \ |
| 2942 | -s "session successfully restored from ticket" \ |
| 2943 | -s "a session has been resumed" \ |
| 2944 | -c "a session has been resumed" |
| 2945 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2946 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 2947 | run_test "Session resume using tickets: AES-192-CCM" \ |
| 2948 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-CCM" \ |
| 2949 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2950 | 0 \ |
| 2951 | -c "client hello, adding session ticket extension" \ |
| 2952 | -s "found session ticket extension" \ |
| 2953 | -s "server hello, adding session ticket extension" \ |
| 2954 | -c "found session_ticket extension" \ |
| 2955 | -c "parse new session ticket" \ |
| 2956 | -S "session successfully restored from cache" \ |
| 2957 | -s "session successfully restored from ticket" \ |
| 2958 | -s "a session has been resumed" \ |
| 2959 | -c "a session has been resumed" |
| 2960 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2961 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 2962 | run_test "Session resume using tickets: AES-256-CCM" \ |
| 2963 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-256-CCM" \ |
| 2964 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2965 | 0 \ |
| 2966 | -c "client hello, adding session ticket extension" \ |
| 2967 | -s "found session ticket extension" \ |
| 2968 | -s "server hello, adding session ticket extension" \ |
| 2969 | -c "found session_ticket extension" \ |
| 2970 | -c "parse new session ticket" \ |
| 2971 | -S "session successfully restored from cache" \ |
| 2972 | -s "session successfully restored from ticket" \ |
| 2973 | -s "a session has been resumed" \ |
| 2974 | -c "a session has been resumed" |
| 2975 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2976 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 2977 | run_test "Session resume using tickets: CAMELLIA-128-CCM" \ |
| 2978 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-128-CCM" \ |
| 2979 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2980 | 0 \ |
| 2981 | -c "client hello, adding session ticket extension" \ |
| 2982 | -s "found session ticket extension" \ |
| 2983 | -s "server hello, adding session ticket extension" \ |
| 2984 | -c "found session_ticket extension" \ |
| 2985 | -c "parse new session ticket" \ |
| 2986 | -S "session successfully restored from cache" \ |
| 2987 | -s "session successfully restored from ticket" \ |
| 2988 | -s "a session has been resumed" \ |
| 2989 | -c "a session has been resumed" |
| 2990 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2991 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 2992 | run_test "Session resume using tickets: CAMELLIA-192-CCM" \ |
| 2993 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-192-CCM" \ |
| 2994 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2995 | 0 \ |
| 2996 | -c "client hello, adding session ticket extension" \ |
| 2997 | -s "found session ticket extension" \ |
| 2998 | -s "server hello, adding session ticket extension" \ |
| 2999 | -c "found session_ticket extension" \ |
| 3000 | -c "parse new session ticket" \ |
| 3001 | -S "session successfully restored from cache" \ |
| 3002 | -s "session successfully restored from ticket" \ |
| 3003 | -s "a session has been resumed" \ |
| 3004 | -c "a session has been resumed" |
| 3005 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3006 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3007 | run_test "Session resume using tickets: CAMELLIA-256-CCM" \ |
| 3008 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-256-CCM" \ |
| 3009 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3010 | 0 \ |
| 3011 | -c "client hello, adding session ticket extension" \ |
| 3012 | -s "found session ticket extension" \ |
| 3013 | -s "server hello, adding session ticket extension" \ |
| 3014 | -c "found session_ticket extension" \ |
| 3015 | -c "parse new session ticket" \ |
| 3016 | -S "session successfully restored from cache" \ |
| 3017 | -s "session successfully restored from ticket" \ |
| 3018 | -s "a session has been resumed" \ |
| 3019 | -c "a session has been resumed" |
| 3020 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3021 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3022 | run_test "Session resume using tickets: ARIA-128-GCM" \ |
| 3023 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-GCM" \ |
| 3024 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3025 | 0 \ |
| 3026 | -c "client hello, adding session ticket extension" \ |
| 3027 | -s "found session ticket extension" \ |
| 3028 | -s "server hello, adding session ticket extension" \ |
| 3029 | -c "found session_ticket extension" \ |
| 3030 | -c "parse new session ticket" \ |
| 3031 | -S "session successfully restored from cache" \ |
| 3032 | -s "session successfully restored from ticket" \ |
| 3033 | -s "a session has been resumed" \ |
| 3034 | -c "a session has been resumed" |
| 3035 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3036 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3037 | run_test "Session resume using tickets: ARIA-192-GCM" \ |
| 3038 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-GCM" \ |
| 3039 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3040 | 0 \ |
| 3041 | -c "client hello, adding session ticket extension" \ |
| 3042 | -s "found session ticket extension" \ |
| 3043 | -s "server hello, adding session ticket extension" \ |
| 3044 | -c "found session_ticket extension" \ |
| 3045 | -c "parse new session ticket" \ |
| 3046 | -S "session successfully restored from cache" \ |
| 3047 | -s "session successfully restored from ticket" \ |
| 3048 | -s "a session has been resumed" \ |
| 3049 | -c "a session has been resumed" |
| 3050 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3051 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3052 | run_test "Session resume using tickets: ARIA-256-GCM" \ |
| 3053 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-GCM" \ |
| 3054 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3055 | 0 \ |
| 3056 | -c "client hello, adding session ticket extension" \ |
| 3057 | -s "found session ticket extension" \ |
| 3058 | -s "server hello, adding session ticket extension" \ |
| 3059 | -c "found session_ticket extension" \ |
| 3060 | -c "parse new session ticket" \ |
| 3061 | -S "session successfully restored from cache" \ |
| 3062 | -s "session successfully restored from ticket" \ |
| 3063 | -s "a session has been resumed" \ |
| 3064 | -c "a session has been resumed" |
| 3065 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3066 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3067 | run_test "Session resume using tickets: ARIA-128-CCM" \ |
| 3068 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-CCM" \ |
| 3069 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3070 | 0 \ |
| 3071 | -c "client hello, adding session ticket extension" \ |
| 3072 | -s "found session ticket extension" \ |
| 3073 | -s "server hello, adding session ticket extension" \ |
| 3074 | -c "found session_ticket extension" \ |
| 3075 | -c "parse new session ticket" \ |
| 3076 | -S "session successfully restored from cache" \ |
| 3077 | -s "session successfully restored from ticket" \ |
| 3078 | -s "a session has been resumed" \ |
| 3079 | -c "a session has been resumed" |
| 3080 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3081 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3082 | run_test "Session resume using tickets: ARIA-192-CCM" \ |
| 3083 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-CCM" \ |
| 3084 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3085 | 0 \ |
| 3086 | -c "client hello, adding session ticket extension" \ |
| 3087 | -s "found session ticket extension" \ |
| 3088 | -s "server hello, adding session ticket extension" \ |
| 3089 | -c "found session_ticket extension" \ |
| 3090 | -c "parse new session ticket" \ |
| 3091 | -S "session successfully restored from cache" \ |
| 3092 | -s "session successfully restored from ticket" \ |
| 3093 | -s "a session has been resumed" \ |
| 3094 | -c "a session has been resumed" |
| 3095 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3096 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3097 | run_test "Session resume using tickets: ARIA-256-CCM" \ |
| 3098 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-CCM" \ |
| 3099 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3100 | 0 \ |
| 3101 | -c "client hello, adding session ticket extension" \ |
| 3102 | -s "found session ticket extension" \ |
| 3103 | -s "server hello, adding session ticket extension" \ |
| 3104 | -c "found session_ticket extension" \ |
| 3105 | -c "parse new session ticket" \ |
| 3106 | -S "session successfully restored from cache" \ |
| 3107 | -s "session successfully restored from ticket" \ |
| 3108 | -s "a session has been resumed" \ |
| 3109 | -c "a session has been resumed" |
| 3110 | |
Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 3111 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 3112 | run_test "Session resume using tickets: CHACHA20-POLY1305" \ |
| 3113 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CHACHA20-POLY1305" \ |
| 3114 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3115 | 0 \ |
| 3116 | -c "client hello, adding session ticket extension" \ |
| 3117 | -s "found session ticket extension" \ |
| 3118 | -s "server hello, adding session ticket extension" \ |
| 3119 | -c "found session_ticket extension" \ |
| 3120 | -c "parse new session ticket" \ |
| 3121 | -S "session successfully restored from cache" \ |
| 3122 | -s "session successfully restored from ticket" \ |
| 3123 | -s "a session has been resumed" \ |
| 3124 | -c "a session has been resumed" |
| 3125 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3126 | # Tests for Session Tickets with DTLS |
| 3127 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3128 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3129 | run_test "Session resume using tickets, DTLS: basic" \ |
| 3130 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3131 | "$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] | 3132 | 0 \ |
| 3133 | -c "client hello, adding session ticket extension" \ |
| 3134 | -s "found session ticket extension" \ |
| 3135 | -s "server hello, adding session ticket extension" \ |
| 3136 | -c "found session_ticket extension" \ |
| 3137 | -c "parse new session ticket" \ |
| 3138 | -S "session successfully restored from cache" \ |
| 3139 | -s "session successfully restored from ticket" \ |
| 3140 | -s "a session has been resumed" \ |
| 3141 | -c "a session has been resumed" |
| 3142 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3143 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3144 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 3145 | "$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] | 3146 | "$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] | 3147 | 0 \ |
| 3148 | -c "client hello, adding session ticket extension" \ |
| 3149 | -s "found session ticket extension" \ |
| 3150 | -s "server hello, adding session ticket extension" \ |
| 3151 | -c "found session_ticket extension" \ |
| 3152 | -c "parse new session ticket" \ |
| 3153 | -S "session successfully restored from cache" \ |
| 3154 | -s "session successfully restored from ticket" \ |
| 3155 | -s "a session has been resumed" \ |
| 3156 | -c "a session has been resumed" |
| 3157 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3158 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3159 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 3160 | "$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] | 3161 | "$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] | 3162 | 0 \ |
| 3163 | -c "client hello, adding session ticket extension" \ |
| 3164 | -s "found session ticket extension" \ |
| 3165 | -s "server hello, adding session ticket extension" \ |
| 3166 | -c "found session_ticket extension" \ |
| 3167 | -c "parse new session ticket" \ |
| 3168 | -S "session successfully restored from cache" \ |
| 3169 | -S "session successfully restored from ticket" \ |
| 3170 | -S "a session has been resumed" \ |
| 3171 | -C "a session has been resumed" |
| 3172 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3173 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3174 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 3175 | "$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] | 3176 | "$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] | 3177 | 0 \ |
| 3178 | -c "client hello, adding session ticket extension" \ |
| 3179 | -s "found session ticket extension" \ |
| 3180 | -s "server hello, adding session ticket extension" \ |
| 3181 | -c "found session_ticket extension" \ |
| 3182 | -c "parse new session ticket" \ |
| 3183 | -S "session successfully restored from cache" \ |
| 3184 | -s "session successfully restored from ticket" \ |
| 3185 | -s "a session has been resumed" \ |
| 3186 | -c "a session has been resumed" |
| 3187 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3188 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3189 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 3190 | "$O_SRV -dtls" \ |
| 3191 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 3192 | 0 \ |
| 3193 | -c "client hello, adding session ticket extension" \ |
| 3194 | -c "found session_ticket extension" \ |
| 3195 | -c "parse new session ticket" \ |
| 3196 | -c "a session has been resumed" |
| 3197 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3198 | # 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] | 3199 | # 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] | 3200 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3201 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3202 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 3203 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3204 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 3205 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3206 | rm -f $SESSION )" \ |
| 3207 | 0 \ |
| 3208 | -s "found session ticket extension" \ |
| 3209 | -s "server hello, adding session ticket extension" \ |
| 3210 | -S "session successfully restored from cache" \ |
| 3211 | -s "session successfully restored from ticket" \ |
| 3212 | -s "a session has been resumed" |
| 3213 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3214 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3215 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3216 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3217 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3218 | "$P_SRV debug_level=3 tickets=0" \ |
| 3219 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3220 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3221 | -c "client hello, adding session ticket extension" \ |
| 3222 | -s "found session ticket extension" \ |
| 3223 | -S "server hello, adding session ticket extension" \ |
| 3224 | -C "found session_ticket extension" \ |
| 3225 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3226 | -s "session successfully restored from cache" \ |
| 3227 | -S "session successfully restored from ticket" \ |
| 3228 | -s "a session has been resumed" \ |
| 3229 | -c "a session has been resumed" |
| 3230 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3231 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3232 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3233 | "$P_SRV debug_level=3 tickets=1" \ |
| 3234 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3235 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3236 | -C "client hello, adding session ticket extension" \ |
| 3237 | -S "found session ticket extension" \ |
| 3238 | -S "server hello, adding session ticket extension" \ |
| 3239 | -C "found session_ticket extension" \ |
| 3240 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3241 | -s "session successfully restored from cache" \ |
| 3242 | -S "session successfully restored from ticket" \ |
| 3243 | -s "a session has been resumed" \ |
| 3244 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3245 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3246 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3247 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3248 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 3249 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3250 | 0 \ |
| 3251 | -S "session successfully restored from cache" \ |
| 3252 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3253 | -S "a session has been resumed" \ |
| 3254 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3255 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3256 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3257 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3258 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 3259 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3260 | 0 \ |
| 3261 | -s "session successfully restored from cache" \ |
| 3262 | -S "session successfully restored from ticket" \ |
| 3263 | -s "a session has been resumed" \ |
| 3264 | -c "a session has been resumed" |
| 3265 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3266 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 3267 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3268 | "$P_SRV debug_level=3 tickets=0" \ |
| 3269 | "$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] | 3270 | 0 \ |
| 3271 | -s "session successfully restored from cache" \ |
| 3272 | -S "session successfully restored from ticket" \ |
| 3273 | -s "a session has been resumed" \ |
| 3274 | -c "a session has been resumed" |
| 3275 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3276 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3277 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3278 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 3279 | "$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] | 3280 | 0 \ |
| 3281 | -S "session successfully restored from cache" \ |
| 3282 | -S "session successfully restored from ticket" \ |
| 3283 | -S "a session has been resumed" \ |
| 3284 | -C "a session has been resumed" |
| 3285 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3286 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3287 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3288 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 3289 | "$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] | 3290 | 0 \ |
| 3291 | -s "session successfully restored from cache" \ |
| 3292 | -S "session successfully restored from ticket" \ |
| 3293 | -s "a session has been resumed" \ |
| 3294 | -c "a session has been resumed" |
| 3295 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3296 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3297 | run_test "Session resume using cache: session copy" \ |
| 3298 | "$P_SRV debug_level=3 tickets=0" \ |
| 3299 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 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 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3307 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3308 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3309 | "( $O_CLI -sess_out $SESSION; \ |
| 3310 | $O_CLI -sess_in $SESSION; \ |
| 3311 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 3312 | 0 \ |
| 3313 | -s "found session ticket extension" \ |
| 3314 | -S "server hello, adding session ticket extension" \ |
| 3315 | -s "session successfully restored from cache" \ |
| 3316 | -S "session successfully restored from ticket" \ |
| 3317 | -s "a session has been resumed" |
| 3318 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3319 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3320 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 3321 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3322 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 3323 | 0 \ |
| 3324 | -C "found session_ticket extension" \ |
| 3325 | -C "parse new session ticket" \ |
| 3326 | -c "a session has been resumed" |
| 3327 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3328 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 3329 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3330 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3331 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 3332 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3333 | "$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] | 3334 | 0 \ |
| 3335 | -c "client hello, adding session ticket extension" \ |
| 3336 | -s "found session ticket extension" \ |
| 3337 | -S "server hello, adding session ticket extension" \ |
| 3338 | -C "found session_ticket extension" \ |
| 3339 | -C "parse new session ticket" \ |
| 3340 | -s "session successfully restored from cache" \ |
| 3341 | -S "session successfully restored from ticket" \ |
| 3342 | -s "a session has been resumed" \ |
| 3343 | -c "a session has been resumed" |
| 3344 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3345 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3346 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 3347 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3348 | "$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] | 3349 | 0 \ |
| 3350 | -C "client hello, adding session ticket extension" \ |
| 3351 | -S "found session ticket extension" \ |
| 3352 | -S "server hello, adding session ticket extension" \ |
| 3353 | -C "found session_ticket extension" \ |
| 3354 | -C "parse new session ticket" \ |
| 3355 | -s "session successfully restored from cache" \ |
| 3356 | -S "session successfully restored from ticket" \ |
| 3357 | -s "a session has been resumed" \ |
| 3358 | -c "a session has been resumed" |
| 3359 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3360 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3361 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 3362 | "$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] | 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 | -S "session successfully restored from cache" \ |
| 3366 | -S "session successfully restored from ticket" \ |
| 3367 | -S "a session has been resumed" \ |
| 3368 | -C "a session has been resumed" |
| 3369 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3370 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3371 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 3372 | "$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] | 3373 | "$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] | 3374 | 0 \ |
| 3375 | -s "session successfully restored from cache" \ |
| 3376 | -S "session successfully restored from ticket" \ |
| 3377 | -s "a session has been resumed" \ |
| 3378 | -c "a session has been resumed" |
| 3379 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3380 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3381 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 3382 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3383 | "$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] | 3384 | 0 \ |
| 3385 | -s "session successfully restored from cache" \ |
| 3386 | -S "session successfully restored from ticket" \ |
| 3387 | -s "a session has been resumed" \ |
| 3388 | -c "a session has been resumed" |
| 3389 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3390 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3391 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 3392 | "$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] | 3393 | "$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] | 3394 | 0 \ |
| 3395 | -S "session successfully restored from cache" \ |
| 3396 | -S "session successfully restored from ticket" \ |
| 3397 | -S "a session has been resumed" \ |
| 3398 | -C "a session has been resumed" |
| 3399 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3400 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3401 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 3402 | "$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] | 3403 | "$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] | 3404 | 0 \ |
| 3405 | -s "session successfully restored from cache" \ |
| 3406 | -S "session successfully restored from ticket" \ |
| 3407 | -s "a session has been resumed" \ |
| 3408 | -c "a session has been resumed" |
| 3409 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3410 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3411 | run_test "Session resume using cache, DTLS: session copy" \ |
| 3412 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3413 | "$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] | 3414 | 0 \ |
| 3415 | -s "session successfully restored from cache" \ |
| 3416 | -S "session successfully restored from ticket" \ |
| 3417 | -s "a session has been resumed" \ |
| 3418 | -c "a session has been resumed" |
| 3419 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3420 | # 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] | 3421 | # 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] | 3422 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3423 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3424 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 3425 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3426 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 3427 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3428 | rm -f $SESSION )" \ |
| 3429 | 0 \ |
| 3430 | -s "found session ticket extension" \ |
| 3431 | -S "server hello, adding session ticket extension" \ |
| 3432 | -s "session successfully restored from cache" \ |
| 3433 | -S "session successfully restored from ticket" \ |
| 3434 | -s "a session has been resumed" |
| 3435 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3436 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3437 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 3438 | "$O_SRV -dtls" \ |
| 3439 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 3440 | 0 \ |
| 3441 | -C "found session_ticket extension" \ |
| 3442 | -C "parse new session ticket" \ |
| 3443 | -c "a session has been resumed" |
| 3444 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3445 | # Tests for Max Fragment Length extension |
| 3446 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3447 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3448 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3449 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3450 | "$P_SRV debug_level=3" \ |
| 3451 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3452 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3453 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3454 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3455 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3456 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3457 | -C "client hello, adding max_fragment_length extension" \ |
| 3458 | -S "found max fragment length extension" \ |
| 3459 | -S "server hello, max_fragment_length extension" \ |
| 3460 | -C "found max_fragment_length extension" |
| 3461 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3462 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3463 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3464 | run_test "Max fragment length: enabled, default, larger message" \ |
| 3465 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3466 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3467 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3468 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3469 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3470 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3471 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3472 | -C "client hello, adding max_fragment_length extension" \ |
| 3473 | -S "found max fragment length extension" \ |
| 3474 | -S "server hello, max_fragment_length extension" \ |
| 3475 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3476 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3477 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3478 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3479 | |
| 3480 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3481 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3482 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 3483 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3484 | "$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] | 3485 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3486 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3487 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3488 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3489 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3490 | -C "client hello, adding max_fragment_length extension" \ |
| 3491 | -S "found max fragment length extension" \ |
| 3492 | -S "server hello, max_fragment_length extension" \ |
| 3493 | -C "found max_fragment_length extension" \ |
| 3494 | -c "fragment larger than.*maximum " |
| 3495 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3496 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 3497 | # (session fragment length will be 16384 regardless of mbedtls |
| 3498 | # content length configuration.) |
| 3499 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3500 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3501 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3502 | run_test "Max fragment length: disabled, larger message" \ |
| 3503 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3504 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3505 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3506 | -C "Maximum incoming record payload length is 16384" \ |
| 3507 | -C "Maximum outgoing record payload length is 16384" \ |
| 3508 | -S "Maximum incoming record payload length is 16384" \ |
| 3509 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3510 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3511 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3512 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3513 | |
| 3514 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3515 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 3516 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3517 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3518 | "$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] | 3519 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3520 | -C "Maximum incoming record payload length is 16384" \ |
| 3521 | -C "Maximum outgoing record payload length is 16384" \ |
| 3522 | -S "Maximum incoming record payload length is 16384" \ |
| 3523 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3524 | -c "fragment larger than.*maximum " |
| 3525 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3526 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3527 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3528 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3529 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3530 | "$P_SRV debug_level=3" \ |
| 3531 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3532 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3533 | -c "Maximum incoming record payload length is 4096" \ |
| 3534 | -c "Maximum outgoing record payload length is 4096" \ |
| 3535 | -s "Maximum incoming record payload length is 4096" \ |
| 3536 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3537 | -c "client hello, adding max_fragment_length extension" \ |
| 3538 | -s "found max fragment length extension" \ |
| 3539 | -s "server hello, max_fragment_length extension" \ |
| 3540 | -c "found max_fragment_length extension" |
| 3541 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3542 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3543 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3544 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3545 | run_test "Max fragment length: client 512, server 1024" \ |
| 3546 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3547 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3548 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3549 | -c "Maximum incoming record payload length is 512" \ |
| 3550 | -c "Maximum outgoing record payload length is 512" \ |
| 3551 | -s "Maximum incoming record payload length is 512" \ |
| 3552 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3553 | -c "client hello, adding max_fragment_length extension" \ |
| 3554 | -s "found max fragment length extension" \ |
| 3555 | -s "server hello, max_fragment_length extension" \ |
| 3556 | -c "found max_fragment_length extension" |
| 3557 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3558 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3559 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3560 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3561 | run_test "Max fragment length: client 512, server 2048" \ |
| 3562 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3563 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3564 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3565 | -c "Maximum incoming record payload length is 512" \ |
| 3566 | -c "Maximum outgoing record payload length is 512" \ |
| 3567 | -s "Maximum incoming record payload length is 512" \ |
| 3568 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3569 | -c "client hello, adding max_fragment_length extension" \ |
| 3570 | -s "found max fragment length extension" \ |
| 3571 | -s "server hello, max_fragment_length extension" \ |
| 3572 | -c "found max_fragment_length extension" |
| 3573 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3574 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3575 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3576 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3577 | run_test "Max fragment length: client 512, server 4096" \ |
| 3578 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3579 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3580 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3581 | -c "Maximum incoming record payload length is 512" \ |
| 3582 | -c "Maximum outgoing record payload length is 512" \ |
| 3583 | -s "Maximum incoming record payload length is 512" \ |
| 3584 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3585 | -c "client hello, adding max_fragment_length extension" \ |
| 3586 | -s "found max fragment length extension" \ |
| 3587 | -s "server hello, max_fragment_length extension" \ |
| 3588 | -c "found max_fragment_length extension" |
| 3589 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3590 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3591 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3592 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3593 | run_test "Max fragment length: client 1024, server 512" \ |
| 3594 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3595 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3596 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3597 | -c "Maximum incoming record payload length is 1024" \ |
| 3598 | -c "Maximum outgoing record payload length is 1024" \ |
| 3599 | -s "Maximum incoming record payload length is 1024" \ |
| 3600 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3601 | -c "client hello, adding max_fragment_length extension" \ |
| 3602 | -s "found max fragment length extension" \ |
| 3603 | -s "server hello, max_fragment_length extension" \ |
| 3604 | -c "found max_fragment_length extension" |
| 3605 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3606 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3607 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3608 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3609 | run_test "Max fragment length: client 1024, server 2048" \ |
| 3610 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3611 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3612 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3613 | -c "Maximum incoming record payload length is 1024" \ |
| 3614 | -c "Maximum outgoing record payload length is 1024" \ |
| 3615 | -s "Maximum incoming record payload length is 1024" \ |
| 3616 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3617 | -c "client hello, adding max_fragment_length extension" \ |
| 3618 | -s "found max fragment length extension" \ |
| 3619 | -s "server hello, max_fragment_length extension" \ |
| 3620 | -c "found max_fragment_length extension" |
| 3621 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3622 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3623 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3624 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3625 | run_test "Max fragment length: client 1024, server 4096" \ |
| 3626 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3627 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3628 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3629 | -c "Maximum incoming record payload length is 1024" \ |
| 3630 | -c "Maximum outgoing record payload length is 1024" \ |
| 3631 | -s "Maximum incoming record payload length is 1024" \ |
| 3632 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3633 | -c "client hello, adding max_fragment_length extension" \ |
| 3634 | -s "found max fragment length extension" \ |
| 3635 | -s "server hello, max_fragment_length extension" \ |
| 3636 | -c "found max_fragment_length extension" |
| 3637 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3638 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3639 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3640 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3641 | run_test "Max fragment length: client 2048, server 512" \ |
| 3642 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3643 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3644 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3645 | -c "Maximum incoming record payload length is 2048" \ |
| 3646 | -c "Maximum outgoing record payload length is 2048" \ |
| 3647 | -s "Maximum incoming record payload length is 2048" \ |
| 3648 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3649 | -c "client hello, adding max_fragment_length extension" \ |
| 3650 | -s "found max fragment length extension" \ |
| 3651 | -s "server hello, max_fragment_length extension" \ |
| 3652 | -c "found max_fragment_length extension" |
| 3653 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3654 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3655 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3656 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3657 | run_test "Max fragment length: client 2048, server 1024" \ |
| 3658 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3659 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3660 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3661 | -c "Maximum incoming record payload length is 2048" \ |
| 3662 | -c "Maximum outgoing record payload length is 2048" \ |
| 3663 | -s "Maximum incoming record payload length is 2048" \ |
| 3664 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3665 | -c "client hello, adding max_fragment_length extension" \ |
| 3666 | -s "found max fragment length extension" \ |
| 3667 | -s "server hello, max_fragment_length extension" \ |
| 3668 | -c "found max_fragment_length extension" |
| 3669 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3670 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3671 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3672 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3673 | run_test "Max fragment length: client 2048, server 4096" \ |
| 3674 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3675 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3676 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3677 | -c "Maximum incoming record payload length is 2048" \ |
| 3678 | -c "Maximum outgoing record payload length is 2048" \ |
| 3679 | -s "Maximum incoming record payload length is 2048" \ |
| 3680 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3681 | -c "client hello, adding max_fragment_length extension" \ |
| 3682 | -s "found max fragment length extension" \ |
| 3683 | -s "server hello, max_fragment_length extension" \ |
| 3684 | -c "found max_fragment_length extension" |
| 3685 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3686 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3687 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3688 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3689 | run_test "Max fragment length: client 4096, server 512" \ |
| 3690 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3691 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3692 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3693 | -c "Maximum incoming record payload length is 4096" \ |
| 3694 | -c "Maximum outgoing record payload length is 4096" \ |
| 3695 | -s "Maximum incoming record payload length is 4096" \ |
| 3696 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3697 | -c "client hello, adding max_fragment_length extension" \ |
| 3698 | -s "found max fragment length extension" \ |
| 3699 | -s "server hello, max_fragment_length extension" \ |
| 3700 | -c "found max_fragment_length extension" |
| 3701 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3702 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3703 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3704 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3705 | run_test "Max fragment length: client 4096, server 1024" \ |
| 3706 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3707 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3708 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3709 | -c "Maximum incoming record payload length is 4096" \ |
| 3710 | -c "Maximum outgoing record payload length is 4096" \ |
| 3711 | -s "Maximum incoming record payload length is 4096" \ |
| 3712 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3713 | -c "client hello, adding max_fragment_length extension" \ |
| 3714 | -s "found max fragment length extension" \ |
| 3715 | -s "server hello, max_fragment_length extension" \ |
| 3716 | -c "found max_fragment_length extension" |
| 3717 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3718 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3719 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3720 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3721 | run_test "Max fragment length: client 4096, server 2048" \ |
| 3722 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3723 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3724 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3725 | -c "Maximum incoming record payload length is 4096" \ |
| 3726 | -c "Maximum outgoing record payload length is 4096" \ |
| 3727 | -s "Maximum incoming record payload length is 4096" \ |
| 3728 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3729 | -c "client hello, adding max_fragment_length extension" \ |
| 3730 | -s "found max fragment length extension" \ |
| 3731 | -s "server hello, max_fragment_length extension" \ |
| 3732 | -c "found max_fragment_length extension" |
| 3733 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3734 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3735 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3736 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3737 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3738 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3739 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3740 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3741 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3742 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3743 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3744 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3745 | -C "client hello, adding max_fragment_length extension" \ |
| 3746 | -S "found max fragment length extension" \ |
| 3747 | -S "server hello, max_fragment_length extension" \ |
| 3748 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3749 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3750 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3751 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3752 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3753 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3754 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3755 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3756 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3757 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3758 | -c "Maximum incoming record payload length is 4096" \ |
| 3759 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3760 | -c "client hello, adding max_fragment_length extension" \ |
| 3761 | -c "found max_fragment_length extension" |
| 3762 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3763 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3764 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3765 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3766 | run_test "Max fragment length: client, message just fits" \ |
| 3767 | "$P_SRV debug_level=3" \ |
| 3768 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 3769 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3770 | -c "Maximum incoming record payload length is 2048" \ |
| 3771 | -c "Maximum outgoing record payload length is 2048" \ |
| 3772 | -s "Maximum incoming record payload length is 2048" \ |
| 3773 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3774 | -c "client hello, adding max_fragment_length extension" \ |
| 3775 | -s "found max fragment length extension" \ |
| 3776 | -s "server hello, max_fragment_length extension" \ |
| 3777 | -c "found max_fragment_length extension" \ |
| 3778 | -c "2048 bytes written in 1 fragments" \ |
| 3779 | -s "2048 bytes read" |
| 3780 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3781 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3782 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3783 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3784 | run_test "Max fragment length: client, larger message" \ |
| 3785 | "$P_SRV debug_level=3" \ |
| 3786 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 3787 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3788 | -c "Maximum incoming record payload length is 2048" \ |
| 3789 | -c "Maximum outgoing record payload length is 2048" \ |
| 3790 | -s "Maximum incoming record payload length is 2048" \ |
| 3791 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3792 | -c "client hello, adding max_fragment_length extension" \ |
| 3793 | -s "found max fragment length extension" \ |
| 3794 | -s "server hello, max_fragment_length extension" \ |
| 3795 | -c "found max_fragment_length extension" \ |
| 3796 | -c "2345 bytes written in 2 fragments" \ |
| 3797 | -s "2048 bytes read" \ |
| 3798 | -s "297 bytes read" |
| 3799 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3800 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3801 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3802 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 3803 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3804 | "$P_SRV debug_level=3 dtls=1" \ |
| 3805 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 3806 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3807 | -c "Maximum incoming record payload length is 2048" \ |
| 3808 | -c "Maximum outgoing record payload length is 2048" \ |
| 3809 | -s "Maximum incoming record payload length is 2048" \ |
| 3810 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3811 | -c "client hello, adding max_fragment_length extension" \ |
| 3812 | -s "found max fragment length extension" \ |
| 3813 | -s "server hello, max_fragment_length extension" \ |
| 3814 | -c "found max_fragment_length extension" \ |
| 3815 | -c "fragment larger than.*maximum" |
| 3816 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3817 | # Tests for renegotiation |
| 3818 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3819 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3820 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3821 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3822 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3823 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3824 | 0 \ |
| 3825 | -C "client hello, adding renegotiation extension" \ |
| 3826 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3827 | -S "found renegotiation extension" \ |
| 3828 | -s "server hello, secure renegotiation extension" \ |
| 3829 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3830 | -C "=> renegotiate" \ |
| 3831 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3832 | -S "write hello request" |
| 3833 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3834 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3835 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3836 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3837 | "$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] | 3838 | "$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] | 3839 | 0 \ |
| 3840 | -c "client hello, adding renegotiation extension" \ |
| 3841 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3842 | -s "found renegotiation extension" \ |
| 3843 | -s "server hello, secure renegotiation extension" \ |
| 3844 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3845 | -c "=> renegotiate" \ |
| 3846 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3847 | -S "write hello request" |
| 3848 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3849 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3850 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3851 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3852 | "$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] | 3853 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3854 | 0 \ |
| 3855 | -c "client hello, adding renegotiation extension" \ |
| 3856 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3857 | -s "found renegotiation extension" \ |
| 3858 | -s "server hello, secure renegotiation extension" \ |
| 3859 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3860 | -c "=> renegotiate" \ |
| 3861 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3862 | -s "write hello request" |
| 3863 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3864 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3865 | # 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] | 3866 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3867 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3868 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3869 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 3870 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 3871 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3872 | 0 \ |
| 3873 | -c "client hello, adding renegotiation extension" \ |
| 3874 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3875 | -s "found renegotiation extension" \ |
| 3876 | -s "server hello, secure renegotiation extension" \ |
| 3877 | -c "found renegotiation extension" \ |
| 3878 | -c "=> renegotiate" \ |
| 3879 | -s "=> renegotiate" \ |
| 3880 | -S "write hello request" \ |
| 3881 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3882 | |
| 3883 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3884 | # 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] | 3885 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3886 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3887 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3888 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 3889 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 3890 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3891 | 0 \ |
| 3892 | -c "client hello, adding renegotiation extension" \ |
| 3893 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3894 | -s "found renegotiation extension" \ |
| 3895 | -s "server hello, secure renegotiation extension" \ |
| 3896 | -c "found renegotiation extension" \ |
| 3897 | -c "=> renegotiate" \ |
| 3898 | -s "=> renegotiate" \ |
| 3899 | -s "write hello request" \ |
| 3900 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3901 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3902 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3903 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3904 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3905 | "$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] | 3906 | "$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] | 3907 | 0 \ |
| 3908 | -c "client hello, adding renegotiation extension" \ |
| 3909 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3910 | -s "found renegotiation extension" \ |
| 3911 | -s "server hello, secure renegotiation extension" \ |
| 3912 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3913 | -c "=> renegotiate" \ |
| 3914 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3915 | -s "write hello request" |
| 3916 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3917 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3918 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3919 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3920 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3921 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 3922 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 3923 | "$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" \ |
| 3924 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3925 | -c "Maximum incoming record payload length is 2048" \ |
| 3926 | -c "Maximum outgoing record payload length is 2048" \ |
| 3927 | -s "Maximum incoming record payload length is 2048" \ |
| 3928 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3929 | -c "client hello, adding max_fragment_length extension" \ |
| 3930 | -s "found max fragment length extension" \ |
| 3931 | -s "server hello, max_fragment_length extension" \ |
| 3932 | -c "found max_fragment_length extension" \ |
| 3933 | -c "client hello, adding renegotiation extension" \ |
| 3934 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3935 | -s "found renegotiation extension" \ |
| 3936 | -s "server hello, secure renegotiation extension" \ |
| 3937 | -c "found renegotiation extension" \ |
| 3938 | -c "=> renegotiate" \ |
| 3939 | -s "=> renegotiate" \ |
| 3940 | -s "write hello request" |
| 3941 | |
| 3942 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3943 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3944 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3945 | "$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] | 3946 | "$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] | 3947 | 1 \ |
| 3948 | -c "client hello, adding renegotiation extension" \ |
| 3949 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3950 | -S "found renegotiation extension" \ |
| 3951 | -s "server hello, secure renegotiation extension" \ |
| 3952 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3953 | -c "=> renegotiate" \ |
| 3954 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3955 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 3956 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3957 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3958 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3959 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3960 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3961 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3962 | "$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] | 3963 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3964 | 0 \ |
| 3965 | -C "client hello, adding renegotiation extension" \ |
| 3966 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3967 | -S "found renegotiation extension" \ |
| 3968 | -s "server hello, secure renegotiation extension" \ |
| 3969 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3970 | -C "=> renegotiate" \ |
| 3971 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3972 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 3973 | -S "SSL - An unexpected message was received from our peer" \ |
| 3974 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3975 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3976 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3977 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3978 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3979 | "$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] | 3980 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3981 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3982 | 0 \ |
| 3983 | -C "client hello, adding renegotiation extension" \ |
| 3984 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3985 | -S "found renegotiation extension" \ |
| 3986 | -s "server hello, secure renegotiation extension" \ |
| 3987 | -c "found renegotiation extension" \ |
| 3988 | -C "=> renegotiate" \ |
| 3989 | -S "=> renegotiate" \ |
| 3990 | -s "write hello request" \ |
| 3991 | -S "SSL - An unexpected message was received from our peer" \ |
| 3992 | -S "failed" |
| 3993 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3994 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3995 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3996 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3997 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3998 | "$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] | 3999 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4000 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4001 | 0 \ |
| 4002 | -C "client hello, adding renegotiation extension" \ |
| 4003 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4004 | -S "found renegotiation extension" \ |
| 4005 | -s "server hello, secure renegotiation extension" \ |
| 4006 | -c "found renegotiation extension" \ |
| 4007 | -C "=> renegotiate" \ |
| 4008 | -S "=> renegotiate" \ |
| 4009 | -s "write hello request" \ |
| 4010 | -S "SSL - An unexpected message was received from our peer" \ |
| 4011 | -S "failed" |
| 4012 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4013 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4014 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4015 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4016 | "$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] | 4017 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4018 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4019 | 0 \ |
| 4020 | -C "client hello, adding renegotiation extension" \ |
| 4021 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4022 | -S "found renegotiation extension" \ |
| 4023 | -s "server hello, secure renegotiation extension" \ |
| 4024 | -c "found renegotiation extension" \ |
| 4025 | -C "=> renegotiate" \ |
| 4026 | -S "=> renegotiate" \ |
| 4027 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 4028 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4029 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4030 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4031 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4032 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4033 | "$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] | 4034 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4035 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4036 | 0 \ |
| 4037 | -c "client hello, adding renegotiation extension" \ |
| 4038 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4039 | -s "found renegotiation extension" \ |
| 4040 | -s "server hello, secure renegotiation extension" \ |
| 4041 | -c "found renegotiation extension" \ |
| 4042 | -c "=> renegotiate" \ |
| 4043 | -s "=> renegotiate" \ |
| 4044 | -s "write hello request" \ |
| 4045 | -S "SSL - An unexpected message was received from our peer" \ |
| 4046 | -S "failed" |
| 4047 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4048 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4049 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4050 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4051 | "$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] | 4052 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 4053 | 0 \ |
| 4054 | -C "client hello, adding renegotiation extension" \ |
| 4055 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4056 | -S "found renegotiation extension" \ |
| 4057 | -s "server hello, secure renegotiation extension" \ |
| 4058 | -c "found renegotiation extension" \ |
| 4059 | -S "record counter limit reached: renegotiate" \ |
| 4060 | -C "=> renegotiate" \ |
| 4061 | -S "=> renegotiate" \ |
| 4062 | -S "write hello request" \ |
| 4063 | -S "SSL - An unexpected message was received from our peer" \ |
| 4064 | -S "failed" |
| 4065 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 4066 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4067 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4068 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4069 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4070 | "$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] | 4071 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4072 | 0 \ |
| 4073 | -c "client hello, adding renegotiation extension" \ |
| 4074 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4075 | -s "found renegotiation extension" \ |
| 4076 | -s "server hello, secure renegotiation extension" \ |
| 4077 | -c "found renegotiation extension" \ |
| 4078 | -s "record counter limit reached: renegotiate" \ |
| 4079 | -c "=> renegotiate" \ |
| 4080 | -s "=> renegotiate" \ |
| 4081 | -s "write hello request" \ |
| 4082 | -S "SSL - An unexpected message was received from our peer" \ |
| 4083 | -S "failed" |
| 4084 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4085 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4086 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4087 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4088 | "$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] | 4089 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4090 | 0 \ |
| 4091 | -c "client hello, adding renegotiation extension" \ |
| 4092 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4093 | -s "found renegotiation extension" \ |
| 4094 | -s "server hello, secure renegotiation extension" \ |
| 4095 | -c "found renegotiation extension" \ |
| 4096 | -s "record counter limit reached: renegotiate" \ |
| 4097 | -c "=> renegotiate" \ |
| 4098 | -s "=> renegotiate" \ |
| 4099 | -s "write hello request" \ |
| 4100 | -S "SSL - An unexpected message was received from our peer" \ |
| 4101 | -S "failed" |
| 4102 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4103 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4104 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4105 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4106 | "$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] | 4107 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 4108 | 0 \ |
| 4109 | -C "client hello, adding renegotiation extension" \ |
| 4110 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4111 | -S "found renegotiation extension" \ |
| 4112 | -s "server hello, secure renegotiation extension" \ |
| 4113 | -c "found renegotiation extension" \ |
| 4114 | -S "record counter limit reached: renegotiate" \ |
| 4115 | -C "=> renegotiate" \ |
| 4116 | -S "=> renegotiate" \ |
| 4117 | -S "write hello request" \ |
| 4118 | -S "SSL - An unexpected message was received from our peer" \ |
| 4119 | -S "failed" |
| 4120 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4121 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4122 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4123 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4124 | "$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] | 4125 | "$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] | 4126 | 0 \ |
| 4127 | -c "client hello, adding renegotiation extension" \ |
| 4128 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4129 | -s "found renegotiation extension" \ |
| 4130 | -s "server hello, secure renegotiation extension" \ |
| 4131 | -c "found renegotiation extension" \ |
| 4132 | -c "=> renegotiate" \ |
| 4133 | -s "=> renegotiate" \ |
| 4134 | -S "write hello request" |
| 4135 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4136 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4137 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4138 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4139 | "$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] | 4140 | "$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] | 4141 | 0 \ |
| 4142 | -c "client hello, adding renegotiation extension" \ |
| 4143 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4144 | -s "found renegotiation extension" \ |
| 4145 | -s "server hello, secure renegotiation extension" \ |
| 4146 | -c "found renegotiation extension" \ |
| 4147 | -c "=> renegotiate" \ |
| 4148 | -s "=> renegotiate" \ |
| 4149 | -s "write hello request" |
| 4150 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4151 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4152 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4153 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 4154 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4155 | "$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] | 4156 | 0 \ |
| 4157 | -c "client hello, adding renegotiation extension" \ |
| 4158 | -c "found renegotiation extension" \ |
| 4159 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4160 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 4161 | -C "error" \ |
| 4162 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4163 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4164 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4165 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4166 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4167 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 4168 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4169 | "$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] | 4170 | 0 \ |
| 4171 | -c "client hello, adding renegotiation extension" \ |
| 4172 | -c "found renegotiation extension" \ |
| 4173 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4174 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 4175 | -C "error" \ |
| 4176 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4177 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4178 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4179 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4180 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4181 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 4182 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4183 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 4184 | 1 \ |
| 4185 | -c "client hello, adding renegotiation extension" \ |
| 4186 | -C "found renegotiation extension" \ |
| 4187 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4188 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4189 | -c "error" \ |
| 4190 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4191 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4192 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4193 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4194 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4195 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 4196 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4197 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 4198 | allow_legacy=0" \ |
| 4199 | 1 \ |
| 4200 | -c "client hello, adding renegotiation extension" \ |
| 4201 | -C "found renegotiation extension" \ |
| 4202 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4203 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4204 | -c "error" \ |
| 4205 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4206 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4207 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4208 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4209 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4210 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 4211 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4212 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 4213 | allow_legacy=1" \ |
| 4214 | 0 \ |
| 4215 | -c "client hello, adding renegotiation extension" \ |
| 4216 | -C "found renegotiation extension" \ |
| 4217 | -c "=> renegotiate" \ |
| 4218 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4219 | -C "error" \ |
| 4220 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4221 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4222 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4223 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 4224 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 4225 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 4226 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4227 | 0 \ |
| 4228 | -c "client hello, adding renegotiation extension" \ |
| 4229 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4230 | -s "found renegotiation extension" \ |
| 4231 | -s "server hello, secure renegotiation extension" \ |
| 4232 | -c "found renegotiation extension" \ |
| 4233 | -c "=> renegotiate" \ |
| 4234 | -s "=> renegotiate" \ |
| 4235 | -S "write hello request" |
| 4236 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4237 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4238 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 4239 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 4240 | "$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] | 4241 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 4242 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 4243 | 0 \ |
| 4244 | -c "client hello, adding renegotiation extension" \ |
| 4245 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4246 | -s "found renegotiation extension" \ |
| 4247 | -s "server hello, secure renegotiation extension" \ |
| 4248 | -c "found renegotiation extension" \ |
| 4249 | -c "=> renegotiate" \ |
| 4250 | -s "=> renegotiate" \ |
| 4251 | -s "write hello request" |
| 4252 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4253 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4254 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 4255 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 4256 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 4257 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 4258 | 0 \ |
| 4259 | -c "client hello, adding renegotiation extension" \ |
| 4260 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4261 | -s "found renegotiation extension" \ |
| 4262 | -s "server hello, secure renegotiation extension" \ |
| 4263 | -s "record counter limit reached: renegotiate" \ |
| 4264 | -c "=> renegotiate" \ |
| 4265 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4266 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 4267 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 4268 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4269 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4270 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 4271 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 4272 | "$G_SRV -u --mtu 4096" \ |
| 4273 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 4274 | 0 \ |
| 4275 | -c "client hello, adding renegotiation extension" \ |
| 4276 | -c "found renegotiation extension" \ |
| 4277 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4278 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 4279 | -C "error" \ |
| 4280 | -s "Extra-header:" |
| 4281 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4282 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 4283 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4284 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4285 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4286 | run_test "Renego ext: gnutls server strict, client default" \ |
| 4287 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 4288 | "$P_CLI debug_level=3" \ |
| 4289 | 0 \ |
| 4290 | -c "found renegotiation extension" \ |
| 4291 | -C "error" \ |
| 4292 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4293 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4294 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4295 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4296 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 4297 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4298 | "$P_CLI debug_level=3" \ |
| 4299 | 0 \ |
| 4300 | -C "found renegotiation extension" \ |
| 4301 | -C "error" \ |
| 4302 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4303 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4304 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4305 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4306 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 4307 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4308 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 4309 | 1 \ |
| 4310 | -C "found renegotiation extension" \ |
| 4311 | -c "error" \ |
| 4312 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4313 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4314 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4315 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4316 | run_test "Renego ext: gnutls client strict, server default" \ |
| 4317 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4318 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4319 | 0 \ |
| 4320 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4321 | -s "server hello, secure renegotiation extension" |
| 4322 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4323 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4324 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4325 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 4326 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4327 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4328 | 0 \ |
| 4329 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4330 | -S "server hello, secure renegotiation extension" |
| 4331 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4332 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4333 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4334 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 4335 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4336 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4337 | 1 \ |
| 4338 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4339 | -S "server hello, secure renegotiation extension" |
| 4340 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4341 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 4342 | |
| 4343 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4344 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4345 | run_test "DER format: no trailing bytes" \ |
| 4346 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 4347 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4348 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4349 | 0 \ |
| 4350 | -c "Handshake was completed" \ |
| 4351 | |
| 4352 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4353 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4354 | run_test "DER format: with a trailing zero byte" \ |
| 4355 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 4356 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4357 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4358 | 0 \ |
| 4359 | -c "Handshake was completed" \ |
| 4360 | |
| 4361 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4362 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4363 | run_test "DER format: with a trailing random byte" \ |
| 4364 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 4365 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4366 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4367 | 0 \ |
| 4368 | -c "Handshake was completed" \ |
| 4369 | |
| 4370 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4371 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4372 | run_test "DER format: with 2 trailing random bytes" \ |
| 4373 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 4374 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4375 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4376 | 0 \ |
| 4377 | -c "Handshake was completed" \ |
| 4378 | |
| 4379 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4380 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4381 | run_test "DER format: with 4 trailing random bytes" \ |
| 4382 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 4383 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4384 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4385 | 0 \ |
| 4386 | -c "Handshake was completed" \ |
| 4387 | |
| 4388 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4389 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4390 | run_test "DER format: with 8 trailing random bytes" \ |
| 4391 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 4392 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4393 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4394 | 0 \ |
| 4395 | -c "Handshake was completed" \ |
| 4396 | |
| 4397 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4398 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4399 | run_test "DER format: with 9 trailing random bytes" \ |
| 4400 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 4401 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4402 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4403 | 0 \ |
| 4404 | -c "Handshake was completed" \ |
| 4405 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4406 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 4407 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4408 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4409 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4410 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4411 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4412 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4413 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4414 | 1 \ |
| 4415 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4416 | -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] | 4417 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4418 | -c "X509 - Certificate verification failed" |
| 4419 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4420 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4421 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4422 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4423 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4424 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4425 | 0 \ |
| 4426 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4427 | -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] | 4428 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4429 | -C "X509 - Certificate verification failed" |
| 4430 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4431 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 4432 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 4433 | "$P_SRV" \ |
| 4434 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 4435 | 0 \ |
| 4436 | -c "x509_verify_cert() returned" \ |
| 4437 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4438 | -c "! Certificate verification flags"\ |
| 4439 | -C "! mbedtls_ssl_handshake returned" \ |
| 4440 | -C "X509 - Certificate verification failed" \ |
| 4441 | -C "SSL - No CA Chain is set, but required to operate" |
| 4442 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4443 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 4444 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 4445 | "$P_SRV" \ |
| 4446 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 4447 | 1 \ |
| 4448 | -c "x509_verify_cert() returned" \ |
| 4449 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4450 | -c "! Certificate verification flags"\ |
| 4451 | -c "! mbedtls_ssl_handshake returned" \ |
| 4452 | -c "SSL - No CA Chain is set, but required to operate" |
| 4453 | |
| 4454 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4455 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4456 | # the client informs the server about the supported curves - it does, though, in the |
| 4457 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4458 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4459 | # different means to have the server ignoring the client's supported curve list. |
| 4460 | |
| 4461 | requires_config_enabled MBEDTLS_ECP_C |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4462 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 4463 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4464 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4465 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4466 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4467 | 1 \ |
| 4468 | -c "bad certificate (EC key curve)"\ |
| 4469 | -c "! Certificate verification flags"\ |
| 4470 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4471 | |
| 4472 | requires_config_enabled MBEDTLS_ECP_C |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4473 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 4474 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4475 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4476 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4477 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4478 | 1 \ |
| 4479 | -c "bad certificate (EC key curve)"\ |
| 4480 | -c "! Certificate verification flags"\ |
| 4481 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4482 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4483 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4484 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 4485 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4486 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4487 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4488 | 0 \ |
| 4489 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4490 | -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] | 4491 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4492 | -C "X509 - Certificate verification failed" |
| 4493 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4494 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 4495 | run_test "Authentication: client SHA256, server required" \ |
| 4496 | "$P_SRV auth_mode=required" \ |
| 4497 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4498 | key_file=data_files/server6.key \ |
| 4499 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4500 | 0 \ |
| 4501 | -c "Supported Signature Algorithm found: 4," \ |
| 4502 | -c "Supported Signature Algorithm found: 5," |
| 4503 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4504 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 4505 | run_test "Authentication: client SHA384, server required" \ |
| 4506 | "$P_SRV auth_mode=required" \ |
| 4507 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4508 | key_file=data_files/server6.key \ |
| 4509 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4510 | 0 \ |
| 4511 | -c "Supported Signature Algorithm found: 4," \ |
| 4512 | -c "Supported Signature Algorithm found: 5," |
| 4513 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4514 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4515 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 4516 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4517 | "$P_CLI debug_level=3 crt_file=none \ |
| 4518 | key_file=data_files/server5.key" \ |
| 4519 | 1 \ |
| 4520 | -S "skip write certificate request" \ |
| 4521 | -C "skip parse certificate request" \ |
| 4522 | -c "got a certificate request" \ |
| 4523 | -c "= write certificate$" \ |
| 4524 | -C "skip write certificate$" \ |
| 4525 | -S "x509_verify_cert() returned" \ |
| 4526 | -s "client has no certificate" \ |
| 4527 | -s "! mbedtls_ssl_handshake returned" \ |
| 4528 | -c "! mbedtls_ssl_handshake returned" \ |
| 4529 | -s "No client certification received from the client, but required by the authentication mode" |
| 4530 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4531 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4532 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4533 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4534 | "$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] | 4535 | key_file=data_files/server5.key" \ |
| 4536 | 1 \ |
| 4537 | -S "skip write certificate request" \ |
| 4538 | -C "skip parse certificate request" \ |
| 4539 | -c "got a certificate request" \ |
| 4540 | -C "skip write certificate" \ |
| 4541 | -C "skip write certificate verify" \ |
| 4542 | -S "skip parse certificate verify" \ |
| 4543 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4544 | -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] | 4545 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4546 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4547 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4548 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4549 | # We don't check that the client receives the alert because it might |
| 4550 | # detect that its write end of the connection is closed and abort |
| 4551 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4552 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4553 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 4554 | run_test "Authentication: client cert self-signed and trusted, server required" \ |
| 4555 | "$P_SRV debug_level=3 auth_mode=required ca_file=data_files/server5-selfsigned.crt" \ |
| 4556 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4557 | key_file=data_files/server5.key" \ |
| 4558 | 0 \ |
| 4559 | -S "skip write certificate request" \ |
| 4560 | -C "skip parse certificate request" \ |
| 4561 | -c "got a certificate request" \ |
| 4562 | -C "skip write certificate" \ |
| 4563 | -C "skip write certificate verify" \ |
| 4564 | -S "skip parse certificate verify" \ |
| 4565 | -S "x509_verify_cert() returned" \ |
| 4566 | -S "! The certificate is not correctly signed" \ |
| 4567 | -S "X509 - Certificate verification failed" |
| 4568 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4569 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4570 | run_test "Authentication: client cert not trusted, server required" \ |
| 4571 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4572 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4573 | key_file=data_files/server5.key" \ |
| 4574 | 1 \ |
| 4575 | -S "skip write certificate request" \ |
| 4576 | -C "skip parse certificate request" \ |
| 4577 | -c "got a certificate request" \ |
| 4578 | -C "skip write certificate" \ |
| 4579 | -C "skip write certificate verify" \ |
| 4580 | -S "skip parse certificate verify" \ |
| 4581 | -s "x509_verify_cert() returned" \ |
| 4582 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4583 | -s "! mbedtls_ssl_handshake returned" \ |
| 4584 | -c "! mbedtls_ssl_handshake returned" \ |
| 4585 | -s "X509 - Certificate verification failed" |
| 4586 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4587 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4588 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4589 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4590 | "$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] | 4591 | key_file=data_files/server5.key" \ |
| 4592 | 0 \ |
| 4593 | -S "skip write certificate request" \ |
| 4594 | -C "skip parse certificate request" \ |
| 4595 | -c "got a certificate request" \ |
| 4596 | -C "skip write certificate" \ |
| 4597 | -C "skip write certificate verify" \ |
| 4598 | -S "skip parse certificate verify" \ |
| 4599 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4600 | -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] | 4601 | -S "! mbedtls_ssl_handshake returned" \ |
| 4602 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4603 | -S "X509 - Certificate verification failed" |
| 4604 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4605 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4606 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4607 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 4608 | "$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] | 4609 | key_file=data_files/server5.key" \ |
| 4610 | 0 \ |
| 4611 | -s "skip write certificate request" \ |
| 4612 | -C "skip parse certificate request" \ |
| 4613 | -c "got no certificate request" \ |
| 4614 | -c "skip write certificate" \ |
| 4615 | -c "skip write certificate verify" \ |
| 4616 | -s "skip parse certificate verify" \ |
| 4617 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4618 | -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] | 4619 | -S "! mbedtls_ssl_handshake returned" \ |
| 4620 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4621 | -S "X509 - Certificate verification failed" |
| 4622 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4623 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4624 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4625 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4626 | "$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] | 4627 | 0 \ |
| 4628 | -S "skip write certificate request" \ |
| 4629 | -C "skip parse certificate request" \ |
| 4630 | -c "got a certificate request" \ |
| 4631 | -C "skip write certificate$" \ |
| 4632 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4633 | -c "skip write certificate verify" \ |
| 4634 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4635 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4636 | -S "! mbedtls_ssl_handshake returned" \ |
| 4637 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4638 | -S "X509 - Certificate verification failed" |
| 4639 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4640 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4641 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4642 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4643 | "$O_CLI" \ |
| 4644 | 0 \ |
| 4645 | -S "skip write certificate request" \ |
| 4646 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4647 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4648 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4649 | -S "X509 - Certificate verification failed" |
| 4650 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4651 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4652 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4653 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4654 | "$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] | 4655 | 0 \ |
| 4656 | -C "skip parse certificate request" \ |
| 4657 | -c "got a certificate request" \ |
| 4658 | -C "skip write certificate$" \ |
| 4659 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4660 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4661 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4662 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4663 | run_test "Authentication: client no cert, openssl server required" \ |
| 4664 | "$O_SRV -Verify 10" \ |
| 4665 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 4666 | 1 \ |
| 4667 | -C "skip parse certificate request" \ |
| 4668 | -c "got a certificate request" \ |
| 4669 | -C "skip write certificate$" \ |
| 4670 | -c "skip write certificate verify" \ |
| 4671 | -c "! mbedtls_ssl_handshake returned" |
| 4672 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4673 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 4674 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 4675 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4676 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4677 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4678 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4679 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 4680 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 4681 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 4682 | # 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] | 4683 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4684 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4685 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4686 | run_test "Authentication: server max_int chain, client default" \ |
| 4687 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4688 | key_file=data_files/dir-maxpath/09.key" \ |
| 4689 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4690 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4691 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4692 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4693 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4694 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4695 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4696 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 4697 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4698 | key_file=data_files/dir-maxpath/10.key" \ |
| 4699 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4700 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4701 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4702 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4703 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4704 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4705 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4706 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 4707 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4708 | key_file=data_files/dir-maxpath/10.key" \ |
| 4709 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4710 | auth_mode=optional" \ |
| 4711 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4712 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4713 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4714 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4715 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4716 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4717 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 4718 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4719 | key_file=data_files/dir-maxpath/10.key" \ |
| 4720 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4721 | auth_mode=none" \ |
| 4722 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4723 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4724 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4725 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4726 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4727 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4728 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 4729 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 4730 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4731 | key_file=data_files/dir-maxpath/10.key" \ |
| 4732 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4733 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4734 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4735 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4736 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4737 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4738 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 4739 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4740 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4741 | key_file=data_files/dir-maxpath/10.key" \ |
| 4742 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4743 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4744 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4745 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4746 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4747 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4748 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 4749 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4750 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4751 | key_file=data_files/dir-maxpath/10.key" \ |
| 4752 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4753 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4754 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4755 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4756 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4757 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4758 | run_test "Authentication: client max_int chain, server required" \ |
| 4759 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4760 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4761 | key_file=data_files/dir-maxpath/09.key" \ |
| 4762 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4763 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4764 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4765 | # Tests for CA list in CertificateRequest messages |
| 4766 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4767 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4768 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 4769 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4770 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4771 | key_file=data_files/server6.key" \ |
| 4772 | 0 \ |
| 4773 | -s "requested DN" |
| 4774 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4775 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4776 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 4777 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4778 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4779 | key_file=data_files/server6.key" \ |
| 4780 | 0 \ |
| 4781 | -S "requested DN" |
| 4782 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4783 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4784 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 4785 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4786 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4787 | key_file=data_files/server5.key" \ |
| 4788 | 1 \ |
| 4789 | -S "requested DN" \ |
| 4790 | -s "x509_verify_cert() returned" \ |
| 4791 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4792 | -s "! mbedtls_ssl_handshake returned" \ |
| 4793 | -c "! mbedtls_ssl_handshake returned" \ |
| 4794 | -s "X509 - Certificate verification failed" |
| 4795 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4796 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 4797 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4798 | |
| 4799 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4800 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4801 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 4802 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4803 | key_file=data_files/server5.key" \ |
| 4804 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4805 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4806 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4807 | -c "x509_verify_cert() returned" \ |
| 4808 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4809 | -c "! mbedtls_ssl_handshake returned" \ |
| 4810 | -c "X509 - Certificate verification failed" |
| 4811 | |
| 4812 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4813 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4814 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 4815 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4816 | key_file=data_files/server5.key" \ |
| 4817 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4818 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4819 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4820 | -c "x509_verify_cert() returned" \ |
| 4821 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4822 | -C "! mbedtls_ssl_handshake returned" \ |
| 4823 | -C "X509 - Certificate verification failed" |
| 4824 | |
| 4825 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4826 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4827 | # the client informs the server about the supported curves - it does, though, in the |
| 4828 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4829 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4830 | # different means to have the server ignoring the client's supported curve list. |
| 4831 | |
| 4832 | requires_config_enabled MBEDTLS_ECP_C |
| 4833 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4834 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4835 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4836 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4837 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4838 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4839 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4840 | -c "use CA callback for X.509 CRT verification" \ |
| 4841 | -c "bad certificate (EC key curve)" \ |
| 4842 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4843 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4844 | |
| 4845 | requires_config_enabled MBEDTLS_ECP_C |
| 4846 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4847 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4848 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4849 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4850 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4851 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4852 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4853 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4854 | -c "bad certificate (EC key curve)"\ |
| 4855 | -c "! Certificate verification flags"\ |
| 4856 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4857 | |
| 4858 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4859 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4860 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 4861 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4862 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4863 | key_file=data_files/server6.key \ |
| 4864 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4865 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4866 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4867 | -c "Supported Signature Algorithm found: 4," \ |
| 4868 | -c "Supported Signature Algorithm found: 5," |
| 4869 | |
| 4870 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4871 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4872 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 4873 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4874 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4875 | key_file=data_files/server6.key \ |
| 4876 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4877 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4878 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4879 | -c "Supported Signature Algorithm found: 4," \ |
| 4880 | -c "Supported Signature Algorithm found: 5," |
| 4881 | |
| 4882 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4883 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4884 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 4885 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4886 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4887 | key_file=data_files/server5.key" \ |
| 4888 | 1 \ |
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 | -S "skip write certificate request" \ |
| 4891 | -C "skip parse certificate request" \ |
| 4892 | -c "got a certificate request" \ |
| 4893 | -C "skip write certificate" \ |
| 4894 | -C "skip write certificate verify" \ |
| 4895 | -S "skip parse certificate verify" \ |
| 4896 | -s "x509_verify_cert() returned" \ |
| 4897 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4898 | -s "! mbedtls_ssl_handshake returned" \ |
| 4899 | -s "send alert level=2 message=48" \ |
| 4900 | -c "! mbedtls_ssl_handshake returned" \ |
| 4901 | -s "X509 - Certificate verification failed" |
| 4902 | # We don't check that the client receives the alert because it might |
| 4903 | # detect that its write end of the connection is closed and abort |
| 4904 | # before reading the alert message. |
| 4905 | |
| 4906 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4907 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4908 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 4909 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4910 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4911 | key_file=data_files/server5.key" \ |
| 4912 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4913 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4914 | -S "skip write certificate request" \ |
| 4915 | -C "skip parse certificate request" \ |
| 4916 | -c "got a certificate request" \ |
| 4917 | -C "skip write certificate" \ |
| 4918 | -C "skip write certificate verify" \ |
| 4919 | -S "skip parse certificate verify" \ |
| 4920 | -s "x509_verify_cert() returned" \ |
| 4921 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4922 | -s "! mbedtls_ssl_handshake returned" \ |
| 4923 | -c "! mbedtls_ssl_handshake returned" \ |
| 4924 | -s "X509 - Certificate verification failed" |
| 4925 | |
| 4926 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4927 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4928 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 4929 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4930 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4931 | key_file=data_files/server5.key" \ |
| 4932 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4933 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4934 | -S "skip write certificate request" \ |
| 4935 | -C "skip parse certificate request" \ |
| 4936 | -c "got a certificate request" \ |
| 4937 | -C "skip write certificate" \ |
| 4938 | -C "skip write certificate verify" \ |
| 4939 | -S "skip parse certificate verify" \ |
| 4940 | -s "x509_verify_cert() returned" \ |
| 4941 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4942 | -S "! mbedtls_ssl_handshake returned" \ |
| 4943 | -C "! mbedtls_ssl_handshake returned" \ |
| 4944 | -S "X509 - Certificate verification failed" |
| 4945 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4946 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4947 | requires_full_size_output_buffer |
| 4948 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4949 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4950 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 4951 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4952 | key_file=data_files/dir-maxpath/09.key" \ |
| 4953 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4954 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4955 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4956 | -C "X509 - A fatal error occurred" |
| 4957 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4958 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4959 | requires_full_size_output_buffer |
| 4960 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4961 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4962 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 4963 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4964 | key_file=data_files/dir-maxpath/10.key" \ |
| 4965 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4966 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4967 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4968 | -c "X509 - A fatal error occurred" |
| 4969 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4970 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4971 | requires_full_size_output_buffer |
| 4972 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4973 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4974 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 4975 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4976 | key_file=data_files/dir-maxpath/10.key" \ |
| 4977 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4978 | debug_level=3 auth_mode=optional" \ |
| 4979 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4980 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4981 | -c "X509 - A fatal error occurred" |
| 4982 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4983 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4984 | requires_full_size_output_buffer |
| 4985 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4986 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4987 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 4988 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4989 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4990 | key_file=data_files/dir-maxpath/10.key" \ |
| 4991 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4992 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4993 | -s "X509 - A fatal error occurred" |
| 4994 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4995 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4996 | requires_full_size_output_buffer |
| 4997 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4998 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4999 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 5000 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5001 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5002 | key_file=data_files/dir-maxpath/10.key" \ |
| 5003 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5004 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5005 | -s "X509 - A fatal error occurred" |
| 5006 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5007 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5008 | requires_full_size_output_buffer |
| 5009 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5010 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5011 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 5012 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5013 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 5014 | key_file=data_files/dir-maxpath/09.key" \ |
| 5015 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5016 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5017 | -S "X509 - A fatal error occurred" |
| 5018 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5019 | # Tests for certificate selection based on SHA verson |
| 5020 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5021 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5022 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5023 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 5024 | "$P_SRV crt_file=data_files/server5.crt \ |
| 5025 | key_file=data_files/server5.key \ |
| 5026 | crt_file2=data_files/server5-sha1.crt \ |
| 5027 | key_file2=data_files/server5.key" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5028 | "$P_CLI force_version=tls12" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5029 | 0 \ |
| 5030 | -c "signed using.*ECDSA with SHA256" \ |
| 5031 | -C "signed using.*ECDSA with SHA1" |
| 5032 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5033 | # tests for SNI |
| 5034 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5035 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5036 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5037 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5038 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5039 | 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] | 5040 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5041 | 0 \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5042 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 5043 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5044 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5045 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5046 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5047 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5048 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5049 | 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] | 5050 | 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] | 5051 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5052 | 0 \ |
| 5053 | -s "parse ServerName extension" \ |
| 5054 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5055 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5056 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5057 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5058 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5059 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5060 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5061 | 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] | 5062 | 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] | 5063 | "$P_CLI server_name=polarssl.example" \ |
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 CA" \ |
| 5067 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
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: no matching cert" \ |
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=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5076 | 1 \ |
| 5077 | -s "parse ServerName extension" \ |
| 5078 | -s "ssl_sni_wrapper() returned" \ |
| 5079 | -s "mbedtls_ssl_handshake returned" \ |
| 5080 | -c "mbedtls_ssl_handshake returned" \ |
| 5081 | -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] | 5082 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5083 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5084 | run_test "SNI: client auth no override: optional" \ |
| 5085 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5086 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5087 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 5088 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5089 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5090 | -S "skip write certificate request" \ |
| 5091 | -C "skip parse certificate request" \ |
| 5092 | -c "got a certificate request" \ |
| 5093 | -C "skip write certificate" \ |
| 5094 | -C "skip write certificate verify" \ |
| 5095 | -S "skip parse certificate verify" |
| 5096 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5097 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5098 | run_test "SNI: client auth override: none -> optional" \ |
| 5099 | "$P_SRV debug_level=3 auth_mode=none \ |
| 5100 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5101 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 5102 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5103 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5104 | -S "skip write certificate request" \ |
| 5105 | -C "skip parse certificate request" \ |
| 5106 | -c "got a certificate request" \ |
| 5107 | -C "skip write certificate" \ |
| 5108 | -C "skip write certificate verify" \ |
| 5109 | -S "skip parse certificate verify" |
| 5110 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5111 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5112 | run_test "SNI: client auth override: optional -> none" \ |
| 5113 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5114 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5115 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 5116 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5117 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5118 | -s "skip write certificate request" \ |
| 5119 | -C "skip parse certificate request" \ |
| 5120 | -c "got no certificate request" \ |
| 5121 | -c "skip write certificate" \ |
| 5122 | -c "skip write certificate verify" \ |
| 5123 | -s "skip parse certificate verify" |
| 5124 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5125 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5126 | run_test "SNI: CA no override" \ |
| 5127 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5128 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5129 | ca_file=data_files/test-ca.crt \ |
| 5130 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 5131 | "$P_CLI debug_level=3 server_name=localhost \ |
| 5132 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5133 | 1 \ |
| 5134 | -S "skip write certificate request" \ |
| 5135 | -C "skip parse certificate request" \ |
| 5136 | -c "got a certificate request" \ |
| 5137 | -C "skip write certificate" \ |
| 5138 | -C "skip write certificate verify" \ |
| 5139 | -S "skip parse certificate verify" \ |
| 5140 | -s "x509_verify_cert() returned" \ |
| 5141 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5142 | -S "The certificate has been revoked (is on a CRL)" |
| 5143 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5144 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5145 | run_test "SNI: CA override" \ |
| 5146 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5147 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5148 | ca_file=data_files/test-ca.crt \ |
| 5149 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 5150 | "$P_CLI debug_level=3 server_name=localhost \ |
| 5151 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5152 | 0 \ |
| 5153 | -S "skip write certificate request" \ |
| 5154 | -C "skip parse certificate request" \ |
| 5155 | -c "got a certificate request" \ |
| 5156 | -C "skip write certificate" \ |
| 5157 | -C "skip write certificate verify" \ |
| 5158 | -S "skip parse certificate verify" \ |
| 5159 | -S "x509_verify_cert() returned" \ |
| 5160 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5161 | -S "The certificate has been revoked (is on a CRL)" |
| 5162 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5163 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5164 | run_test "SNI: CA override with CRL" \ |
| 5165 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5166 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5167 | ca_file=data_files/test-ca.crt \ |
| 5168 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 5169 | "$P_CLI debug_level=3 server_name=localhost \ |
| 5170 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5171 | 1 \ |
| 5172 | -S "skip write certificate request" \ |
| 5173 | -C "skip parse certificate request" \ |
| 5174 | -c "got a certificate request" \ |
| 5175 | -C "skip write certificate" \ |
| 5176 | -C "skip write certificate verify" \ |
| 5177 | -S "skip parse certificate verify" \ |
| 5178 | -s "x509_verify_cert() returned" \ |
| 5179 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5180 | -s "The certificate has been revoked (is on a CRL)" |
| 5181 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5182 | # Tests for SNI and DTLS |
| 5183 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5184 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5185 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5186 | run_test "SNI: DTLS, no SNI callback" \ |
| 5187 | "$P_SRV debug_level=3 dtls=1 \ |
| 5188 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 5189 | "$P_CLI server_name=localhost dtls=1" \ |
| 5190 | 0 \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5191 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 5192 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 5193 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5194 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5195 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5196 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5197 | "$P_SRV debug_level=3 dtls=1 \ |
| 5198 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5199 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5200 | "$P_CLI server_name=localhost dtls=1" \ |
| 5201 | 0 \ |
| 5202 | -s "parse ServerName extension" \ |
| 5203 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5204 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 5205 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5206 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5207 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5208 | run_test "SNI: DTLS, matching cert 2" \ |
| 5209 | "$P_SRV debug_level=3 dtls=1 \ |
| 5210 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5211 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5212 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 5213 | 0 \ |
| 5214 | -s "parse ServerName extension" \ |
| 5215 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5216 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 5217 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5218 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5219 | run_test "SNI: DTLS, no matching cert" \ |
| 5220 | "$P_SRV debug_level=3 dtls=1 \ |
| 5221 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5222 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5223 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 5224 | 1 \ |
| 5225 | -s "parse ServerName extension" \ |
| 5226 | -s "ssl_sni_wrapper() returned" \ |
| 5227 | -s "mbedtls_ssl_handshake returned" \ |
| 5228 | -c "mbedtls_ssl_handshake returned" \ |
| 5229 | -c "SSL - A fatal alert message was received from our peer" |
| 5230 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5231 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5232 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 5233 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5234 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5235 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 5236 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5237 | 0 \ |
| 5238 | -S "skip write certificate request" \ |
| 5239 | -C "skip parse certificate request" \ |
| 5240 | -c "got a certificate request" \ |
| 5241 | -C "skip write certificate" \ |
| 5242 | -C "skip write certificate verify" \ |
| 5243 | -S "skip parse certificate verify" |
| 5244 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5245 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5246 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 5247 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 5248 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5249 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 5250 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5251 | 0 \ |
| 5252 | -S "skip write certificate request" \ |
| 5253 | -C "skip parse certificate request" \ |
| 5254 | -c "got a certificate request" \ |
| 5255 | -C "skip write certificate" \ |
| 5256 | -C "skip write certificate verify" \ |
| 5257 | -S "skip parse certificate verify" |
| 5258 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5259 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5260 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 5261 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5262 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5263 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 5264 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5265 | 0 \ |
| 5266 | -s "skip write certificate request" \ |
| 5267 | -C "skip parse certificate request" \ |
| 5268 | -c "got no certificate request" \ |
| 5269 | -c "skip write certificate" \ |
| 5270 | -c "skip write certificate verify" \ |
| 5271 | -s "skip parse certificate verify" |
| 5272 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5273 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5274 | run_test "SNI: DTLS, CA no override" \ |
| 5275 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5276 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5277 | ca_file=data_files/test-ca.crt \ |
| 5278 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 5279 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5280 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5281 | 1 \ |
| 5282 | -S "skip write certificate request" \ |
| 5283 | -C "skip parse certificate request" \ |
| 5284 | -c "got a certificate request" \ |
| 5285 | -C "skip write certificate" \ |
| 5286 | -C "skip write certificate verify" \ |
| 5287 | -S "skip parse certificate verify" \ |
| 5288 | -s "x509_verify_cert() returned" \ |
| 5289 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5290 | -S "The certificate has been revoked (is on a CRL)" |
| 5291 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5292 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5293 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5294 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5295 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5296 | ca_file=data_files/test-ca.crt \ |
| 5297 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 5298 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5299 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5300 | 0 \ |
| 5301 | -S "skip write certificate request" \ |
| 5302 | -C "skip parse certificate request" \ |
| 5303 | -c "got a certificate request" \ |
| 5304 | -C "skip write certificate" \ |
| 5305 | -C "skip write certificate verify" \ |
| 5306 | -S "skip parse certificate verify" \ |
| 5307 | -S "x509_verify_cert() returned" \ |
| 5308 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5309 | -S "The certificate has been revoked (is on a CRL)" |
| 5310 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5311 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5312 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5313 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5314 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 5315 | ca_file=data_files/test-ca.crt \ |
| 5316 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 5317 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5318 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5319 | 1 \ |
| 5320 | -S "skip write certificate request" \ |
| 5321 | -C "skip parse certificate request" \ |
| 5322 | -c "got a certificate request" \ |
| 5323 | -C "skip write certificate" \ |
| 5324 | -C "skip write certificate verify" \ |
| 5325 | -S "skip parse certificate verify" \ |
| 5326 | -s "x509_verify_cert() returned" \ |
| 5327 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5328 | -s "The certificate has been revoked (is on a CRL)" |
| 5329 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5330 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 5331 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5332 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5333 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5334 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 5335 | "$P_CLI nbio=2 tickets=0" \ |
| 5336 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5337 | -S "mbedtls_ssl_handshake returned" \ |
| 5338 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5339 | -c "Read from server: .* bytes read" |
| 5340 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5341 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5342 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5343 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 5344 | "$P_CLI nbio=2 tickets=0" \ |
| 5345 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5346 | -S "mbedtls_ssl_handshake returned" \ |
| 5347 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5348 | -c "Read from server: .* bytes read" |
| 5349 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5350 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5351 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5352 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 5353 | "$P_CLI nbio=2 tickets=1" \ |
| 5354 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5355 | -S "mbedtls_ssl_handshake returned" \ |
| 5356 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5357 | -c "Read from server: .* bytes read" |
| 5358 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5359 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5360 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5361 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 5362 | "$P_CLI nbio=2 tickets=1" \ |
| 5363 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5364 | -S "mbedtls_ssl_handshake returned" \ |
| 5365 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5366 | -c "Read from server: .* bytes read" |
| 5367 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5368 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5369 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5370 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 5371 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 5372 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5373 | -S "mbedtls_ssl_handshake returned" \ |
| 5374 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5375 | -c "Read from server: .* bytes read" |
| 5376 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5377 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5378 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5379 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 5380 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 5381 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5382 | -S "mbedtls_ssl_handshake returned" \ |
| 5383 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5384 | -c "Read from server: .* bytes read" |
| 5385 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5386 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5387 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5388 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 5389 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 5390 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5391 | -S "mbedtls_ssl_handshake returned" \ |
| 5392 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5393 | -c "Read from server: .* bytes read" |
| 5394 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5395 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 5396 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5397 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5398 | run_test "Event-driven I/O: basic handshake" \ |
| 5399 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 5400 | "$P_CLI event=1 tickets=0" \ |
| 5401 | 0 \ |
| 5402 | -S "mbedtls_ssl_handshake returned" \ |
| 5403 | -C "mbedtls_ssl_handshake returned" \ |
| 5404 | -c "Read from server: .* bytes read" |
| 5405 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5406 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5407 | run_test "Event-driven I/O: client auth" \ |
| 5408 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 5409 | "$P_CLI event=1 tickets=0" \ |
| 5410 | 0 \ |
| 5411 | -S "mbedtls_ssl_handshake returned" \ |
| 5412 | -C "mbedtls_ssl_handshake returned" \ |
| 5413 | -c "Read from server: .* bytes read" |
| 5414 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5415 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5416 | run_test "Event-driven I/O: ticket" \ |
| 5417 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 5418 | "$P_CLI event=1 tickets=1" \ |
| 5419 | 0 \ |
| 5420 | -S "mbedtls_ssl_handshake returned" \ |
| 5421 | -C "mbedtls_ssl_handshake returned" \ |
| 5422 | -c "Read from server: .* bytes read" |
| 5423 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5424 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5425 | run_test "Event-driven I/O: ticket + client auth" \ |
| 5426 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 5427 | "$P_CLI event=1 tickets=1" \ |
| 5428 | 0 \ |
| 5429 | -S "mbedtls_ssl_handshake returned" \ |
| 5430 | -C "mbedtls_ssl_handshake returned" \ |
| 5431 | -c "Read from server: .* bytes read" |
| 5432 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5433 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5434 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 5435 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 5436 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 5437 | 0 \ |
| 5438 | -S "mbedtls_ssl_handshake returned" \ |
| 5439 | -C "mbedtls_ssl_handshake returned" \ |
| 5440 | -c "Read from server: .* bytes read" |
| 5441 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5442 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5443 | run_test "Event-driven I/O: ticket + resume" \ |
| 5444 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 5445 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 5446 | 0 \ |
| 5447 | -S "mbedtls_ssl_handshake returned" \ |
| 5448 | -C "mbedtls_ssl_handshake returned" \ |
| 5449 | -c "Read from server: .* bytes read" |
| 5450 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5451 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5452 | run_test "Event-driven I/O: session-id resume" \ |
| 5453 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 5454 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 5455 | 0 \ |
| 5456 | -S "mbedtls_ssl_handshake returned" \ |
| 5457 | -C "mbedtls_ssl_handshake returned" \ |
| 5458 | -c "Read from server: .* bytes read" |
| 5459 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5460 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5461 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 5462 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 5463 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 5464 | 0 \ |
| 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 | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5468 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 5469 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 5470 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 5471 | 0 \ |
| 5472 | -c "Read from server: .* bytes read" |
| 5473 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5474 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5475 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 5476 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 5477 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 5478 | 0 \ |
| 5479 | -c "Read from server: .* bytes read" |
| 5480 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5481 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5482 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 5483 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 5484 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 5485 | 0 \ |
| 5486 | -c "Read from server: .* bytes read" |
| 5487 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5488 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5489 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 5490 | "$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] | 5491 | "$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] | 5492 | 0 \ |
| 5493 | -c "Read from server: .* bytes read" |
| 5494 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5495 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5496 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 5497 | "$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] | 5498 | "$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] | 5499 | 0 \ |
| 5500 | -c "Read from server: .* bytes read" |
| 5501 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5502 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5503 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 5504 | "$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] | 5505 | "$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] | 5506 | 0 \ |
| 5507 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5508 | |
| 5509 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 5510 | # During session resumption, the client will send its ApplicationData record |
| 5511 | # within the same datagram as the Finished messages. In this situation, the |
| 5512 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 5513 | # because the ApplicationData request has already been queued internally. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5514 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5515 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 5516 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5517 | "$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] | 5518 | "$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] | 5519 | 0 \ |
| 5520 | -c "Read from server: .* bytes read" |
| 5521 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5522 | # Tests for version negotiation |
| 5523 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5524 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5525 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5526 | "$P_SRV" \ |
| 5527 | "$P_CLI" \ |
| 5528 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5529 | -S "mbedtls_ssl_handshake returned" \ |
| 5530 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5531 | -s "Protocol is TLSv1.2" \ |
| 5532 | -c "Protocol is TLSv1.2" |
| 5533 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5534 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 5535 | run_test "Not supported version check: cli TLS 1.0" \ |
| 5536 | "$P_SRV" \ |
| 5537 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 5538 | 1 \ |
| 5539 | -s "Handshake protocol not within min/max boundaries" \ |
| 5540 | -c "Error in protocol version" \ |
| 5541 | -S "Protocol is TLSv1.0" \ |
| 5542 | -C "Handshake was completed" |
| 5543 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5544 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 5545 | run_test "Not supported version check: cli TLS 1.1" \ |
| 5546 | "$P_SRV" \ |
| 5547 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 5548 | 1 \ |
| 5549 | -s "Handshake protocol not within min/max boundaries" \ |
| 5550 | -c "Error in protocol version" \ |
| 5551 | -S "Protocol is TLSv1.1" \ |
| 5552 | -C "Handshake was completed" |
| 5553 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5554 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 5555 | run_test "Not supported version check: srv max TLS 1.0" \ |
| 5556 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 5557 | "$P_CLI" \ |
| 5558 | 1 \ |
| 5559 | -s "Error in protocol version" \ |
| 5560 | -c "Handshake protocol not within min/max boundaries" \ |
| 5561 | -S "Version: TLS1.0" \ |
| 5562 | -C "Protocol is TLSv1.0" |
| 5563 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5564 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 5565 | run_test "Not supported version check: srv max TLS 1.1" \ |
| 5566 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 5567 | "$P_CLI" \ |
| 5568 | 1 \ |
| 5569 | -s "Error in protocol version" \ |
| 5570 | -c "Handshake protocol not within min/max boundaries" \ |
| 5571 | -S "Version: TLS1.1" \ |
| 5572 | -C "Protocol is TLSv1.1" |
| 5573 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5574 | # Tests for ALPN extension |
| 5575 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5576 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5577 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5578 | "$P_SRV debug_level=3" \ |
| 5579 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5580 | 0 \ |
| 5581 | -C "client hello, adding alpn extension" \ |
| 5582 | -S "found alpn extension" \ |
| 5583 | -C "got an alert message, type: \\[2:120]" \ |
| 5584 | -S "server hello, adding alpn extension" \ |
| 5585 | -C "found alpn extension " \ |
| 5586 | -C "Application Layer Protocol is" \ |
| 5587 | -S "Application Layer Protocol is" |
| 5588 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5589 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5590 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5591 | "$P_SRV debug_level=3" \ |
| 5592 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5593 | 0 \ |
| 5594 | -c "client hello, adding alpn extension" \ |
| 5595 | -s "found alpn extension" \ |
| 5596 | -C "got an alert message, type: \\[2:120]" \ |
| 5597 | -S "server hello, adding alpn extension" \ |
| 5598 | -C "found alpn extension " \ |
| 5599 | -c "Application Layer Protocol is (none)" \ |
| 5600 | -S "Application Layer Protocol is" |
| 5601 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5602 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5603 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5604 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5605 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5606 | 0 \ |
| 5607 | -C "client hello, adding alpn extension" \ |
| 5608 | -S "found alpn extension" \ |
| 5609 | -C "got an alert message, type: \\[2:120]" \ |
| 5610 | -S "server hello, adding alpn extension" \ |
| 5611 | -C "found alpn extension " \ |
| 5612 | -C "Application Layer Protocol is" \ |
| 5613 | -s "Application Layer Protocol is (none)" |
| 5614 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5615 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5616 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5617 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5618 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5619 | 0 \ |
| 5620 | -c "client hello, adding alpn extension" \ |
| 5621 | -s "found alpn extension" \ |
| 5622 | -C "got an alert message, type: \\[2:120]" \ |
| 5623 | -s "server hello, adding alpn extension" \ |
| 5624 | -c "found alpn extension" \ |
| 5625 | -c "Application Layer Protocol is abc" \ |
| 5626 | -s "Application Layer Protocol is abc" |
| 5627 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5628 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5629 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5630 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5631 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5632 | 0 \ |
| 5633 | -c "client hello, adding alpn extension" \ |
| 5634 | -s "found alpn extension" \ |
| 5635 | -C "got an alert message, type: \\[2:120]" \ |
| 5636 | -s "server hello, adding alpn extension" \ |
| 5637 | -c "found alpn extension" \ |
| 5638 | -c "Application Layer Protocol is abc" \ |
| 5639 | -s "Application Layer Protocol is abc" |
| 5640 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5641 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5642 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5643 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5644 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5645 | 0 \ |
| 5646 | -c "client hello, adding alpn extension" \ |
| 5647 | -s "found alpn extension" \ |
| 5648 | -C "got an alert message, type: \\[2:120]" \ |
| 5649 | -s "server hello, adding alpn extension" \ |
| 5650 | -c "found alpn extension" \ |
| 5651 | -c "Application Layer Protocol is 1234" \ |
| 5652 | -s "Application Layer Protocol is 1234" |
| 5653 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5654 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5655 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5656 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 5657 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5658 | 1 \ |
| 5659 | -c "client hello, adding alpn extension" \ |
| 5660 | -s "found alpn extension" \ |
| 5661 | -c "got an alert message, type: \\[2:120]" \ |
| 5662 | -S "server hello, adding alpn extension" \ |
| 5663 | -C "found alpn extension" \ |
| 5664 | -C "Application Layer Protocol is 1234" \ |
| 5665 | -S "Application Layer Protocol is 1234" |
| 5666 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 5667 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5668 | # Tests for keyUsage in leaf certificates, part 1: |
| 5669 | # server-side certificate/suite selection |
| 5670 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5671 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5672 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5673 | "$P_SRV key_file=data_files/server2.key \ |
| 5674 | crt_file=data_files/server2.ku-ds.crt" \ |
| 5675 | "$P_CLI" \ |
| 5676 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 5677 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5678 | |
| 5679 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5680 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5681 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5682 | "$P_SRV key_file=data_files/server2.key \ |
| 5683 | crt_file=data_files/server2.ku-ke.crt" \ |
| 5684 | "$P_CLI" \ |
| 5685 | 0 \ |
| 5686 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 5687 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5688 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5689 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5690 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5691 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5692 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5693 | 1 \ |
| 5694 | -C "Ciphersuite is " |
| 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: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5698 | "$P_SRV key_file=data_files/server5.key \ |
| 5699 | crt_file=data_files/server5.ku-ds.crt" \ |
| 5700 | "$P_CLI" \ |
| 5701 | 0 \ |
| 5702 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 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: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5707 | "$P_SRV key_file=data_files/server5.key \ |
| 5708 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5709 | "$P_CLI" \ |
| 5710 | 0 \ |
| 5711 | -c "Ciphersuite is TLS-ECDH-" |
| 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: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5715 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5716 | crt_file=data_files/server5.ku-ke.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 | |
| 5721 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5722 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5723 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5724 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5725 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5726 | "$O_SRV -key data_files/server2.key \ |
| 5727 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5728 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5729 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5730 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5731 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5732 | -C "Processing of the Certificate handshake message failed" \ |
| 5733 | -c "Ciphersuite is TLS-" |
| 5734 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5735 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5736 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5737 | "$O_SRV -key data_files/server2.key \ |
| 5738 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5739 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5740 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5741 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5742 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5743 | -C "Processing of the Certificate handshake message failed" \ |
| 5744 | -c "Ciphersuite is TLS-" |
| 5745 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5746 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5747 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5748 | "$O_SRV -key data_files/server2.key \ |
| 5749 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5750 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5751 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5752 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5753 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5754 | -C "Processing of the Certificate handshake message failed" \ |
| 5755 | -c "Ciphersuite is TLS-" |
| 5756 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5757 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5758 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5759 | "$O_SRV -key data_files/server2.key \ |
| 5760 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5761 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5762 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5763 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5764 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5765 | -c "Processing of the Certificate handshake message failed" \ |
| 5766 | -C "Ciphersuite is TLS-" |
| 5767 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5768 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5769 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 5770 | "$O_SRV -key data_files/server2.key \ |
| 5771 | -cert data_files/server2.ku-ke.crt" \ |
| 5772 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5773 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5774 | 0 \ |
| 5775 | -c "bad certificate (usage extensions)" \ |
| 5776 | -C "Processing of the Certificate handshake message failed" \ |
| 5777 | -c "Ciphersuite is TLS-" \ |
| 5778 | -c "! Usage does not match the keyUsage extension" |
| 5779 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5780 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5781 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5782 | "$O_SRV -key data_files/server2.key \ |
| 5783 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5784 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5785 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5786 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5787 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5788 | -C "Processing of the Certificate handshake message failed" \ |
| 5789 | -c "Ciphersuite is TLS-" |
| 5790 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5791 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5792 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5793 | "$O_SRV -key data_files/server2.key \ |
| 5794 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5795 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5796 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5797 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5798 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5799 | -c "Processing of the Certificate handshake message failed" \ |
| 5800 | -C "Ciphersuite is TLS-" |
| 5801 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5802 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5803 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 5804 | "$O_SRV -key data_files/server2.key \ |
| 5805 | -cert data_files/server2.ku-ds.crt" \ |
| 5806 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5807 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5808 | 0 \ |
| 5809 | -c "bad certificate (usage extensions)" \ |
| 5810 | -C "Processing of the Certificate handshake message failed" \ |
| 5811 | -c "Ciphersuite is TLS-" \ |
| 5812 | -c "! Usage does not match the keyUsage extension" |
| 5813 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5814 | # Tests for keyUsage in leaf certificates, part 3: |
| 5815 | # server-side checking of client cert |
| 5816 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5817 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5818 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5819 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5820 | "$O_CLI -key data_files/server2.key \ |
| 5821 | -cert data_files/server2.ku-ds.crt" \ |
| 5822 | 0 \ |
| 5823 | -S "bad certificate (usage extensions)" \ |
| 5824 | -S "Processing of the Certificate handshake message failed" |
| 5825 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5826 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5827 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5828 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5829 | "$O_CLI -key data_files/server2.key \ |
| 5830 | -cert data_files/server2.ku-ke.crt" \ |
| 5831 | 0 \ |
| 5832 | -s "bad certificate (usage extensions)" \ |
| 5833 | -S "Processing of the Certificate handshake message failed" |
| 5834 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5835 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5836 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5837 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5838 | "$O_CLI -key data_files/server2.key \ |
| 5839 | -cert data_files/server2.ku-ke.crt" \ |
| 5840 | 1 \ |
| 5841 | -s "bad certificate (usage extensions)" \ |
| 5842 | -s "Processing of the Certificate handshake message failed" |
| 5843 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5844 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5845 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5846 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5847 | "$O_CLI -key data_files/server5.key \ |
| 5848 | -cert data_files/server5.ku-ds.crt" \ |
| 5849 | 0 \ |
| 5850 | -S "bad certificate (usage extensions)" \ |
| 5851 | -S "Processing of the Certificate handshake message failed" |
| 5852 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5853 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5854 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5855 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5856 | "$O_CLI -key data_files/server5.key \ |
| 5857 | -cert data_files/server5.ku-ka.crt" \ |
| 5858 | 0 \ |
| 5859 | -s "bad certificate (usage extensions)" \ |
| 5860 | -S "Processing of the Certificate handshake message failed" |
| 5861 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5862 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 5863 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5864 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5865 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5866 | "$P_SRV key_file=data_files/server5.key \ |
| 5867 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5868 | "$P_CLI" \ |
| 5869 | 0 |
| 5870 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5871 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5872 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5873 | "$P_SRV key_file=data_files/server5.key \ |
| 5874 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5875 | "$P_CLI" \ |
| 5876 | 0 |
| 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 "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5880 | "$P_SRV key_file=data_files/server5.key \ |
| 5881 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 5882 | "$P_CLI" \ |
| 5883 | 0 |
| 5884 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5885 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5886 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5887 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5888 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5889 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5890 | 1 |
| 5891 | |
| 5892 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 5893 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5894 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5895 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5896 | "$O_SRV -key data_files/server5.key \ |
| 5897 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5898 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5899 | 0 \ |
| 5900 | -C "bad certificate (usage extensions)" \ |
| 5901 | -C "Processing of the Certificate handshake message failed" \ |
| 5902 | -c "Ciphersuite is TLS-" |
| 5903 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5904 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5905 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5906 | "$O_SRV -key data_files/server5.key \ |
| 5907 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5908 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5909 | 0 \ |
| 5910 | -C "bad certificate (usage extensions)" \ |
| 5911 | -C "Processing of the Certificate handshake message failed" \ |
| 5912 | -c "Ciphersuite is TLS-" |
| 5913 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5914 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5915 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5916 | "$O_SRV -key data_files/server5.key \ |
| 5917 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5918 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5919 | 0 \ |
| 5920 | -C "bad certificate (usage extensions)" \ |
| 5921 | -C "Processing of the Certificate handshake message failed" \ |
| 5922 | -c "Ciphersuite is TLS-" |
| 5923 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5924 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5925 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5926 | "$O_SRV -key data_files/server5.key \ |
| 5927 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5928 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5929 | 1 \ |
| 5930 | -c "bad certificate (usage extensions)" \ |
| 5931 | -c "Processing of the Certificate handshake message failed" \ |
| 5932 | -C "Ciphersuite is TLS-" |
| 5933 | |
| 5934 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 5935 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5936 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5937 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5938 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5939 | "$O_CLI -key data_files/server5.key \ |
| 5940 | -cert data_files/server5.eku-cli.crt" \ |
| 5941 | 0 \ |
| 5942 | -S "bad certificate (usage extensions)" \ |
| 5943 | -S "Processing of the Certificate handshake message failed" |
| 5944 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5945 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5946 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5947 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5948 | "$O_CLI -key data_files/server5.key \ |
| 5949 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 5950 | 0 \ |
| 5951 | -S "bad certificate (usage extensions)" \ |
| 5952 | -S "Processing of the Certificate handshake message failed" |
| 5953 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5954 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5955 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5956 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5957 | "$O_CLI -key data_files/server5.key \ |
| 5958 | -cert data_files/server5.eku-cs_any.crt" \ |
| 5959 | 0 \ |
| 5960 | -S "bad certificate (usage extensions)" \ |
| 5961 | -S "Processing of the Certificate handshake message failed" |
| 5962 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5963 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5964 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5965 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5966 | "$O_CLI -key data_files/server5.key \ |
| 5967 | -cert data_files/server5.eku-cs.crt" \ |
| 5968 | 0 \ |
| 5969 | -s "bad certificate (usage extensions)" \ |
| 5970 | -S "Processing of the Certificate handshake message failed" |
| 5971 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5972 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5973 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5974 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5975 | "$O_CLI -key data_files/server5.key \ |
| 5976 | -cert data_files/server5.eku-cs.crt" \ |
| 5977 | 1 \ |
| 5978 | -s "bad certificate (usage extensions)" \ |
| 5979 | -s "Processing of the Certificate handshake message failed" |
| 5980 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5981 | # Tests for DHM parameters loading |
| 5982 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5983 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5984 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5985 | "$P_SRV" \ |
| 5986 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5987 | debug_level=3" \ |
| 5988 | 0 \ |
| 5989 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 5990 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5991 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5992 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5993 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5994 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5995 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5996 | debug_level=3" \ |
| 5997 | 0 \ |
| 5998 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 5999 | -c "value of 'DHM: G ' (2 bits)" |
| 6000 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6001 | # Tests for DHM client-side size checking |
| 6002 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6003 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6004 | run_test "DHM size: server default, client default, OK" \ |
| 6005 | "$P_SRV" \ |
| 6006 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6007 | debug_level=1" \ |
| 6008 | 0 \ |
| 6009 | -C "DHM prime too short:" |
| 6010 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6011 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6012 | run_test "DHM size: server default, client 2048, OK" \ |
| 6013 | "$P_SRV" \ |
| 6014 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6015 | debug_level=1 dhmlen=2048" \ |
| 6016 | 0 \ |
| 6017 | -C "DHM prime too short:" |
| 6018 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6019 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6020 | run_test "DHM size: server 1024, client default, OK" \ |
| 6021 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 6022 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6023 | debug_level=1" \ |
| 6024 | 0 \ |
| 6025 | -C "DHM prime too short:" |
| 6026 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6027 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6028 | run_test "DHM size: server 999, client 999, OK" \ |
| 6029 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 6030 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6031 | debug_level=1 dhmlen=999" \ |
| 6032 | 0 \ |
| 6033 | -C "DHM prime too short:" |
| 6034 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6035 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6036 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 6037 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 6038 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6039 | debug_level=1 dhmlen=1000" \ |
| 6040 | 0 \ |
| 6041 | -C "DHM prime too short:" |
| 6042 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6043 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6044 | run_test "DHM size: server 1000, client default, rejected" \ |
| 6045 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 6046 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6047 | debug_level=1" \ |
| 6048 | 1 \ |
| 6049 | -c "DHM prime too short:" |
| 6050 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6051 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6052 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 6053 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 6054 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6055 | debug_level=1 dhmlen=1001" \ |
| 6056 | 1 \ |
| 6057 | -c "DHM prime too short:" |
| 6058 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6059 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6060 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 6061 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 6062 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6063 | debug_level=1 dhmlen=1000" \ |
| 6064 | 1 \ |
| 6065 | -c "DHM prime too short:" |
| 6066 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6067 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6068 | run_test "DHM size: server 998, client 999, rejected" \ |
| 6069 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 6070 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6071 | debug_level=1 dhmlen=999" \ |
| 6072 | 1 \ |
| 6073 | -c "DHM prime too short:" |
| 6074 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6075 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6076 | run_test "DHM size: server default, client 2049, rejected" \ |
| 6077 | "$P_SRV" \ |
| 6078 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6079 | debug_level=1 dhmlen=2049" \ |
| 6080 | 1 \ |
| 6081 | -c "DHM prime too short:" |
| 6082 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6083 | # Tests for PSK callback |
| 6084 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6085 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6086 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6087 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 6088 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6089 | psk_identity=foo psk=abc123" \ |
| 6090 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6091 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 6092 | -S "SSL - Unknown identity received" \ |
| 6093 | -S "SSL - Verification of the message MAC failed" |
| 6094 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6095 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6096 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6097 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 6098 | "$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] | 6099 | "$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] | 6100 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6101 | 0 \ |
| 6102 | -c "skip PMS generation for opaque PSK"\ |
| 6103 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6104 | -C "session hash for extended master secret"\ |
| 6105 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6106 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6107 | -S "SSL - Unknown identity received" \ |
| 6108 | -S "SSL - Verification of the message MAC failed" |
| 6109 | |
| 6110 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6111 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6112 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 6113 | "$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] | 6114 | "$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] | 6115 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6116 | 0 \ |
| 6117 | -c "skip PMS generation for opaque PSK"\ |
| 6118 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6119 | -C "session hash for extended master secret"\ |
| 6120 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6121 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6122 | -S "SSL - Unknown identity received" \ |
| 6123 | -S "SSL - Verification of the message MAC failed" |
| 6124 | |
| 6125 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6126 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6127 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 6128 | "$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] | 6129 | "$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] | 6130 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6131 | 0 \ |
| 6132 | -c "skip PMS generation for opaque PSK"\ |
| 6133 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6134 | -c "session hash for extended master secret"\ |
| 6135 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6136 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6137 | -S "SSL - Unknown identity received" \ |
| 6138 | -S "SSL - Verification of the message MAC failed" |
| 6139 | |
| 6140 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6141 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6142 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 6143 | "$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] | 6144 | "$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] | 6145 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6146 | 0 \ |
| 6147 | -c "skip PMS generation for opaque PSK"\ |
| 6148 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6149 | -c "session hash for extended master secret"\ |
| 6150 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6151 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6152 | -S "SSL - Unknown identity received" \ |
| 6153 | -S "SSL - Verification of the message MAC failed" |
| 6154 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6155 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6156 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6157 | 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] | 6158 | "$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" \ |
| 6159 | "$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] | 6160 | psk_identity=foo psk=abc123" \ |
| 6161 | 0 \ |
| 6162 | -C "skip PMS generation for opaque PSK"\ |
| 6163 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6164 | -C "session hash for extended master secret"\ |
| 6165 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6166 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6167 | -S "SSL - Unknown identity received" \ |
| 6168 | -S "SSL - Verification of the message MAC failed" |
| 6169 | |
| 6170 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6171 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6172 | 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] | 6173 | "$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" \ |
| 6174 | "$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] | 6175 | psk_identity=foo psk=abc123" \ |
| 6176 | 0 \ |
| 6177 | -C "skip PMS generation for opaque PSK"\ |
| 6178 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6179 | -C "session hash for extended master secret"\ |
| 6180 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6181 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6182 | -S "SSL - Unknown identity received" \ |
| 6183 | -S "SSL - Verification of the message MAC failed" |
| 6184 | |
| 6185 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6186 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6187 | 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] | 6188 | "$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] | 6189 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6190 | "$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] | 6191 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 6192 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6193 | -c "session hash for extended master secret"\ |
| 6194 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6195 | -C "skip PMS generation for opaque PSK"\ |
| 6196 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6197 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6198 | -S "SSL - Unknown identity received" \ |
| 6199 | -S "SSL - Verification of the message MAC failed" |
| 6200 | |
| 6201 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6202 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6203 | 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] | 6204 | "$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] | 6205 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6206 | "$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] | 6207 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 6208 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6209 | -c "session hash for extended master secret"\ |
| 6210 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6211 | -C "skip PMS generation for opaque PSK"\ |
| 6212 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6213 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6214 | -S "SSL - Unknown identity received" \ |
| 6215 | -S "SSL - Verification of the message MAC failed" |
| 6216 | |
| 6217 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6218 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6219 | 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] | 6220 | "$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" \ |
| 6221 | "$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] | 6222 | psk_identity=def psk=beef" \ |
| 6223 | 0 \ |
| 6224 | -C "skip PMS generation for opaque PSK"\ |
| 6225 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6226 | -C "session hash for extended master secret"\ |
| 6227 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6228 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6229 | -S "SSL - Unknown identity received" \ |
| 6230 | -S "SSL - Verification of the message MAC failed" |
| 6231 | |
| 6232 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6233 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6234 | 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] | 6235 | "$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" \ |
| 6236 | "$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] | 6237 | psk_identity=def psk=beef" \ |
| 6238 | 0 \ |
| 6239 | -C "skip PMS generation for opaque PSK"\ |
| 6240 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6241 | -C "session hash for extended master secret"\ |
| 6242 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6243 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6244 | -S "SSL - Unknown identity received" \ |
| 6245 | -S "SSL - Verification of the message MAC failed" |
| 6246 | |
| 6247 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6248 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6249 | 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] | 6250 | "$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] | 6251 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6252 | "$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] | 6253 | psk_identity=abc psk=dead extended_ms=1" \ |
| 6254 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6255 | -c "session hash for extended master secret"\ |
| 6256 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6257 | -C "skip PMS generation for opaque PSK"\ |
| 6258 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6259 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6260 | -S "SSL - Unknown identity received" \ |
| 6261 | -S "SSL - Verification of the message MAC failed" |
| 6262 | |
| 6263 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6264 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6265 | 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] | 6266 | "$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] | 6267 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6268 | "$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] | 6269 | psk_identity=abc psk=dead extended_ms=1" \ |
| 6270 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6271 | -c "session hash for extended master secret"\ |
| 6272 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6273 | -C "skip PMS generation for opaque PSK"\ |
| 6274 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6275 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6276 | -S "SSL - Unknown identity received" \ |
| 6277 | -S "SSL - Verification of the message MAC failed" |
| 6278 | |
| 6279 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6280 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6281 | 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] | 6282 | "$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" \ |
| 6283 | "$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] | 6284 | psk_identity=def psk=beef" \ |
| 6285 | 0 \ |
| 6286 | -C "skip PMS generation for opaque PSK"\ |
| 6287 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6288 | -C "session hash for extended master secret"\ |
| 6289 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6290 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6291 | -S "SSL - Unknown identity received" \ |
| 6292 | -S "SSL - Verification of the message MAC failed" |
| 6293 | |
| 6294 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6295 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6296 | 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] | 6297 | "$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" \ |
| 6298 | "$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] | 6299 | psk_identity=def psk=beef" \ |
| 6300 | 0 \ |
| 6301 | -C "skip PMS generation for opaque PSK"\ |
| 6302 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6303 | -C "session hash for extended master secret"\ |
| 6304 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6305 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6306 | -S "SSL - Unknown identity received" \ |
| 6307 | -S "SSL - Verification of the message MAC failed" |
| 6308 | |
| 6309 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6310 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6311 | 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] | 6312 | "$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" \ |
| 6313 | "$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] | 6314 | psk_identity=def psk=beef" \ |
| 6315 | 0 \ |
| 6316 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6317 | -C "session hash for extended master secret"\ |
| 6318 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6319 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6320 | -S "SSL - Unknown identity received" \ |
| 6321 | -S "SSL - Verification of the message MAC failed" |
| 6322 | |
| 6323 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6324 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6325 | 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] | 6326 | "$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" \ |
| 6327 | "$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] | 6328 | psk_identity=def psk=beef" \ |
| 6329 | 0 \ |
| 6330 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6331 | -C "session hash for extended master secret"\ |
| 6332 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6333 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6334 | -S "SSL - Unknown identity received" \ |
| 6335 | -S "SSL - Verification of the message MAC failed" |
| 6336 | |
| 6337 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6338 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6339 | 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] | 6340 | "$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" \ |
| 6341 | "$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] | 6342 | psk_identity=def psk=beef" \ |
| 6343 | 1 \ |
| 6344 | -s "SSL - Verification of the message MAC failed" |
| 6345 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6346 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6347 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 6348 | "$P_SRV" \ |
| 6349 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6350 | psk_identity=foo psk=abc123" \ |
| 6351 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 6352 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6353 | -S "SSL - Unknown identity received" \ |
| 6354 | -S "SSL - Verification of the message MAC failed" |
| 6355 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6356 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6357 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6358 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 6359 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6360 | psk_identity=foo psk=abc123" \ |
| 6361 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6362 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6363 | -s "SSL - Unknown identity received" \ |
| 6364 | -S "SSL - Verification of the message MAC failed" |
| 6365 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6366 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6367 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6368 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6369 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6370 | psk_identity=abc psk=dead" \ |
| 6371 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6372 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6373 | -S "SSL - Unknown identity received" \ |
| 6374 | -S "SSL - Verification of the message MAC failed" |
| 6375 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6376 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6377 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6378 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6379 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6380 | psk_identity=def psk=beef" \ |
| 6381 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6382 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6383 | -S "SSL - Unknown identity received" \ |
| 6384 | -S "SSL - Verification of the message MAC failed" |
| 6385 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6386 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6387 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6388 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6389 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6390 | psk_identity=ghi psk=beef" \ |
| 6391 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6392 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6393 | -s "SSL - Unknown identity received" \ |
| 6394 | -S "SSL - Verification of the message MAC failed" |
| 6395 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6396 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6397 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6398 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6399 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6400 | psk_identity=abc psk=beef" \ |
| 6401 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6402 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6403 | -S "SSL - Unknown identity received" \ |
| 6404 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6405 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6406 | # Tests for EC J-PAKE |
| 6407 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6408 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6409 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6410 | run_test "ECJPAKE: client not configured" \ |
| 6411 | "$P_SRV debug_level=3" \ |
| 6412 | "$P_CLI debug_level=3" \ |
| 6413 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6414 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6415 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6416 | -S "found ecjpake kkpp extension" \ |
| 6417 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6418 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6419 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6420 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 6421 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6422 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6423 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6424 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6425 | run_test "ECJPAKE: server not configured" \ |
| 6426 | "$P_SRV debug_level=3" \ |
| 6427 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 6428 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6429 | 1 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6430 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6431 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6432 | -s "found ecjpake kkpp extension" \ |
| 6433 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6434 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6435 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6436 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 6437 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6438 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6439 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6440 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6441 | run_test "ECJPAKE: working, TLS" \ |
| 6442 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 6443 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 6444 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 6445 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6446 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6447 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6448 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6449 | -s "found ecjpake kkpp extension" \ |
| 6450 | -S "skip ecjpake kkpp extension" \ |
| 6451 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6452 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6453 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 6454 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6455 | -S "SSL - Verification of the message MAC failed" |
| 6456 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6457 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6458 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6459 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6460 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 6461 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 6462 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 6463 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6464 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6465 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6466 | -s "SSL - Verification of the message MAC failed" |
| 6467 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6468 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6469 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6470 | run_test "ECJPAKE: working, DTLS" \ |
| 6471 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 6472 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 6473 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6474 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6475 | -c "re-using cached ecjpake parameters" \ |
| 6476 | -S "SSL - Verification of the message MAC failed" |
| 6477 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6478 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6479 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6480 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 6481 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 6482 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 6483 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6484 | 0 \ |
| 6485 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6486 | -S "SSL - Verification of the message MAC failed" |
| 6487 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6488 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6489 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6490 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6491 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 6492 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 6493 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 6494 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6495 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6496 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6497 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6498 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 6499 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6500 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6501 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 6502 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 6503 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 6504 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 6505 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6506 | 0 |
| 6507 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 6508 | # Test for ClientHello without extensions |
| 6509 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 6510 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6511 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 6512 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 6513 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6514 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 6515 | 0 \ |
| 6516 | -s "dumping 'client hello extensions' (0 bytes)" |
| 6517 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6518 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6519 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6520 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6521 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6522 | "$P_SRV" \ |
| 6523 | "$P_CLI request_size=100" \ |
| 6524 | 0 \ |
| 6525 | -s "Read from client: 100 bytes read$" |
| 6526 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6527 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6528 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6529 | "$P_SRV" \ |
| 6530 | "$P_CLI request_size=500" \ |
| 6531 | 0 \ |
| 6532 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6533 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6534 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6535 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6536 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6537 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6538 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6539 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6540 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6541 | 0 \ |
| 6542 | -s "Read from client: 1 bytes read" |
| 6543 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6544 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6545 | 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] | 6546 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6547 | "$P_CLI request_size=1 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6548 | 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] | 6549 | 0 \ |
| 6550 | -s "Read from client: 1 bytes read" |
| 6551 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6552 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6553 | 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] | 6554 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6555 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6556 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6557 | 0 \ |
| 6558 | -s "Read from client: 1 bytes read" |
| 6559 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6560 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6561 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6562 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6563 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6564 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6565 | 0 \ |
| 6566 | -s "Read from client: 1 bytes read" |
| 6567 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6568 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6569 | 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] | 6570 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6571 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6572 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6573 | 0 \ |
| 6574 | -s "Read from client: 1 bytes read" |
| 6575 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6576 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6577 | |
| 6578 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6579 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6580 | run_test "Small client packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6581 | "$P_SRV dtls=1 force_version=dtls12" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6582 | "$P_CLI dtls=1 request_size=1 \ |
| 6583 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6584 | 0 \ |
| 6585 | -s "Read from client: 1 bytes read" |
| 6586 | |
| 6587 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6588 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6589 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6590 | "$P_SRV dtls=1 force_version=dtls12 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6591 | "$P_CLI dtls=1 request_size=1 \ |
| 6592 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6593 | 0 \ |
| 6594 | -s "Read from client: 1 bytes read" |
| 6595 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6596 | # Tests for small server packets |
| 6597 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6598 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6599 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 6600 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6601 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6602 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6603 | 0 \ |
| 6604 | -c "Read from server: 1 bytes read" |
| 6605 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6606 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6607 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6608 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6609 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6610 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 6611 | 0 \ |
| 6612 | -c "Read from server: 1 bytes read" |
| 6613 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6614 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6615 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6616 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6617 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6618 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6619 | 0 \ |
| 6620 | -c "Read from server: 1 bytes read" |
| 6621 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6622 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6623 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 6624 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6625 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6626 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6627 | 0 \ |
| 6628 | -c "Read from server: 1 bytes read" |
| 6629 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6630 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6631 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 6632 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6633 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6634 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6635 | 0 \ |
| 6636 | -c "Read from server: 1 bytes read" |
| 6637 | |
| 6638 | # Tests for small server packets in DTLS |
| 6639 | |
| 6640 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6641 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6642 | run_test "Small server packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6643 | "$P_SRV dtls=1 response_size=1 force_version=dtls12" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6644 | "$P_CLI dtls=1 \ |
| 6645 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6646 | 0 \ |
| 6647 | -c "Read from server: 1 bytes read" |
| 6648 | |
| 6649 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6650 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6651 | run_test "Small server packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6652 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6653 | "$P_CLI dtls=1 \ |
| 6654 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6655 | 0 \ |
| 6656 | -c "Read from server: 1 bytes read" |
| 6657 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6658 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6659 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6660 | # How many fragments do we expect to write $1 bytes? |
| 6661 | fragments_for_write() { |
| 6662 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 6663 | } |
| 6664 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6665 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6666 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6667 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6668 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6669 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6670 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6671 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6672 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6673 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6674 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6675 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6676 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6677 | "$P_CLI request_size=16384 force_version=tls12 etm=0 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6678 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6679 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6680 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6681 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6682 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6683 | 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] | 6684 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6685 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6686 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6687 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6688 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6689 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6690 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6691 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6692 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6693 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6694 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6695 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6696 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6697 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6698 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6699 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6700 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6701 | 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] | 6702 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6703 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6704 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6705 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6706 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6707 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6708 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6709 | # 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] | 6710 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6711 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 6712 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6713 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6714 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6715 | 0 \ |
| 6716 | -c "Read from server: 16384 bytes read" |
| 6717 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6718 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6719 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6720 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6721 | "$P_CLI force_version=tls12 etm=0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6722 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6723 | 0 \ |
| 6724 | -s "16384 bytes written in 1 fragments" \ |
| 6725 | -c "Read from server: 16384 bytes read" |
| 6726 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6727 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6728 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6729 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6730 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6731 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6732 | 0 \ |
| 6733 | -c "Read from server: 16384 bytes read" |
| 6734 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6735 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6736 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 6737 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6738 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6739 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6740 | 0 \ |
| 6741 | -s "16384 bytes written in 1 fragments" \ |
| 6742 | -c "Read from server: 16384 bytes read" |
| 6743 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6744 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6745 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 6746 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6747 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6748 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6749 | 0 \ |
| 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 AEAD shorter tag" \ |
| 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-RSA-WITH-AES-256-CCM-8" \ |
| 6757 | 0 \ |
| 6758 | -c "Read from server: 16384 bytes read" |
| 6759 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6760 | # Tests for restartable ECC |
| 6761 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6762 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 6763 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6764 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6765 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6766 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6767 | run_test "EC restart: TLS, default" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6768 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6769 | "$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] | 6770 | 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] | 6771 | debug_level=1" \ |
| 6772 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6773 | -C "x509_verify_cert.*4b00" \ |
| 6774 | -C "mbedtls_pk_verify.*4b00" \ |
| 6775 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6776 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6777 | |
| 6778 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6779 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6780 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6781 | run_test "EC restart: TLS, max_ops=0" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6782 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6783 | "$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] | 6784 | 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] | 6785 | debug_level=1 ec_max_ops=0" \ |
| 6786 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6787 | -C "x509_verify_cert.*4b00" \ |
| 6788 | -C "mbedtls_pk_verify.*4b00" \ |
| 6789 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6790 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6791 | |
| 6792 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6793 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6794 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6795 | run_test "EC restart: TLS, max_ops=65535" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6796 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6797 | "$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] | 6798 | 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] | 6799 | debug_level=1 ec_max_ops=65535" \ |
| 6800 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6801 | -C "x509_verify_cert.*4b00" \ |
| 6802 | -C "mbedtls_pk_verify.*4b00" \ |
| 6803 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6804 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6805 | |
| 6806 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6807 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6808 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6809 | run_test "EC restart: TLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6810 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6811 | "$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] | 6812 | 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] | 6813 | debug_level=1 ec_max_ops=1000" \ |
| 6814 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6815 | -c "x509_verify_cert.*4b00" \ |
| 6816 | -c "mbedtls_pk_verify.*4b00" \ |
| 6817 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6818 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6819 | |
| 6820 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6821 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6822 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6823 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6824 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6825 | crt_file=data_files/server5-badsign.crt \ |
| 6826 | key_file=data_files/server5.key" \ |
| 6827 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6828 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6829 | debug_level=1 ec_max_ops=1000" \ |
| 6830 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6831 | -c "x509_verify_cert.*4b00" \ |
| 6832 | -C "mbedtls_pk_verify.*4b00" \ |
| 6833 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6834 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6835 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6836 | -c "! mbedtls_ssl_handshake returned" \ |
| 6837 | -c "X509 - Certificate verification failed" |
| 6838 | |
| 6839 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6840 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6841 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6842 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6843 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6844 | crt_file=data_files/server5-badsign.crt \ |
| 6845 | key_file=data_files/server5.key" \ |
| 6846 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6847 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6848 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 6849 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6850 | -c "x509_verify_cert.*4b00" \ |
| 6851 | -c "mbedtls_pk_verify.*4b00" \ |
| 6852 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6853 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6854 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6855 | -C "! mbedtls_ssl_handshake returned" \ |
| 6856 | -C "X509 - Certificate verification failed" |
| 6857 | |
| 6858 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6859 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6860 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6861 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6862 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6863 | crt_file=data_files/server5-badsign.crt \ |
| 6864 | key_file=data_files/server5.key" \ |
| 6865 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6866 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6867 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 6868 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6869 | -C "x509_verify_cert.*4b00" \ |
| 6870 | -c "mbedtls_pk_verify.*4b00" \ |
| 6871 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6872 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6873 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6874 | -C "! mbedtls_ssl_handshake returned" \ |
| 6875 | -C "X509 - Certificate verification failed" |
| 6876 | |
| 6877 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6878 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6879 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6880 | run_test "EC restart: DTLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6881 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6882 | "$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] | 6883 | 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] | 6884 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 6885 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6886 | -c "x509_verify_cert.*4b00" \ |
| 6887 | -c "mbedtls_pk_verify.*4b00" \ |
| 6888 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6889 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6890 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6891 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6892 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6893 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6894 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6895 | "$P_SRV curves=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6896 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6897 | debug_level=1 ec_max_ops=1000" \ |
| 6898 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6899 | -c "x509_verify_cert.*4b00" \ |
| 6900 | -c "mbedtls_pk_verify.*4b00" \ |
| 6901 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6902 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6903 | |
| 6904 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6905 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6906 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6907 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6908 | "$P_SRV curves=secp256r1 psk=abc123" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6909 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 6910 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 6911 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6912 | -C "x509_verify_cert.*4b00" \ |
| 6913 | -C "mbedtls_pk_verify.*4b00" \ |
| 6914 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6915 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6916 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6917 | # Tests of asynchronous private key support in SSL |
| 6918 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6919 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6920 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6921 | run_test "SSL async private: sign, delay=0" \ |
| 6922 | "$P_SRV \ |
| 6923 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6924 | "$P_CLI" \ |
| 6925 | 0 \ |
| 6926 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6927 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6928 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6929 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6930 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6931 | run_test "SSL async private: sign, delay=1" \ |
| 6932 | "$P_SRV \ |
| 6933 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6934 | "$P_CLI" \ |
| 6935 | 0 \ |
| 6936 | -s "Async sign callback: using key slot " \ |
| 6937 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6938 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6939 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 6940 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6941 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 6942 | run_test "SSL async private: sign, delay=2" \ |
| 6943 | "$P_SRV \ |
| 6944 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 6945 | "$P_CLI" \ |
| 6946 | 0 \ |
| 6947 | -s "Async sign callback: using key slot " \ |
| 6948 | -U "Async sign callback: using key slot " \ |
| 6949 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 6950 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6951 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6952 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6953 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6954 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6955 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 6956 | run_test "SSL async private: sign, SNI" \ |
| 6957 | "$P_SRV debug_level=3 \ |
| 6958 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 6959 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6960 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6961 | "$P_CLI server_name=polarssl.example" \ |
| 6962 | 0 \ |
| 6963 | -s "Async sign callback: using key slot " \ |
| 6964 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6965 | -s "parse ServerName extension" \ |
| 6966 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6967 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6968 | |
| 6969 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6970 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6971 | run_test "SSL async private: decrypt, delay=0" \ |
| 6972 | "$P_SRV \ |
| 6973 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6974 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6975 | 0 \ |
| 6976 | -s "Async decrypt callback: using key slot " \ |
| 6977 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6978 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6979 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6980 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6981 | run_test "SSL async private: decrypt, delay=1" \ |
| 6982 | "$P_SRV \ |
| 6983 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6984 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6985 | 0 \ |
| 6986 | -s "Async decrypt callback: using key slot " \ |
| 6987 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6988 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6989 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6990 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6991 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6992 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 6993 | "$P_SRV psk=abc123 \ |
| 6994 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6995 | "$P_CLI psk=abc123 \ |
| 6996 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6997 | 0 \ |
| 6998 | -s "Async decrypt callback: using key slot " \ |
| 6999 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7000 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7001 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7002 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7003 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 7004 | "$P_SRV psk=abc123 \ |
| 7005 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7006 | "$P_CLI psk=abc123 \ |
| 7007 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 7008 | 0 \ |
| 7009 | -s "Async decrypt callback: using key slot " \ |
| 7010 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7011 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7012 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7013 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7014 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7015 | run_test "SSL async private: sign callback not present" \ |
| 7016 | "$P_SRV \ |
| 7017 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7018 | "$P_CLI; [ \$? -eq 1 ] && |
| 7019 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7020 | 0 \ |
| 7021 | -S "Async sign callback" \ |
| 7022 | -s "! mbedtls_ssl_handshake returned" \ |
| 7023 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 7024 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 7025 | -s "Successful connection" |
| 7026 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7027 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7028 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7029 | run_test "SSL async private: decrypt callback not present" \ |
| 7030 | "$P_SRV debug_level=1 \ |
| 7031 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 7032 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 7033 | [ \$? -eq 1 ] && $P_CLI" \ |
| 7034 | 0 \ |
| 7035 | -S "Async decrypt callback" \ |
| 7036 | -s "! mbedtls_ssl_handshake returned" \ |
| 7037 | -s "got no RSA private key" \ |
| 7038 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 7039 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7040 | |
| 7041 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7042 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7043 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7044 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7045 | "$P_SRV \ |
| 7046 | async_operations=s async_private_delay1=1 \ |
| 7047 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7048 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7049 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7050 | 0 \ |
| 7051 | -s "Async sign callback: using key slot 0," \ |
| 7052 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7053 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7054 | |
| 7055 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7056 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7057 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7058 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7059 | "$P_SRV \ |
| 7060 | async_operations=s async_private_delay2=1 \ |
| 7061 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7062 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7063 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7064 | 0 \ |
| 7065 | -s "Async sign callback: using key slot 0," \ |
| 7066 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7067 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7068 | |
| 7069 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7070 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7071 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 7072 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7073 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 7074 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7075 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7076 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7077 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7078 | 0 \ |
| 7079 | -s "Async sign callback: using key slot 1," \ |
| 7080 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7081 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7082 | |
| 7083 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7084 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7085 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7086 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7087 | "$P_SRV \ |
| 7088 | async_operations=s async_private_delay1=1 \ |
| 7089 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7090 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7091 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7092 | 0 \ |
| 7093 | -s "Async sign callback: no key matches this certificate." |
| 7094 | |
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 | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7097 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7098 | "$P_SRV \ |
| 7099 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7100 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7101 | "$P_CLI" \ |
| 7102 | 1 \ |
| 7103 | -s "Async sign callback: injected error" \ |
| 7104 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 7105 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7106 | -s "! mbedtls_ssl_handshake returned" |
| 7107 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7108 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7109 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7110 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7111 | "$P_SRV \ |
| 7112 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7113 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7114 | "$P_CLI" \ |
| 7115 | 1 \ |
| 7116 | -s "Async sign callback: using key slot " \ |
| 7117 | -S "Async resume" \ |
| 7118 | -s "Async cancel" |
| 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 resume" \ |
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=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7126 | "$P_CLI" \ |
| 7127 | 1 \ |
| 7128 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7129 | -s "Async resume callback: sign done but injected error" \ |
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: decrypt, error in start" \ |
| 7136 | "$P_SRV \ |
| 7137 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7138 | async_private_error=1" \ |
| 7139 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7140 | 1 \ |
| 7141 | -s "Async decrypt callback: injected error" \ |
| 7142 | -S "Async resume" \ |
| 7143 | -S "Async cancel" \ |
| 7144 | -s "! mbedtls_ssl_handshake returned" |
| 7145 | |
| 7146 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7147 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7148 | run_test "SSL async private: decrypt, cancel after start" \ |
| 7149 | "$P_SRV \ |
| 7150 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7151 | async_private_error=2" \ |
| 7152 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7153 | 1 \ |
| 7154 | -s "Async decrypt callback: using key slot " \ |
| 7155 | -S "Async resume" \ |
| 7156 | -s "Async cancel" |
| 7157 | |
| 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 resume" \ |
| 7161 | "$P_SRV \ |
| 7162 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7163 | async_private_error=3" \ |
| 7164 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7165 | 1 \ |
| 7166 | -s "Async decrypt callback: using key slot " \ |
| 7167 | -s "Async resume callback: decrypt done but injected error" \ |
| 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 | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7173 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7174 | "$P_SRV \ |
| 7175 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7176 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7177 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 7178 | 0 \ |
| 7179 | -s "Async cancel" \ |
| 7180 | -s "! mbedtls_ssl_handshake returned" \ |
| 7181 | -s "Async resume" \ |
| 7182 | -s "Successful connection" |
| 7183 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7184 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7185 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7186 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7187 | "$P_SRV \ |
| 7188 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7189 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7190 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 7191 | 0 \ |
| 7192 | -s "! mbedtls_ssl_handshake returned" \ |
| 7193 | -s "Async resume" \ |
| 7194 | -s "Successful connection" |
| 7195 | |
| 7196 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7197 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7198 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7199 | 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] | 7200 | "$P_SRV \ |
| 7201 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 7202 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7203 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7204 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 7205 | [ \$? -eq 1 ] && |
| 7206 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7207 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 7208 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7209 | -S "Async resume" \ |
| 7210 | -s "Async cancel" \ |
| 7211 | -s "! mbedtls_ssl_handshake returned" \ |
| 7212 | -s "Async sign callback: no key matches this certificate." \ |
| 7213 | -s "Successful connection" |
| 7214 | |
| 7215 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7216 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7217 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7218 | 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] | 7219 | "$P_SRV \ |
| 7220 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 7221 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7222 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7223 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 7224 | [ \$? -eq 1 ] && |
| 7225 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7226 | 0 \ |
| 7227 | -s "Async resume" \ |
| 7228 | -s "! mbedtls_ssl_handshake returned" \ |
| 7229 | -s "Async sign callback: no key matches this certificate." \ |
| 7230 | -s "Successful connection" |
| 7231 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7232 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7233 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7234 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7235 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7236 | "$P_SRV \ |
| 7237 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7238 | exchanges=2 renegotiation=1" \ |
| 7239 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7240 | 0 \ |
| 7241 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7242 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7243 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7244 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7245 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7246 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7247 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7248 | "$P_SRV \ |
| 7249 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7250 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7251 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 7252 | 0 \ |
| 7253 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7254 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7255 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7256 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7257 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7258 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7259 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7260 | "$P_SRV \ |
| 7261 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7262 | exchanges=2 renegotiation=1" \ |
| 7263 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 7264 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7265 | 0 \ |
| 7266 | -s "Async decrypt callback: using key slot " \ |
| 7267 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7268 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7269 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +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, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7273 | "$P_SRV \ |
| 7274 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7275 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7276 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 7277 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7278 | 0 \ |
| 7279 | -s "Async decrypt callback: using key slot " \ |
| 7280 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7281 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7282 | # Tests for ECC extensions (rfc 4492) |
| 7283 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7284 | requires_config_enabled MBEDTLS_AES_C |
| 7285 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7286 | requires_config_enabled MBEDTLS_SHA256_C |
| 7287 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7288 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7289 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 7290 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7291 | "$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] | 7292 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 7293 | -C "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7294 | -C "client hello, adding supported_point_formats extension" \ |
| 7295 | -S "found supported elliptic curves extension" \ |
| 7296 | -S "found supported point formats extension" |
| 7297 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7298 | requires_config_enabled MBEDTLS_AES_C |
| 7299 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7300 | requires_config_enabled MBEDTLS_SHA256_C |
| 7301 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7302 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7303 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7304 | "$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] | 7305 | "$P_CLI debug_level=3" \ |
| 7306 | 0 \ |
| 7307 | -C "found supported_point_formats extension" \ |
| 7308 | -S "server hello, supported_point_formats extension" |
| 7309 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7310 | requires_config_enabled MBEDTLS_AES_C |
| 7311 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7312 | requires_config_enabled MBEDTLS_SHA256_C |
| 7313 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7314 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7315 | run_test "Force an ECC ciphersuite in the client side" \ |
| 7316 | "$P_SRV debug_level=3" \ |
| 7317 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7318 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 7319 | -c "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7320 | -c "client hello, adding supported_point_formats extension" \ |
| 7321 | -s "found supported elliptic curves extension" \ |
| 7322 | -s "found supported point formats extension" |
| 7323 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7324 | requires_config_enabled MBEDTLS_AES_C |
| 7325 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7326 | requires_config_enabled MBEDTLS_SHA256_C |
| 7327 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7328 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7329 | run_test "Force an ECC ciphersuite in the server side" \ |
| 7330 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7331 | "$P_CLI debug_level=3" \ |
| 7332 | 0 \ |
| 7333 | -c "found supported_point_formats extension" \ |
| 7334 | -s "server hello, supported_point_formats extension" |
| 7335 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7336 | # Tests for DTLS HelloVerifyRequest |
| 7337 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7338 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7339 | run_test "DTLS cookie: enabled" \ |
| 7340 | "$P_SRV dtls=1 debug_level=2" \ |
| 7341 | "$P_CLI dtls=1 debug_level=2" \ |
| 7342 | 0 \ |
| 7343 | -s "cookie verification failed" \ |
| 7344 | -s "cookie verification passed" \ |
| 7345 | -S "cookie verification skipped" \ |
| 7346 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7347 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7348 | -S "SSL - The requested feature is not available" |
| 7349 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7350 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7351 | run_test "DTLS cookie: disabled" \ |
| 7352 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 7353 | "$P_CLI dtls=1 debug_level=2" \ |
| 7354 | 0 \ |
| 7355 | -S "cookie verification failed" \ |
| 7356 | -S "cookie verification passed" \ |
| 7357 | -s "cookie verification skipped" \ |
| 7358 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7359 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7360 | -S "SSL - The requested feature is not available" |
| 7361 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7362 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7363 | run_test "DTLS cookie: default (failing)" \ |
| 7364 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 7365 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 7366 | 1 \ |
| 7367 | -s "cookie verification failed" \ |
| 7368 | -S "cookie verification passed" \ |
| 7369 | -S "cookie verification skipped" \ |
| 7370 | -C "received hello verify request" \ |
| 7371 | -S "hello verification requested" \ |
| 7372 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7373 | |
| 7374 | requires_ipv6 |
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: enabled, IPv6" \ |
| 7377 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 7378 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 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 | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7388 | run_test "DTLS cookie: enabled, nbio" \ |
| 7389 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 7390 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7391 | 0 \ |
| 7392 | -s "cookie verification failed" \ |
| 7393 | -s "cookie verification passed" \ |
| 7394 | -S "cookie verification skipped" \ |
| 7395 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7396 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7397 | -S "SSL - The requested feature is not available" |
| 7398 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7399 | # Tests for client reconnecting from the same port with DTLS |
| 7400 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7401 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7402 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7403 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7404 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 7405 | "$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] | 7406 | 0 \ |
| 7407 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7408 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7409 | -S "Client initiated reconnection from same port" |
| 7410 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7411 | not_with_valgrind # spurious resend |
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 | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7413 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7414 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 7415 | "$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] | 7416 | 0 \ |
| 7417 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7418 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7419 | -s "Client initiated reconnection from same port" |
| 7420 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7421 | 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] | 7422 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7423 | 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] | 7424 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 7425 | "$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] | 7426 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7427 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7428 | -s "Client initiated reconnection from same port" |
| 7429 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7430 | 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] | 7431 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7432 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 7433 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 7434 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 7435 | 0 \ |
| 7436 | -S "The operation timed out" \ |
| 7437 | -s "Client initiated reconnection from same port" |
| 7438 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7439 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7440 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 7441 | "$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] | 7442 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 7443 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7444 | -s "The operation timed out" \ |
| 7445 | -S "Client initiated reconnection from same port" |
| 7446 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7447 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 7448 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 7449 | -p "$P_PXY inject_clihlo=1" \ |
| 7450 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 7451 | "$P_CLI dtls=1 exchanges=2" \ |
| 7452 | 0 \ |
| 7453 | -s "possible client reconnect from the same port" \ |
| 7454 | -S "Client initiated reconnection from same port" |
| 7455 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7456 | # Tests for various cases of client authentication with DTLS |
| 7457 | # (focused on handshake flows and message parsing) |
| 7458 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7459 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7460 | run_test "DTLS client auth: required" \ |
| 7461 | "$P_SRV dtls=1 auth_mode=required" \ |
| 7462 | "$P_CLI dtls=1" \ |
| 7463 | 0 \ |
| 7464 | -s "Verifying peer X.509 certificate... ok" |
| 7465 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7466 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7467 | run_test "DTLS client auth: optional, client has no cert" \ |
| 7468 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 7469 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 7470 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7471 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7472 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7473 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7474 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7475 | "$P_SRV dtls=1 auth_mode=none" \ |
| 7476 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 7477 | 0 \ |
| 7478 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7479 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7480 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7481 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 7482 | run_test "DTLS wrong PSK: badmac alert" \ |
| 7483 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 7484 | "$P_CLI dtls=1 psk=abc124" \ |
| 7485 | 1 \ |
| 7486 | -s "SSL - Verification of the message MAC failed" \ |
| 7487 | -c "SSL - A fatal alert message was received from our peer" |
| 7488 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7489 | # Tests for receiving fragmented handshake messages with DTLS |
| 7490 | |
| 7491 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7492 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7493 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 7494 | "$G_SRV -u --mtu 2048 -a" \ |
| 7495 | "$P_CLI dtls=1 debug_level=2" \ |
| 7496 | 0 \ |
| 7497 | -C "found fragmented DTLS handshake message" \ |
| 7498 | -C "error" |
| 7499 | |
| 7500 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7501 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7502 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 7503 | "$G_SRV -u --mtu 512" \ |
| 7504 | "$P_CLI dtls=1 debug_level=2" \ |
| 7505 | 0 \ |
| 7506 | -c "found fragmented DTLS handshake message" \ |
| 7507 | -C "error" |
| 7508 | |
| 7509 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7510 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7511 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 7512 | "$G_SRV -u --mtu 128" \ |
| 7513 | "$P_CLI dtls=1 debug_level=2" \ |
| 7514 | 0 \ |
| 7515 | -c "found fragmented DTLS handshake message" \ |
| 7516 | -C "error" |
| 7517 | |
| 7518 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7519 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7520 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 7521 | "$G_SRV -u --mtu 128" \ |
| 7522 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7523 | 0 \ |
| 7524 | -c "found fragmented DTLS handshake message" \ |
| 7525 | -C "error" |
| 7526 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7527 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7528 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7529 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7530 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 7531 | "$G_SRV -u --mtu 256" \ |
| 7532 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 7533 | 0 \ |
| 7534 | -c "found fragmented DTLS handshake message" \ |
| 7535 | -c "client hello, adding renegotiation extension" \ |
| 7536 | -c "found renegotiation extension" \ |
| 7537 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7538 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7539 | -C "error" \ |
| 7540 | -s "Extra-header:" |
| 7541 | |
| 7542 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7543 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
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 | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7545 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 7546 | "$G_SRV -u --mtu 256" \ |
| 7547 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 7548 | 0 \ |
| 7549 | -c "found fragmented DTLS handshake message" \ |
| 7550 | -c "client hello, adding renegotiation extension" \ |
| 7551 | -c "found renegotiation extension" \ |
| 7552 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7553 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7554 | -C "error" \ |
| 7555 | -s "Extra-header:" |
| 7556 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7557 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 7558 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 7559 | "$O_SRV -dtls -mtu 2048" \ |
| 7560 | "$P_CLI dtls=1 debug_level=2" \ |
| 7561 | 0 \ |
| 7562 | -C "found fragmented DTLS handshake message" \ |
| 7563 | -C "error" |
| 7564 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7565 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 7566 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 7567 | "$O_SRV -dtls -mtu 768" \ |
| 7568 | "$P_CLI dtls=1 debug_level=2" \ |
| 7569 | 0 \ |
| 7570 | -c "found fragmented DTLS handshake message" \ |
| 7571 | -C "error" |
| 7572 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7573 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 7574 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 7575 | "$O_SRV -dtls -mtu 256" \ |
| 7576 | "$P_CLI dtls=1 debug_level=2" \ |
| 7577 | 0 \ |
| 7578 | -c "found fragmented DTLS handshake message" \ |
| 7579 | -C "error" |
| 7580 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7581 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 7582 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 7583 | "$O_SRV -dtls -mtu 256" \ |
| 7584 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7585 | 0 \ |
| 7586 | -c "found fragmented DTLS handshake message" \ |
| 7587 | -C "error" |
| 7588 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7589 | # Tests for sending fragmented handshake messages with DTLS |
| 7590 | # |
| 7591 | # Use client auth when we need the client to send large messages, |
| 7592 | # and use large cert chains on both sides too (the long chains we have all use |
| 7593 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 7594 | # Sizes reached (UDP payload): |
| 7595 | # - 2037B for server certificate |
| 7596 | # - 1542B for client certificate |
| 7597 | # - 1013B for newsessionticket |
| 7598 | # - all others below 512B |
| 7599 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 7600 | |
| 7601 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7602 | requires_config_enabled MBEDTLS_RSA_C |
| 7603 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7604 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7605 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7606 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7607 | run_test "DTLS fragmenting: none (for reference)" \ |
| 7608 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7609 | crt_file=data_files/server7_int-ca.crt \ |
| 7610 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7611 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7612 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7613 | "$P_CLI dtls=1 debug_level=2 \ |
| 7614 | crt_file=data_files/server8_int-ca2.crt \ |
| 7615 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7616 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7617 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7618 | 0 \ |
| 7619 | -S "found fragmented DTLS handshake message" \ |
| 7620 | -C "found fragmented DTLS handshake message" \ |
| 7621 | -C "error" |
| 7622 | |
| 7623 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7624 | requires_config_enabled MBEDTLS_RSA_C |
| 7625 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7626 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7627 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7628 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7629 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7630 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7631 | crt_file=data_files/server7_int-ca.crt \ |
| 7632 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7633 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7634 | max_frag_len=1024" \ |
| 7635 | "$P_CLI dtls=1 debug_level=2 \ |
| 7636 | crt_file=data_files/server8_int-ca2.crt \ |
| 7637 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7638 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7639 | max_frag_len=2048" \ |
| 7640 | 0 \ |
| 7641 | -S "found fragmented DTLS handshake message" \ |
| 7642 | -c "found fragmented DTLS handshake message" \ |
| 7643 | -C "error" |
| 7644 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7645 | # With the MFL extension, the server has no way of forcing |
| 7646 | # the client to not exceed a certain MTU; hence, the following |
| 7647 | # test can't be replicated with an MTU proxy such as the one |
| 7648 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7649 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7650 | requires_config_enabled MBEDTLS_RSA_C |
| 7651 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7652 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7653 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7654 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7655 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7656 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7657 | crt_file=data_files/server7_int-ca.crt \ |
| 7658 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7659 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7660 | max_frag_len=512" \ |
| 7661 | "$P_CLI dtls=1 debug_level=2 \ |
| 7662 | crt_file=data_files/server8_int-ca2.crt \ |
| 7663 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7664 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7665 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7666 | 0 \ |
| 7667 | -S "found fragmented DTLS handshake message" \ |
| 7668 | -c "found fragmented DTLS handshake message" \ |
| 7669 | -C "error" |
| 7670 | |
| 7671 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7672 | requires_config_enabled MBEDTLS_RSA_C |
| 7673 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7674 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7675 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7676 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7677 | 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] | 7678 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 7679 | crt_file=data_files/server7_int-ca.crt \ |
| 7680 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7681 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7682 | max_frag_len=2048" \ |
| 7683 | "$P_CLI dtls=1 debug_level=2 \ |
| 7684 | crt_file=data_files/server8_int-ca2.crt \ |
| 7685 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7686 | hs_timeout=2500-60000 \ |
| 7687 | max_frag_len=1024" \ |
| 7688 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7689 | -S "found fragmented DTLS handshake message" \ |
| 7690 | -c "found fragmented DTLS handshake message" \ |
| 7691 | -C "error" |
| 7692 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7693 | # While not required by the standard defining the MFL extension |
| 7694 | # (according to which it only applies to records, not to datagrams), |
| 7695 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7696 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7697 | # to the peer. |
| 7698 | # The next test checks that no datagrams significantly larger than the |
| 7699 | # negotiated MFL are sent. |
| 7700 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7701 | requires_config_enabled MBEDTLS_RSA_C |
| 7702 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7703 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7704 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7705 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7706 | 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] | 7707 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7708 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 7709 | crt_file=data_files/server7_int-ca.crt \ |
| 7710 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7711 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7712 | max_frag_len=2048" \ |
| 7713 | "$P_CLI dtls=1 debug_level=2 \ |
| 7714 | crt_file=data_files/server8_int-ca2.crt \ |
| 7715 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7716 | hs_timeout=2500-60000 \ |
| 7717 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7718 | 0 \ |
| 7719 | -S "found fragmented DTLS handshake message" \ |
| 7720 | -c "found fragmented DTLS handshake message" \ |
| 7721 | -C "error" |
| 7722 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7723 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7724 | requires_config_enabled MBEDTLS_RSA_C |
| 7725 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7726 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7727 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7728 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7729 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7730 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7731 | crt_file=data_files/server7_int-ca.crt \ |
| 7732 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7733 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7734 | max_frag_len=2048" \ |
| 7735 | "$P_CLI dtls=1 debug_level=2 \ |
| 7736 | crt_file=data_files/server8_int-ca2.crt \ |
| 7737 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7738 | hs_timeout=2500-60000 \ |
| 7739 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7740 | 0 \ |
| 7741 | -s "found fragmented DTLS handshake message" \ |
| 7742 | -c "found fragmented DTLS handshake message" \ |
| 7743 | -C "error" |
| 7744 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7745 | # While not required by the standard defining the MFL extension |
| 7746 | # (according to which it only applies to records, not to datagrams), |
| 7747 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7748 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7749 | # to the peer. |
| 7750 | # The next test checks that no datagrams significantly larger than the |
| 7751 | # negotiated MFL are sent. |
| 7752 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7753 | requires_config_enabled MBEDTLS_RSA_C |
| 7754 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7755 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7756 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7757 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7758 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 7759 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7760 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7761 | crt_file=data_files/server7_int-ca.crt \ |
| 7762 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7763 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7764 | max_frag_len=2048" \ |
| 7765 | "$P_CLI dtls=1 debug_level=2 \ |
| 7766 | crt_file=data_files/server8_int-ca2.crt \ |
| 7767 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7768 | hs_timeout=2500-60000 \ |
| 7769 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7770 | 0 \ |
| 7771 | -s "found fragmented DTLS handshake message" \ |
| 7772 | -c "found fragmented DTLS handshake message" \ |
| 7773 | -C "error" |
| 7774 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7775 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7776 | requires_config_enabled MBEDTLS_RSA_C |
| 7777 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7778 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7779 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7780 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 7781 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7782 | crt_file=data_files/server7_int-ca.crt \ |
| 7783 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7784 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7785 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7786 | "$P_CLI dtls=1 debug_level=2 \ |
| 7787 | crt_file=data_files/server8_int-ca2.crt \ |
| 7788 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7789 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7790 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7791 | 0 \ |
| 7792 | -S "found fragmented DTLS handshake message" \ |
| 7793 | -C "found fragmented DTLS handshake message" \ |
| 7794 | -C "error" |
| 7795 | |
| 7796 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7797 | requires_config_enabled MBEDTLS_RSA_C |
| 7798 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7799 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7800 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7801 | run_test "DTLS fragmenting: client (MTU)" \ |
| 7802 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7803 | crt_file=data_files/server7_int-ca.crt \ |
| 7804 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7805 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7806 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7807 | "$P_CLI dtls=1 debug_level=2 \ |
| 7808 | crt_file=data_files/server8_int-ca2.crt \ |
| 7809 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7810 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7811 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7812 | 0 \ |
| 7813 | -s "found fragmented DTLS handshake message" \ |
| 7814 | -C "found fragmented DTLS handshake message" \ |
| 7815 | -C "error" |
| 7816 | |
| 7817 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7818 | requires_config_enabled MBEDTLS_RSA_C |
| 7819 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7820 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7821 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7822 | run_test "DTLS fragmenting: server (MTU)" \ |
| 7823 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7824 | crt_file=data_files/server7_int-ca.crt \ |
| 7825 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7826 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7827 | mtu=512" \ |
| 7828 | "$P_CLI dtls=1 debug_level=2 \ |
| 7829 | crt_file=data_files/server8_int-ca2.crt \ |
| 7830 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7831 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7832 | mtu=2048" \ |
| 7833 | 0 \ |
| 7834 | -S "found fragmented DTLS handshake message" \ |
| 7835 | -c "found fragmented DTLS handshake message" \ |
| 7836 | -C "error" |
| 7837 | |
| 7838 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7839 | requires_config_enabled MBEDTLS_RSA_C |
| 7840 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7841 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7842 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7843 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7844 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7845 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7846 | crt_file=data_files/server7_int-ca.crt \ |
| 7847 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7848 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 7849 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7850 | "$P_CLI dtls=1 debug_level=2 \ |
| 7851 | crt_file=data_files/server8_int-ca2.crt \ |
| 7852 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7853 | hs_timeout=2500-60000 \ |
| 7854 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7855 | 0 \ |
| 7856 | -s "found fragmented DTLS handshake message" \ |
| 7857 | -c "found fragmented DTLS handshake message" \ |
| 7858 | -C "error" |
| 7859 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7860 | # 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] | 7861 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7862 | requires_config_enabled MBEDTLS_RSA_C |
| 7863 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7864 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7865 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7866 | requires_config_enabled MBEDTLS_AES_C |
| 7867 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7868 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7869 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7870 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 7871 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7872 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7873 | crt_file=data_files/server7_int-ca.crt \ |
| 7874 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7875 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7876 | mtu=512" \ |
| 7877 | "$P_CLI dtls=1 debug_level=2 \ |
| 7878 | crt_file=data_files/server8_int-ca2.crt \ |
| 7879 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7880 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7881 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7882 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7883 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7884 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7885 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7886 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7887 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7888 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7889 | # 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] | 7890 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 7891 | # retransmissions, but in some cases (like both the server and client using |
| 7892 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 7893 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 7894 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7895 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7896 | requires_config_enabled MBEDTLS_RSA_C |
| 7897 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7898 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7899 | requires_config_enabled MBEDTLS_AES_C |
| 7900 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7901 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7902 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7903 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7904 | -p "$P_PXY mtu=508" \ |
| 7905 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7906 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7907 | key_file=data_files/server7.key \ |
| 7908 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7909 | "$P_CLI dtls=1 debug_level=2 \ |
| 7910 | crt_file=data_files/server8_int-ca2.crt \ |
| 7911 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7912 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7913 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7914 | 0 \ |
| 7915 | -s "found fragmented DTLS handshake message" \ |
| 7916 | -c "found fragmented DTLS handshake message" \ |
| 7917 | -C "error" |
| 7918 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7919 | # 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] | 7920 | only_with_valgrind |
| 7921 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7922 | requires_config_enabled MBEDTLS_RSA_C |
| 7923 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7924 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7925 | requires_config_enabled MBEDTLS_AES_C |
| 7926 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7927 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7928 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7929 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7930 | -p "$P_PXY mtu=508" \ |
| 7931 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7932 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7933 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7934 | hs_timeout=250-10000" \ |
| 7935 | "$P_CLI dtls=1 debug_level=2 \ |
| 7936 | crt_file=data_files/server8_int-ca2.crt \ |
| 7937 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7938 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7939 | hs_timeout=250-10000" \ |
| 7940 | 0 \ |
| 7941 | -s "found fragmented DTLS handshake message" \ |
| 7942 | -c "found fragmented DTLS handshake message" \ |
| 7943 | -C "error" |
| 7944 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7945 | # 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] | 7946 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7947 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7948 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7949 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7950 | requires_config_enabled MBEDTLS_RSA_C |
| 7951 | requires_config_enabled MBEDTLS_ECDSA_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 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7954 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7955 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7956 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7957 | crt_file=data_files/server7_int-ca.crt \ |
| 7958 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7959 | hs_timeout=10000-60000 \ |
| 7960 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7961 | "$P_CLI dtls=1 debug_level=2 \ |
| 7962 | crt_file=data_files/server8_int-ca2.crt \ |
| 7963 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7964 | hs_timeout=10000-60000 \ |
| 7965 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7966 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7967 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7968 | -s "found fragmented DTLS handshake message" \ |
| 7969 | -c "found fragmented DTLS handshake message" \ |
| 7970 | -C "error" |
| 7971 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7972 | # 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] | 7973 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 7974 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7975 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7976 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7977 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7978 | requires_config_enabled MBEDTLS_RSA_C |
| 7979 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7980 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7981 | requires_config_enabled MBEDTLS_AES_C |
| 7982 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7983 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7984 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7985 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7986 | -p "$P_PXY mtu=512" \ |
| 7987 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7988 | crt_file=data_files/server7_int-ca.crt \ |
| 7989 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7990 | hs_timeout=10000-60000 \ |
| 7991 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7992 | "$P_CLI dtls=1 debug_level=2 \ |
| 7993 | crt_file=data_files/server8_int-ca2.crt \ |
| 7994 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7995 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7996 | hs_timeout=10000-60000 \ |
| 7997 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7998 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7999 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8000 | -s "found fragmented DTLS handshake message" \ |
| 8001 | -c "found fragmented DTLS handshake message" \ |
| 8002 | -C "error" |
| 8003 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8004 | not_with_valgrind # spurious autoreduction due to timeout |
| 8005 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8006 | requires_config_enabled MBEDTLS_RSA_C |
| 8007 | requires_config_enabled MBEDTLS_ECDSA_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, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8011 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 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=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +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 | hs_timeout=10000-60000 \ |
| 8021 | mtu=1024 nbio=2" \ |
| 8022 | 0 \ |
| 8023 | -S "autoreduction" \ |
| 8024 | -s "found fragmented DTLS handshake message" \ |
| 8025 | -c "found fragmented DTLS handshake message" \ |
| 8026 | -C "error" |
| 8027 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8028 | # 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] | 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 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8033 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8034 | requires_config_enabled MBEDTLS_AES_C |
| 8035 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8036 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8037 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8038 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 8039 | -p "$P_PXY mtu=512" \ |
| 8040 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8041 | crt_file=data_files/server7_int-ca.crt \ |
| 8042 | key_file=data_files/server7.key \ |
| 8043 | hs_timeout=10000-60000 \ |
| 8044 | mtu=512 nbio=2" \ |
| 8045 | "$P_CLI dtls=1 debug_level=2 \ |
| 8046 | crt_file=data_files/server8_int-ca2.crt \ |
| 8047 | key_file=data_files/server8.key \ |
| 8048 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8049 | hs_timeout=10000-60000 \ |
| 8050 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8051 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8052 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8053 | -s "found fragmented DTLS handshake message" \ |
| 8054 | -c "found fragmented DTLS handshake message" \ |
| 8055 | -C "error" |
| 8056 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8057 | # 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] | 8058 | # This ensures things still work after session_reset(). |
| 8059 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8060 | # Since we don't support reading fragmented ClientHello yet, |
| 8061 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 8062 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8063 | # An autoreduction on the client-side might happen if the server is |
| 8064 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 8065 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8066 | # resumed listening, which would result in a spurious autoreduction. |
| 8067 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8068 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8069 | requires_config_enabled MBEDTLS_RSA_C |
| 8070 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8071 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8072 | requires_config_enabled MBEDTLS_AES_C |
| 8073 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8074 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8075 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8076 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 8077 | -p "$P_PXY mtu=1450" \ |
| 8078 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8079 | crt_file=data_files/server7_int-ca.crt \ |
| 8080 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8081 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8082 | mtu=1450" \ |
| 8083 | "$P_CLI dtls=1 debug_level=2 \ |
| 8084 | crt_file=data_files/server8_int-ca2.crt \ |
| 8085 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8086 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8087 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 8088 | 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] | 8089 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8090 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8091 | -s "found fragmented DTLS handshake message" \ |
| 8092 | -c "found fragmented DTLS handshake message" \ |
| 8093 | -C "error" |
| 8094 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8095 | # An autoreduction on the client-side might happen if the server is |
| 8096 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8097 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8098 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8099 | requires_config_enabled MBEDTLS_RSA_C |
| 8100 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8101 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8102 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8103 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8104 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8105 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8106 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8107 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 8108 | -p "$P_PXY mtu=512" \ |
| 8109 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8110 | crt_file=data_files/server7_int-ca.crt \ |
| 8111 | key_file=data_files/server7.key \ |
| 8112 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8113 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8114 | mtu=512" \ |
| 8115 | "$P_CLI dtls=1 debug_level=2 \ |
| 8116 | crt_file=data_files/server8_int-ca2.crt \ |
| 8117 | key_file=data_files/server8.key \ |
| 8118 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8119 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8120 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8121 | mtu=512" \ |
| 8122 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8123 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8124 | -s "found fragmented DTLS handshake message" \ |
| 8125 | -c "found fragmented DTLS handshake message" \ |
| 8126 | -C "error" |
| 8127 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8128 | # An autoreduction on the client-side might happen if the server is |
| 8129 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8130 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8131 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8132 | requires_config_enabled MBEDTLS_RSA_C |
| 8133 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8134 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8135 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8136 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8137 | requires_config_enabled MBEDTLS_AES_C |
| 8138 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8139 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8140 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8141 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 8142 | -p "$P_PXY mtu=512" \ |
| 8143 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8144 | crt_file=data_files/server7_int-ca.crt \ |
| 8145 | key_file=data_files/server7.key \ |
| 8146 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8147 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8148 | mtu=512" \ |
| 8149 | "$P_CLI dtls=1 debug_level=2 \ |
| 8150 | crt_file=data_files/server8_int-ca2.crt \ |
| 8151 | key_file=data_files/server8.key \ |
| 8152 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8153 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8154 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8155 | mtu=512" \ |
| 8156 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8157 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8158 | -s "found fragmented DTLS handshake message" \ |
| 8159 | -c "found fragmented DTLS handshake message" \ |
| 8160 | -C "error" |
| 8161 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8162 | # An autoreduction on the client-side might happen if the server is |
| 8163 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8164 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8165 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8166 | requires_config_enabled MBEDTLS_RSA_C |
| 8167 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8168 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8169 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8170 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8171 | requires_config_enabled MBEDTLS_AES_C |
| 8172 | requires_config_enabled MBEDTLS_CCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8173 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8174 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8175 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8176 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8177 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8178 | crt_file=data_files/server7_int-ca.crt \ |
| 8179 | key_file=data_files/server7.key \ |
| 8180 | exchanges=2 renegotiation=1 \ |
| 8181 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8182 | hs_timeout=10000-60000 \ |
| 8183 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8184 | "$P_CLI dtls=1 debug_level=2 \ |
| 8185 | crt_file=data_files/server8_int-ca2.crt \ |
| 8186 | key_file=data_files/server8.key \ |
| 8187 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8188 | hs_timeout=10000-60000 \ |
| 8189 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8190 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8191 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8192 | -s "found fragmented DTLS handshake message" \ |
| 8193 | -c "found fragmented DTLS handshake message" \ |
| 8194 | -C "error" |
| 8195 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8196 | # An autoreduction on the client-side might happen if the server is |
| 8197 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8198 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8199 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8200 | requires_config_enabled MBEDTLS_RSA_C |
| 8201 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8202 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8203 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8204 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8205 | requires_config_enabled MBEDTLS_AES_C |
| 8206 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8207 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8208 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8209 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8210 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8211 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8212 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8213 | crt_file=data_files/server7_int-ca.crt \ |
| 8214 | key_file=data_files/server7.key \ |
| 8215 | exchanges=2 renegotiation=1 \ |
| 8216 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8217 | hs_timeout=10000-60000 \ |
| 8218 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8219 | "$P_CLI dtls=1 debug_level=2 \ |
| 8220 | crt_file=data_files/server8_int-ca2.crt \ |
| 8221 | key_file=data_files/server8.key \ |
| 8222 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8223 | hs_timeout=10000-60000 \ |
| 8224 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8225 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8226 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8227 | -s "found fragmented DTLS handshake message" \ |
| 8228 | -c "found fragmented DTLS handshake message" \ |
| 8229 | -C "error" |
| 8230 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8231 | # An autoreduction on the client-side might happen if the server is |
| 8232 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8233 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8234 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8235 | requires_config_enabled MBEDTLS_RSA_C |
| 8236 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8237 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8238 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8239 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8240 | requires_config_enabled MBEDTLS_AES_C |
| 8241 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8242 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8243 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8244 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8245 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8246 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8247 | crt_file=data_files/server7_int-ca.crt \ |
| 8248 | key_file=data_files/server7.key \ |
| 8249 | exchanges=2 renegotiation=1 \ |
| 8250 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8251 | hs_timeout=10000-60000 \ |
| 8252 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8253 | "$P_CLI dtls=1 debug_level=2 \ |
| 8254 | crt_file=data_files/server8_int-ca2.crt \ |
| 8255 | key_file=data_files/server8.key \ |
| 8256 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8257 | hs_timeout=10000-60000 \ |
| 8258 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8259 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8260 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8261 | -s "found fragmented DTLS handshake message" \ |
| 8262 | -c "found fragmented DTLS handshake message" \ |
| 8263 | -C "error" |
| 8264 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8265 | # 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] | 8266 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8267 | requires_config_enabled MBEDTLS_RSA_C |
| 8268 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8269 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8270 | requires_config_enabled MBEDTLS_AES_C |
| 8271 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8272 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8273 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8274 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8275 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 8276 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8277 | "$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] | 8278 | crt_file=data_files/server7_int-ca.crt \ |
| 8279 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8280 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8281 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8282 | crt_file=data_files/server8_int-ca2.crt \ |
| 8283 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8284 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8285 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8286 | 0 \ |
| 8287 | -s "found fragmented DTLS handshake message" \ |
| 8288 | -c "found fragmented DTLS handshake message" \ |
| 8289 | -C "error" |
| 8290 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8291 | # 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] | 8292 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8293 | requires_config_enabled MBEDTLS_RSA_C |
| 8294 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8295 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8296 | requires_config_enabled MBEDTLS_AES_C |
| 8297 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8298 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8299 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8300 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8301 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 8302 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 8303 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8304 | crt_file=data_files/server7_int-ca.crt \ |
| 8305 | key_file=data_files/server7.key \ |
| 8306 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 8307 | "$P_CLI dtls=1 debug_level=2 \ |
| 8308 | crt_file=data_files/server8_int-ca2.crt \ |
| 8309 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8310 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8311 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 8312 | 0 \ |
| 8313 | -s "found fragmented DTLS handshake message" \ |
| 8314 | -c "found fragmented DTLS handshake message" \ |
| 8315 | -C "error" |
| 8316 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8317 | # interop tests for DTLS fragmentating with reliable connection |
| 8318 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8319 | # here and below we just want to test that the we fragment in a way that |
| 8320 | # pleases other implementations, so we don't need the peer to fragment |
| 8321 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8322 | requires_config_enabled MBEDTLS_RSA_C |
| 8323 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8324 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8325 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8326 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8327 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8328 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 8329 | "$G_SRV -u" \ |
| 8330 | "$P_CLI dtls=1 debug_level=2 \ |
| 8331 | crt_file=data_files/server8_int-ca2.crt \ |
| 8332 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8333 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8334 | 0 \ |
| 8335 | -c "fragmenting handshake message" \ |
| 8336 | -C "error" |
| 8337 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 8338 | # We use --insecure for the GnuTLS client because it expects |
| 8339 | # the hostname / IP it connects to to be the name used in the |
| 8340 | # certificate obtained from the server. Here, however, it |
| 8341 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 8342 | # as the server name in the certificate. This will make the |
| 8343 | # certifiate validation fail, but passing --insecure makes |
| 8344 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8345 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8346 | requires_config_enabled MBEDTLS_RSA_C |
| 8347 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8348 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8349 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 8350 | requires_not_i686 |
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 client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8354 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8355 | crt_file=data_files/server7_int-ca.crt \ |
| 8356 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8357 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8358 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8359 | 0 \ |
| 8360 | -s "fragmenting handshake message" |
| 8361 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8362 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8363 | requires_config_enabled MBEDTLS_RSA_C |
| 8364 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8365 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8366 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8367 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8368 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 8369 | "$O_SRV -dtls1_2 -verify 10" \ |
| 8370 | "$P_CLI dtls=1 debug_level=2 \ |
| 8371 | crt_file=data_files/server8_int-ca2.crt \ |
| 8372 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8373 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8374 | 0 \ |
| 8375 | -c "fragmenting handshake message" \ |
| 8376 | -C "error" |
| 8377 | |
| 8378 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8379 | requires_config_enabled MBEDTLS_RSA_C |
| 8380 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8381 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8382 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8383 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8384 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 8385 | "$P_SRV dtls=1 debug_level=2 \ |
| 8386 | crt_file=data_files/server7_int-ca.crt \ |
| 8387 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8388 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8389 | "$O_CLI -dtls1_2" \ |
| 8390 | 0 \ |
| 8391 | -s "fragmenting handshake message" |
| 8392 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8393 | # interop tests for DTLS fragmentating with unreliable connection |
| 8394 | # |
| 8395 | # again we just want to test that the we fragment in a way that |
| 8396 | # pleases other implementations, so we don't need the peer to fragment |
| 8397 | requires_gnutls_next |
| 8398 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8399 | requires_config_enabled MBEDTLS_RSA_C |
| 8400 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8401 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8402 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8403 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8404 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8405 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 8406 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8407 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8408 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8409 | crt_file=data_files/server8_int-ca2.crt \ |
| 8410 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8411 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8412 | 0 \ |
| 8413 | -c "fragmenting handshake message" \ |
| 8414 | -C "error" |
| 8415 | |
| 8416 | requires_gnutls_next |
| 8417 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8418 | requires_config_enabled MBEDTLS_RSA_C |
| 8419 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8420 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8421 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8422 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8423 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8424 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 8425 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8426 | "$P_SRV dtls=1 debug_level=2 \ |
| 8427 | crt_file=data_files/server7_int-ca.crt \ |
| 8428 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8429 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8430 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8431 | 0 \ |
| 8432 | -s "fragmenting handshake message" |
| 8433 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8434 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 8435 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8436 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8437 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8438 | ## (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] | 8439 | skip_next_test |
| 8440 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8441 | requires_config_enabled MBEDTLS_RSA_C |
| 8442 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8443 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8444 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8445 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8446 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8447 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 8448 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8449 | "$O_SRV -dtls1_2 -verify 10" \ |
| 8450 | "$P_CLI dtls=1 debug_level=2 \ |
| 8451 | crt_file=data_files/server8_int-ca2.crt \ |
| 8452 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8453 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8454 | 0 \ |
| 8455 | -c "fragmenting handshake message" \ |
| 8456 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8457 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8458 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8459 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8460 | requires_config_enabled MBEDTLS_RSA_C |
| 8461 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8462 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8463 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8464 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8465 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8466 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 8467 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8468 | "$P_SRV dtls=1 debug_level=2 \ |
| 8469 | crt_file=data_files/server7_int-ca.crt \ |
| 8470 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8471 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8472 | "$O_CLI -dtls1_2" \ |
| 8473 | 0 \ |
| 8474 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8475 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8476 | # Tests for DTLS-SRTP (RFC 5764) |
| 8477 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8478 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8479 | run_test "DTLS-SRTP all profiles supported" \ |
| 8480 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8481 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8482 | 0 \ |
| 8483 | -s "found use_srtp extension" \ |
| 8484 | -s "found srtp profile" \ |
| 8485 | -s "selected srtp profile" \ |
| 8486 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8487 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8488 | -c "client hello, adding use_srtp extension" \ |
| 8489 | -c "found use_srtp extension" \ |
| 8490 | -c "found srtp profile" \ |
| 8491 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8492 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8493 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8494 | -C "error" |
| 8495 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8496 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8497 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8498 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8499 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 8500 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8501 | "$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] | 8502 | 0 \ |
| 8503 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8504 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 8505 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8506 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8507 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8508 | -c "client hello, adding use_srtp extension" \ |
| 8509 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8510 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8511 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8512 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8513 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8514 | -C "error" |
| 8515 | |
| 8516 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8517 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8518 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8519 | "$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] | 8520 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8521 | 0 \ |
| 8522 | -s "found use_srtp extension" \ |
| 8523 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8524 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8525 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8526 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8527 | -c "client hello, adding use_srtp extension" \ |
| 8528 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8529 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8530 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8531 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8532 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8533 | -C "error" |
| 8534 | |
| 8535 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8536 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8537 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 8538 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8539 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8540 | 0 \ |
| 8541 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8542 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8543 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8544 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8545 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8546 | -c "client hello, adding use_srtp extension" \ |
| 8547 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8548 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8549 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8550 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8551 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8552 | -C "error" |
| 8553 | |
| 8554 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8555 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8556 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 8557 | "$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] | 8558 | "$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] | 8559 | 0 \ |
| 8560 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8561 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8562 | -S "selected srtp profile" \ |
| 8563 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8564 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8565 | -c "client hello, adding use_srtp extension" \ |
| 8566 | -C "found use_srtp extension" \ |
| 8567 | -C "found srtp profile" \ |
| 8568 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8569 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8570 | -C "error" |
| 8571 | |
| 8572 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8573 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8574 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 8575 | "$P_SRV dtls=1 debug_level=3" \ |
| 8576 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8577 | 0 \ |
| 8578 | -s "found use_srtp extension" \ |
| 8579 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8580 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8581 | -c "client hello, adding use_srtp extension" \ |
| 8582 | -C "found use_srtp extension" \ |
| 8583 | -C "found srtp profile" \ |
| 8584 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8585 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8586 | -C "error" |
| 8587 | |
| 8588 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8589 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8590 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 8591 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 8592 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8593 | 0 \ |
| 8594 | -s "found use_srtp extension" \ |
| 8595 | -s "found srtp profile" \ |
| 8596 | -s "selected srtp profile" \ |
| 8597 | -s "server hello, adding use_srtp extension" \ |
| 8598 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8599 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8600 | -c "client hello, adding use_srtp extension" \ |
| 8601 | -c "found use_srtp extension" \ |
| 8602 | -c "found srtp profile" \ |
| 8603 | -c "selected srtp profile" \ |
| 8604 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8605 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8606 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8607 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 8608 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8609 | -C "error" |
| 8610 | |
| 8611 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8612 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8613 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 8614 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8615 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8616 | 0 \ |
| 8617 | -s "found use_srtp extension" \ |
| 8618 | -s "found srtp profile" \ |
| 8619 | -s "selected srtp profile" \ |
| 8620 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8621 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 8622 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8623 | -S "dumping 'using mki' (8 bytes)" \ |
| 8624 | -c "client hello, adding use_srtp extension" \ |
| 8625 | -c "found use_srtp extension" \ |
| 8626 | -c "found srtp profile" \ |
| 8627 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8628 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 8629 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8630 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8631 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8632 | -C "dumping 'received mki' (8 bytes)" \ |
| 8633 | -C "error" |
| 8634 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8635 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8636 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8637 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 8638 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8639 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8640 | 0 \ |
| 8641 | -s "found use_srtp extension" \ |
| 8642 | -s "found srtp profile" \ |
| 8643 | -s "selected srtp profile" \ |
| 8644 | -s "server hello, adding use_srtp extension" \ |
| 8645 | -s "DTLS-SRTP key material is"\ |
| 8646 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 8647 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 8648 | |
| 8649 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8650 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8651 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 8652 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8653 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8654 | 0 \ |
| 8655 | -s "found use_srtp extension" \ |
| 8656 | -s "found srtp profile" \ |
| 8657 | -s "selected srtp profile" \ |
| 8658 | -s "server hello, adding use_srtp extension" \ |
| 8659 | -s "DTLS-SRTP key material is"\ |
| 8660 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 8661 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8662 | |
| 8663 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8664 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8665 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 8666 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8667 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8668 | 0 \ |
| 8669 | -s "found use_srtp extension" \ |
| 8670 | -s "found srtp profile" \ |
| 8671 | -s "selected srtp profile" \ |
| 8672 | -s "server hello, adding use_srtp extension" \ |
| 8673 | -s "DTLS-SRTP key material is"\ |
| 8674 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 8675 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8676 | |
| 8677 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8678 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8679 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 8680 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8681 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8682 | 0 \ |
| 8683 | -s "found use_srtp extension" \ |
| 8684 | -s "found srtp profile" \ |
| 8685 | -s "selected srtp profile" \ |
| 8686 | -s "server hello, adding use_srtp extension" \ |
| 8687 | -s "DTLS-SRTP key material is"\ |
| 8688 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 8689 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8690 | |
| 8691 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8692 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8693 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 8694 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8695 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8696 | 0 \ |
| 8697 | -s "found use_srtp extension" \ |
| 8698 | -s "found srtp profile" \ |
| 8699 | -s "selected srtp profile" \ |
| 8700 | -s "server hello, adding use_srtp extension" \ |
| 8701 | -s "DTLS-SRTP key material is"\ |
| 8702 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 8703 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8704 | |
| 8705 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8706 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8707 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 8708 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 8709 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8710 | 0 \ |
| 8711 | -s "found use_srtp extension" \ |
| 8712 | -s "found srtp profile" \ |
| 8713 | -S "selected srtp profile" \ |
| 8714 | -S "server hello, adding use_srtp extension" \ |
| 8715 | -S "DTLS-SRTP key material is"\ |
| 8716 | -C "SRTP Extension negotiated, profile" |
| 8717 | |
| 8718 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8719 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8720 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 8721 | "$P_SRV dtls=1 debug_level=3" \ |
| 8722 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8723 | 0 \ |
| 8724 | -s "found use_srtp extension" \ |
| 8725 | -S "server hello, adding use_srtp extension" \ |
| 8726 | -S "DTLS-SRTP key material is"\ |
| 8727 | -C "SRTP Extension negotiated, profile" |
| 8728 | |
| 8729 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8730 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8731 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 8732 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8733 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8734 | 0 \ |
| 8735 | -c "client hello, adding use_srtp extension" \ |
| 8736 | -c "found use_srtp extension" \ |
| 8737 | -c "found srtp profile" \ |
| 8738 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 8739 | -c "DTLS-SRTP key material is"\ |
| 8740 | -C "error" |
| 8741 | |
| 8742 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8743 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8744 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 8745 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8746 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8747 | 0 \ |
| 8748 | -c "client hello, adding use_srtp extension" \ |
| 8749 | -c "found use_srtp extension" \ |
| 8750 | -c "found srtp profile" \ |
| 8751 | -c "selected srtp profile" \ |
| 8752 | -c "DTLS-SRTP key material is"\ |
| 8753 | -C "error" |
| 8754 | |
| 8755 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8756 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8757 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 8758 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8759 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8760 | 0 \ |
| 8761 | -c "client hello, adding use_srtp extension" \ |
| 8762 | -c "found use_srtp extension" \ |
| 8763 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8764 | -c "selected srtp profile" \ |
| 8765 | -c "DTLS-SRTP key material is"\ |
| 8766 | -C "error" |
| 8767 | |
| 8768 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8769 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8770 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 8771 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8772 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8773 | 0 \ |
| 8774 | -c "client hello, adding use_srtp extension" \ |
| 8775 | -c "found use_srtp extension" \ |
| 8776 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8777 | -c "selected srtp profile" \ |
| 8778 | -c "DTLS-SRTP key material is"\ |
| 8779 | -C "error" |
| 8780 | |
| 8781 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8782 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8783 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 8784 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8785 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8786 | 0 \ |
| 8787 | -c "client hello, adding use_srtp extension" \ |
| 8788 | -c "found use_srtp extension" \ |
| 8789 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8790 | -c "selected srtp profile" \ |
| 8791 | -c "DTLS-SRTP key material is"\ |
| 8792 | -C "error" |
| 8793 | |
| 8794 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8795 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8796 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 8797 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8798 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 8799 | 0 \ |
| 8800 | -c "client hello, adding use_srtp extension" \ |
| 8801 | -C "found use_srtp extension" \ |
| 8802 | -C "found srtp profile" \ |
| 8803 | -C "selected srtp profile" \ |
| 8804 | -C "DTLS-SRTP key material is"\ |
| 8805 | -C "error" |
| 8806 | |
| 8807 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8808 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8809 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 8810 | "$O_SRV -dtls" \ |
| 8811 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8812 | 0 \ |
| 8813 | -c "client hello, adding use_srtp extension" \ |
| 8814 | -C "found use_srtp extension" \ |
| 8815 | -C "found srtp profile" \ |
| 8816 | -C "selected srtp profile" \ |
| 8817 | -C "DTLS-SRTP key material is"\ |
| 8818 | -C "error" |
| 8819 | |
| 8820 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8821 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8822 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 8823 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8824 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8825 | 0 \ |
| 8826 | -c "client hello, adding use_srtp extension" \ |
| 8827 | -c "found use_srtp extension" \ |
| 8828 | -c "found srtp profile" \ |
| 8829 | -c "selected srtp profile" \ |
| 8830 | -c "DTLS-SRTP key material is"\ |
| 8831 | -c "DTLS-SRTP no mki value negotiated"\ |
| 8832 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8833 | -C "dumping 'received mki' (8 bytes)" \ |
| 8834 | -C "error" |
| 8835 | |
| 8836 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8837 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8838 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8839 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8840 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8841 | "$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] | 8842 | 0 \ |
| 8843 | -s "found use_srtp extension" \ |
| 8844 | -s "found srtp profile" \ |
| 8845 | -s "selected srtp profile" \ |
| 8846 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8847 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8848 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 8849 | |
| 8850 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8851 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8852 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8853 | 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] | 8854 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8855 | "$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] | 8856 | 0 \ |
| 8857 | -s "found use_srtp extension" \ |
| 8858 | -s "found srtp profile" \ |
| 8859 | -s "selected srtp profile" \ |
| 8860 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8861 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8862 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 8863 | |
| 8864 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8865 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8866 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8867 | 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] | 8868 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8869 | "$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] | 8870 | 0 \ |
| 8871 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8872 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8873 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8874 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8875 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8876 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 8877 | |
| 8878 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8879 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8880 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8881 | 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] | 8882 | "$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] | 8883 | "$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] | 8884 | 0 \ |
| 8885 | -s "found use_srtp extension" \ |
| 8886 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8887 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8888 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8889 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8890 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 8891 | |
| 8892 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8893 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8894 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8895 | 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] | 8896 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8897 | "$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] | 8898 | 0 \ |
| 8899 | -s "found use_srtp extension" \ |
| 8900 | -s "found srtp profile" \ |
| 8901 | -s "selected srtp profile" \ |
| 8902 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8903 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8904 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 8905 | |
| 8906 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8907 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8908 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8909 | 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] | 8910 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 8911 | "$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] | 8912 | 0 \ |
| 8913 | -s "found use_srtp extension" \ |
| 8914 | -s "found srtp profile" \ |
| 8915 | -S "selected srtp profile" \ |
| 8916 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8917 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8918 | -C "SRTP profile:" |
| 8919 | |
| 8920 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8921 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8922 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8923 | 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] | 8924 | "$P_SRV dtls=1 debug_level=3" \ |
| 8925 | "$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] | 8926 | 0 \ |
| 8927 | -s "found use_srtp extension" \ |
| 8928 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8929 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8930 | -C "SRTP profile:" |
| 8931 | |
| 8932 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8933 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8934 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8935 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 8936 | "$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" \ |
| 8937 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8938 | 0 \ |
| 8939 | -c "client hello, adding use_srtp extension" \ |
| 8940 | -c "found use_srtp extension" \ |
| 8941 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8942 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8943 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8944 | -C "error" |
| 8945 | |
| 8946 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8947 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8948 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8949 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 8950 | "$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" \ |
| 8951 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8952 | 0 \ |
| 8953 | -c "client hello, adding use_srtp extension" \ |
| 8954 | -c "found use_srtp extension" \ |
| 8955 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8956 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8957 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8958 | -C "error" |
| 8959 | |
| 8960 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8961 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8962 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8963 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 8964 | "$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" \ |
| 8965 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8966 | 0 \ |
| 8967 | -c "client hello, adding use_srtp extension" \ |
| 8968 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8969 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8970 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8971 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8972 | -C "error" |
| 8973 | |
| 8974 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8975 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8976 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8977 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 8978 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8979 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8980 | 0 \ |
| 8981 | -c "client hello, adding use_srtp extension" \ |
| 8982 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8983 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8984 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8985 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8986 | -C "error" |
| 8987 | |
| 8988 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8989 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8990 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8991 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 8992 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8993 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8994 | 0 \ |
| 8995 | -c "client hello, adding use_srtp extension" \ |
| 8996 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8997 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8998 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8999 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9000 | -C "error" |
| 9001 | |
| 9002 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9003 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9004 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9005 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 9006 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9007 | "$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] | 9008 | 0 \ |
| 9009 | -c "client hello, adding use_srtp extension" \ |
| 9010 | -C "found use_srtp extension" \ |
| 9011 | -C "found srtp profile" \ |
| 9012 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9013 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9014 | -C "error" |
| 9015 | |
| 9016 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9017 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9018 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9019 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 9020 | "$G_SRV -u" \ |
| 9021 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9022 | 0 \ |
| 9023 | -c "client hello, adding use_srtp extension" \ |
| 9024 | -C "found use_srtp extension" \ |
| 9025 | -C "found srtp profile" \ |
| 9026 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9027 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9028 | -C "error" |
| 9029 | |
| 9030 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9031 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9032 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9033 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 9034 | "$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" \ |
| 9035 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9036 | 0 \ |
| 9037 | -c "client hello, adding use_srtp extension" \ |
| 9038 | -c "found use_srtp extension" \ |
| 9039 | -c "found srtp profile" \ |
| 9040 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9041 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 9042 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9043 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9044 | -c "dumping 'received mki' (8 bytes)" \ |
| 9045 | -C "error" |
| 9046 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 9047 | # Tests for specific things with "unreliable" UDP connection |
| 9048 | |
| 9049 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9050 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 9051 | run_test "DTLS proxy: reference" \ |
| 9052 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9053 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 9054 | "$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] | 9055 | 0 \ |
| 9056 | -C "replayed record" \ |
| 9057 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 9058 | -C "Buffer record from epoch" \ |
| 9059 | -S "Buffer record from epoch" \ |
| 9060 | -C "ssl_buffer_message" \ |
| 9061 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 9062 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9063 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 9064 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9065 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 9066 | -c "HTTP/1.0 200 OK" |
| 9067 | |
| 9068 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9069 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9070 | run_test "DTLS proxy: duplicate every packet" \ |
| 9071 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9072 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 9073 | "$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] | 9074 | 0 \ |
| 9075 | -c "replayed record" \ |
| 9076 | -s "replayed record" \ |
| 9077 | -c "record from another epoch" \ |
| 9078 | -s "record from another epoch" \ |
| 9079 | -S "resend" \ |
| 9080 | -s "Extra-header:" \ |
| 9081 | -c "HTTP/1.0 200 OK" |
| 9082 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9083 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9084 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 9085 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9086 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 9087 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9088 | 0 \ |
| 9089 | -c "replayed record" \ |
| 9090 | -S "replayed record" \ |
| 9091 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9092 | -s "record from another epoch" \ |
| 9093 | -c "resend" \ |
| 9094 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9095 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9096 | -c "HTTP/1.0 200 OK" |
| 9097 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9098 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9099 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 9100 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9101 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 9102 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9103 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9104 | -c "next record in same datagram" \ |
| 9105 | -s "next record in same datagram" |
| 9106 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9107 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9108 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 9109 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9110 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 9111 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9112 | 0 \ |
| 9113 | -c "next record in same datagram" \ |
| 9114 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9115 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9116 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9117 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 9118 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9119 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 9120 | "$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] | 9121 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9122 | -c "discarding invalid record (mac)" \ |
| 9123 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9124 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9125 | -c "HTTP/1.0 200 OK" \ |
| 9126 | -S "too many records with bad MAC" \ |
| 9127 | -S "Verification of the message MAC failed" |
| 9128 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9129 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9130 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 9131 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9132 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 9133 | "$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] | 9134 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9135 | -C "discarding invalid record (mac)" \ |
| 9136 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9137 | -S "Extra-header:" \ |
| 9138 | -C "HTTP/1.0 200 OK" \ |
| 9139 | -s "too many records with bad MAC" \ |
| 9140 | -s "Verification of the message MAC failed" |
| 9141 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9142 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9143 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 9144 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9145 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 9146 | "$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] | 9147 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9148 | -c "discarding invalid record (mac)" \ |
| 9149 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9150 | -s "Extra-header:" \ |
| 9151 | -c "HTTP/1.0 200 OK" \ |
| 9152 | -S "too many records with bad MAC" \ |
| 9153 | -S "Verification of the message MAC failed" |
| 9154 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9155 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9156 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 9157 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9158 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 9159 | "$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] | 9160 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9161 | -c "discarding invalid record (mac)" \ |
| 9162 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9163 | -s "Extra-header:" \ |
| 9164 | -c "HTTP/1.0 200 OK" \ |
| 9165 | -s "too many records with bad MAC" \ |
| 9166 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9167 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9168 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9169 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 9170 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 9171 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 9172 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9173 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9174 | -c "record from another epoch" \ |
| 9175 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9176 | -s "Extra-header:" \ |
| 9177 | -c "HTTP/1.0 200 OK" |
| 9178 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 9179 | # Tests for reordering support with DTLS |
| 9180 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9181 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9182 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 9183 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9184 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9185 | hs_timeout=2500-60000" \ |
| 9186 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9187 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 9188 | 0 \ |
| 9189 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9190 | -c "Next handshake message has been buffered - load"\ |
| 9191 | -S "Buffering HS message" \ |
| 9192 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9193 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9194 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9195 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9196 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 9197 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9198 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9199 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 9200 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9201 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9202 | hs_timeout=2500-60000" \ |
| 9203 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9204 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9205 | 0 \ |
| 9206 | -c "Buffering HS message" \ |
| 9207 | -c "found fragmented DTLS handshake message"\ |
| 9208 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 9209 | -c "Next handshake message has been buffered - load"\ |
| 9210 | -S "Buffering HS message" \ |
| 9211 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9212 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9213 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9214 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 9215 | -S "Remember CCS message" |
| 9216 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9217 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 9218 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 9219 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 9220 | # while keeping the ServerKeyExchange. |
| 9221 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9222 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9223 | 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] | 9224 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9225 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9226 | hs_timeout=2500-60000" \ |
| 9227 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9228 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9229 | 0 \ |
| 9230 | -c "Buffering HS message" \ |
| 9231 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9232 | -C "attempt to make space by freeing buffered messages" \ |
| 9233 | -S "Buffering HS message" \ |
| 9234 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9235 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9236 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9237 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9238 | -S "Remember CCS message" |
| 9239 | |
| 9240 | # The size constraints ensure that the delayed certificate message can't |
| 9241 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 9242 | # when dropping it first. |
| 9243 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 9244 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9245 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9246 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 9247 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9248 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9249 | hs_timeout=2500-60000" \ |
| 9250 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9251 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9252 | 0 \ |
| 9253 | -c "Buffering HS message" \ |
| 9254 | -c "attempt to make space by freeing buffered future messages" \ |
| 9255 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9256 | -S "Buffering HS message" \ |
| 9257 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9258 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9259 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9260 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9261 | -S "Remember CCS message" |
| 9262 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9263 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9264 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 9265 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9266 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 9267 | hs_timeout=2500-60000" \ |
| 9268 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9269 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9270 | 0 \ |
| 9271 | -C "Buffering HS message" \ |
| 9272 | -C "Next handshake message has been buffered - load"\ |
| 9273 | -s "Buffering HS message" \ |
| 9274 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9275 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9276 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9277 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9278 | -S "Remember CCS message" |
| 9279 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9280 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9281 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 9282 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9283 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9284 | hs_timeout=2500-60000" \ |
| 9285 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9286 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9287 | 0 \ |
| 9288 | -C "Buffering HS message" \ |
| 9289 | -C "Next handshake message has been buffered - load"\ |
| 9290 | -S "Buffering HS message" \ |
| 9291 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9292 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9293 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9294 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9295 | -S "Remember CCS message" |
| 9296 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9297 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9298 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 9299 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9300 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9301 | hs_timeout=2500-60000" \ |
| 9302 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9303 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9304 | 0 \ |
| 9305 | -C "Buffering HS message" \ |
| 9306 | -C "Next handshake message has been buffered - load"\ |
| 9307 | -S "Buffering HS message" \ |
| 9308 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9309 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9310 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9311 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9312 | -s "Remember CCS message" |
| 9313 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9314 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9315 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9316 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9317 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9318 | hs_timeout=2500-60000" \ |
| 9319 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9320 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 9321 | 0 \ |
| 9322 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9323 | -s "Found buffered record from current epoch - load" \ |
| 9324 | -c "Buffer record from epoch 1" \ |
| 9325 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9326 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9327 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 9328 | # from the server are delayed, so that the encrypted Finished message |
| 9329 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 9330 | # in afterwards, the encrypted Finished message must be freed in order |
| 9331 | # to make space for the NewSessionTicket to be reassembled. |
| 9332 | # This works only in very particular circumstances: |
| 9333 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 9334 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 9335 | # the encrypted Finished message. |
| 9336 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 9337 | # needs to be fragmented. |
| 9338 | # - All messages sent by the server must be small enough to be either sent |
| 9339 | # without fragmentation or be reassembled within the bounds of |
| 9340 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 9341 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 9342 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 9343 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9344 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9345 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 9346 | -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] | 9347 | "$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] | 9348 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 9349 | 0 \ |
| 9350 | -s "Buffer record from epoch 1" \ |
| 9351 | -s "Found buffered record from current epoch - load" \ |
| 9352 | -c "Buffer record from epoch 1" \ |
| 9353 | -C "Found buffered record from current epoch - load" \ |
| 9354 | -c "Enough space available after freeing future epoch record" |
| 9355 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 9356 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 9357 | |
| 9358 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9359 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9360 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 9361 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9362 | "$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] | 9363 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9364 | "$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] | 9365 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9366 | 0 \ |
| 9367 | -s "Extra-header:" \ |
| 9368 | -c "HTTP/1.0 200 OK" |
| 9369 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9370 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9371 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9372 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 9373 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9374 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 9375 | "$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] | 9376 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9377 | 0 \ |
| 9378 | -s "Extra-header:" \ |
| 9379 | -c "HTTP/1.0 200 OK" |
| 9380 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9381 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9382 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9383 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 9384 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9385 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 9386 | "$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] | 9387 | 0 \ |
| 9388 | -s "Extra-header:" \ |
| 9389 | -c "HTTP/1.0 200 OK" |
| 9390 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9391 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9392 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9393 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 9394 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9395 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 9396 | "$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] | 9397 | 0 \ |
| 9398 | -s "Extra-header:" \ |
| 9399 | -c "HTTP/1.0 200 OK" |
| 9400 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9401 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9402 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9403 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 9404 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9405 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 9406 | "$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] | 9407 | 0 \ |
| 9408 | -s "Extra-header:" \ |
| 9409 | -c "HTTP/1.0 200 OK" |
| 9410 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9411 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9412 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9413 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 9414 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9415 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 9416 | "$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] | 9417 | 0 \ |
| 9418 | -s "Extra-header:" \ |
| 9419 | -c "HTTP/1.0 200 OK" |
| 9420 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9421 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9422 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9423 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 9424 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9425 | "$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] | 9426 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9427 | "$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] | 9428 | 0 \ |
| 9429 | -s "Extra-header:" \ |
| 9430 | -c "HTTP/1.0 200 OK" |
| 9431 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9432 | client_needs_more_time 4 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9433 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 9434 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 9435 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9436 | "$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] | 9437 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9438 | "$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] | 9439 | 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] | 9440 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9441 | 0 \ |
| 9442 | -s "a session has been resumed" \ |
| 9443 | -c "a session has been resumed" \ |
| 9444 | -s "Extra-header:" \ |
| 9445 | -c "HTTP/1.0 200 OK" |
| 9446 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9447 | client_needs_more_time 4 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9448 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 9449 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 9450 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9451 | "$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] | 9452 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9453 | "$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] | 9454 | 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] | 9455 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 9456 | 0 \ |
| 9457 | -s "a session has been resumed" \ |
| 9458 | -c "a session has been resumed" \ |
| 9459 | -s "Extra-header:" \ |
| 9460 | -c "HTTP/1.0 200 OK" |
| 9461 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9462 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9463 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9464 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9465 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 9466 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9467 | "$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] | 9468 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9469 | "$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] | 9470 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 9471 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9472 | 0 \ |
| 9473 | -c "=> renegotiate" \ |
| 9474 | -s "=> renegotiate" \ |
| 9475 | -s "Extra-header:" \ |
| 9476 | -c "HTTP/1.0 200 OK" |
| 9477 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9478 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9479 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9480 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9481 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 9482 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9483 | "$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] | 9484 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9485 | "$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] | 9486 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9487 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9488 | 0 \ |
| 9489 | -c "=> renegotiate" \ |
| 9490 | -s "=> renegotiate" \ |
| 9491 | -s "Extra-header:" \ |
| 9492 | -c "HTTP/1.0 200 OK" |
| 9493 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9494 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9495 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9496 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9497 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 9498 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9499 | "$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] | 9500 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9501 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9502 | "$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] | 9503 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9504 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9505 | 0 \ |
| 9506 | -c "=> renegotiate" \ |
| 9507 | -s "=> renegotiate" \ |
| 9508 | -s "Extra-header:" \ |
| 9509 | -c "HTTP/1.0 200 OK" |
| 9510 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9511 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9512 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9513 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9514 | 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] | 9515 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9516 | "$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] | 9517 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9518 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9519 | "$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] | 9520 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9521 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9522 | 0 \ |
| 9523 | -c "=> renegotiate" \ |
| 9524 | -s "=> renegotiate" \ |
| 9525 | -s "Extra-header:" \ |
| 9526 | -c "HTTP/1.0 200 OK" |
| 9527 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9528 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 9529 | ## all versions installed on the CI machines), reported here: |
| 9530 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 9531 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 9532 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 9533 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9534 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9535 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9536 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9537 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 9538 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 9539 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9540 | "$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] | 9541 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 9542 | -c "HTTP/1.0 200 OK" |
| 9543 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9544 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9545 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9546 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9547 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9548 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 9549 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 9550 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9551 | "$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] | 9552 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9553 | -c "HTTP/1.0 200 OK" |
| 9554 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9555 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9556 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9557 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9558 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9559 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 9560 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 9561 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9562 | "$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] | 9563 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9564 | -c "HTTP/1.0 200 OK" |
| 9565 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 9566 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9567 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9568 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9569 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9570 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 9571 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 9572 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9573 | "$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] | 9574 | 0 \ |
| 9575 | -s "Extra-header:" \ |
| 9576 | -c "Extra-header:" |
| 9577 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9578 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9579 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9580 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9581 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9582 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 9583 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9584 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9585 | "$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] | 9586 | 0 \ |
| 9587 | -s "Extra-header:" \ |
| 9588 | -c "Extra-header:" |
| 9589 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9590 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9591 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9592 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9593 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9594 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 9595 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9596 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9597 | "$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] | 9598 | 0 \ |
| 9599 | -s "Extra-header:" \ |
| 9600 | -c "Extra-header:" |
| 9601 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9602 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 9603 | run_test "export keys functionality" \ |
| 9604 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 9605 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 9606 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 9607 | -c "EAP-TLS key material is:"\ |
| 9608 | -s "EAP-TLS key material is:"\ |
| 9609 | -c "EAP-TLS IV is:" \ |
| 9610 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 9611 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 9612 | # openssl feature tests: check if tls1.3 exists. |
| 9613 | requires_openssl_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9614 | run_test "TLS 1.3: Test openssl tls1_3 feature" \ |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 9615 | "$O_NEXT_SRV -tls1_3 -msg" \ |
| 9616 | "$O_NEXT_CLI -tls1_3 -msg" \ |
| 9617 | 0 \ |
| 9618 | -c "TLS 1.3" \ |
| 9619 | -s "TLS 1.3" |
| 9620 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 9621 | # 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] | 9622 | requires_gnutls_tls1_3 |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 9623 | requires_gnutls_next_no_ticket |
| 9624 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9625 | run_test "TLS 1.3: Test gnutls tls1_3 feature" \ |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 9626 | "$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] | 9627 | "$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] | 9628 | 0 \ |
| 9629 | -s "Version: TLS1.3" \ |
| 9630 | -c "Version: TLS1.3" |
| 9631 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 9632 | # TLS1.3 test cases |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 9633 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9634 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 9635 | skip_handshake_stage_check |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9636 | run_test "TLS 1.3: Not supported version check: tls12 and tls13" \ |
Ronald Cron | 086ee0b | 2022-03-15 15:18:51 +0100 | [diff] [blame] | 9637 | "$P_SRV debug_level=1" \ |
Xiaofei Bai | d25fab6 | 2021-12-02 06:36:27 +0000 | [diff] [blame] | 9638 | "$P_CLI debug_level=1 min_version=tls12 max_version=tls13" \ |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 9639 | 1 \ |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 9640 | -c "SSL - The requested feature is not available" \ |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 9641 | -c "Hybrid TLS 1.2 + TLS 1.3 configurations are not yet supported" |
| 9642 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9643 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 086ee0b | 2022-03-15 15:18:51 +0100 | [diff] [blame] | 9644 | skip_handshake_stage_check |
| 9645 | run_test "TLS 1.3: No server support" \ |
| 9646 | "$P_SRV debug_level=2 force_version=tls13" \ |
| 9647 | "$P_CLI debug_level=2 force_version=tls13" \ |
Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 9648 | 1 \ |
Ronald Cron | 086ee0b | 2022-03-15 15:18:51 +0100 | [diff] [blame] | 9649 | -s "TLS 1.3 server is not supported yet." |
Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 9650 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 9651 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9652 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9653 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9654 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9655 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9656 | run_test "TLS 1.3: minimal feature sets - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9657 | "$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] | 9658 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 9659 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame^] | 9660 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 9661 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 9662 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 9663 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 9664 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 9665 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 9666 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 9667 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 9668 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 9669 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 9670 | -c "<= ssl_tls13_process_server_hello" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 9671 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame^] | 9672 | -c "ECDH curve: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 9673 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame^] | 9674 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 9675 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame^] | 9676 | -c "=> parse certificate verify" \ |
| 9677 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 9678 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 9679 | -c "<= parse finished message" \ |
Gilles Peskine | c63a1e0 | 2022-01-13 01:10:24 +0100 | [diff] [blame] | 9680 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 9681 | -c "HTTP/1.0 200 ok" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 9682 | |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 9683 | requires_gnutls_tls1_3 |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 9684 | requires_gnutls_next_no_ticket |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9685 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9686 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9687 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9688 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9689 | run_test "TLS 1.3: minimal feature sets - gnutls" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9690 | "$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] | 9691 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 9692 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame^] | 9693 | -s "SERVER HELLO was queued" \ |
| 9694 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 9695 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 9696 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 9697 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 9698 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 9699 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 9700 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 9701 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 9702 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 9703 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 9704 | -c "<= ssl_tls13_process_server_hello" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 9705 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame^] | 9706 | -c "ECDH curve: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 9707 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame^] | 9708 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 9709 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame^] | 9710 | -c "=> parse certificate verify" \ |
| 9711 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 9712 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 9713 | -c "<= parse finished message" \ |
Gilles Peskine | 860429f | 2022-02-12 00:44:48 +0100 | [diff] [blame] | 9714 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 9715 | -c "HTTP/1.0 200 OK" |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 9716 | |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 9717 | requires_openssl_tls1_3 |
| 9718 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 9719 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 9720 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9721 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 9722 | requires_config_enabled MBEDTLS_SSL_ALPN |
| 9723 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9724 | run_test "TLS 1.3: alpn - openssl" \ |
| 9725 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -alpn h2" \ |
| 9726 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13 alpn=h2" \ |
| 9727 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame^] | 9728 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 9729 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 9730 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 9731 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 9732 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 9733 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 9734 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 9735 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 9736 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 9737 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 9738 | -c "<= ssl_tls13_process_server_hello" \ |
| 9739 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame^] | 9740 | -c "ECDH curve: x25519" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 9741 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame^] | 9742 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 9743 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame^] | 9744 | -c "=> parse certificate verify" \ |
| 9745 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 9746 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 9747 | -c "<= parse finished message" \ |
| 9748 | -c "HTTP/1.0 200 ok" \ |
| 9749 | -c "Application Layer Protocol is h2" |
| 9750 | |
| 9751 | requires_gnutls_tls1_3 |
| 9752 | requires_gnutls_next_no_ticket |
| 9753 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 9754 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 9755 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9756 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 9757 | requires_config_enabled MBEDTLS_SSL_ALPN |
| 9758 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9759 | run_test "TLS 1.3: alpn - gnutls" \ |
| 9760 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --disable-client-cert --alpn=h2" \ |
| 9761 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13 alpn=h2" \ |
| 9762 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame^] | 9763 | -s "SERVER HELLO was queued" \ |
| 9764 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 9765 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 9766 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 9767 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 9768 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 9769 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 9770 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 9771 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 9772 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 9773 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 9774 | -c "<= ssl_tls13_process_server_hello" \ |
| 9775 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame^] | 9776 | -c "ECDH curve: x25519" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 9777 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame^] | 9778 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 9779 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame^] | 9780 | -c "=> parse certificate verify" \ |
| 9781 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 9782 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 9783 | -c "<= parse finished message" \ |
| 9784 | -c "HTTP/1.0 200 OK" \ |
| 9785 | -c "Application Layer Protocol is h2" |
| 9786 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9787 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9788 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9789 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9790 | skip_handshake_stage_check |
| 9791 | requires_gnutls_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9792 | 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] | 9793 | "$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] | 9794 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9795 | 1 \ |
| 9796 | -s "Client's version: 3.3" \ |
| 9797 | -c "is a fatal alert message (msg 40)" \ |
| 9798 | -S "Version: TLS1.0" \ |
| 9799 | -C "Protocol is TLSv1.0" |
| 9800 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9801 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9802 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9803 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9804 | skip_handshake_stage_check |
| 9805 | requires_gnutls_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9806 | 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] | 9807 | "$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] | 9808 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9809 | 1 \ |
| 9810 | -s "Client's version: 3.3" \ |
| 9811 | -c "is a fatal alert message (msg 40)" \ |
| 9812 | -S "Version: TLS1.1" \ |
| 9813 | -C "Protocol is TLSv1.1" |
| 9814 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9815 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9816 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9817 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9818 | skip_handshake_stage_check |
| 9819 | requires_gnutls_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9820 | 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] | 9821 | "$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] | 9822 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9823 | 1 \ |
| 9824 | -s "Client's version: 3.3" \ |
| 9825 | -c "is a fatal alert message (msg 40)" \ |
| 9826 | -S "Version: TLS1.2" \ |
| 9827 | -C "Protocol is TLSv1.2" |
| 9828 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9829 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9830 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9831 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9832 | skip_handshake_stage_check |
| 9833 | requires_openssl_next |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9834 | 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] | 9835 | "$O_NEXT_SRV -msg -tls1" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9836 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9837 | 1 \ |
| 9838 | -s "fatal protocol_version" \ |
| 9839 | -c "is a fatal alert message (msg 70)" \ |
| 9840 | -S "Version: TLS1.0" \ |
| 9841 | -C "Protocol : TLSv1.0" |
| 9842 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9843 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9844 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9845 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9846 | skip_handshake_stage_check |
| 9847 | requires_openssl_next |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9848 | 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] | 9849 | "$O_NEXT_SRV -msg -tls1_1" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9850 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9851 | 1 \ |
| 9852 | -s "fatal protocol_version" \ |
| 9853 | -c "is a fatal alert message (msg 70)" \ |
| 9854 | -S "Version: TLS1.1" \ |
| 9855 | -C "Protocol : TLSv1.1" |
| 9856 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9857 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9858 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9859 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9860 | skip_handshake_stage_check |
| 9861 | requires_openssl_next |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9862 | 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] | 9863 | "$O_NEXT_SRV -msg -tls1_2" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9864 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9865 | 1 \ |
| 9866 | -s "fatal protocol_version" \ |
| 9867 | -c "is a fatal alert message (msg 70)" \ |
| 9868 | -S "Version: TLS1.2" \ |
| 9869 | -C "Protocol : TLSv1.2" |
| 9870 | |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 9871 | requires_openssl_tls1_3 |
| 9872 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 9873 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9874 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 9875 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9876 | run_test "TLS 1.3: Client authentication, no client certificate - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 9877 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -verify 10" \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 9878 | "$P_CLI debug_level=4 force_version=tls13 crt_file=none \ |
| 9879 | key_file=none" \ |
| 9880 | 0 \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 9881 | -c "got a certificate request" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9882 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 9883 | -s "TLS 1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 9884 | -c "HTTP/1.0 200 ok" \ |
| 9885 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9886 | |
| 9887 | requires_gnutls_tls1_3 |
| 9888 | requires_gnutls_next_no_ticket |
| 9889 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 9890 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9891 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 9892 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9893 | run_test "TLS 1.3: Client authentication, no client certificate - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 9894 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --verify-client-cert" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9895 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13 crt_file=none \ |
| 9896 | key_file=none" \ |
| 9897 | 0 \ |
| 9898 | -c "got a certificate request" \ |
| 9899 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE"\ |
| 9900 | -s "Version: TLS1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 9901 | -c "HTTP/1.0 200 OK" \ |
| 9902 | -c "Protocol is TLSv1.3" |
| 9903 | |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 9904 | |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 9905 | requires_openssl_tls1_3 |
| 9906 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 9907 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9908 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 9909 | run_test "TLS 1.3: Client authentication, no server middlebox compat - openssl" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 9910 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 -no_middlebox" \ |
Jerry Yu | 22abd06 | 2022-01-30 20:02:47 +0800 | [diff] [blame] | 9911 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cli2.crt \ |
Jerry Yu | 25e0ddc | 2022-01-29 10:33:13 +0800 | [diff] [blame] | 9912 | key_file=data_files/cli2.key" \ |
Jerry Yu | c19884f | 2022-01-29 10:44:44 +0800 | [diff] [blame] | 9913 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 9914 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 9915 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 9916 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 9917 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 9918 | |
| 9919 | requires_gnutls_tls1_3 |
| 9920 | requires_gnutls_next_no_ticket |
| 9921 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 9922 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9923 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 9924 | run_test "TLS 1.3: Client authentication, no server middlebox compat - gnutls" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 9925 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \ |
Jerry Yu | 25e0ddc | 2022-01-29 10:33:13 +0800 | [diff] [blame] | 9926 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13 crt_file=data_files/cli2.crt \ |
| 9927 | key_file=data_files/cli2.key" \ |
Jerry Yu | c19884f | 2022-01-29 10:44:44 +0800 | [diff] [blame] | 9928 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 9929 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 9930 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 9931 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 9932 | -c "Protocol is TLSv1.3" |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 9933 | |
| 9934 | requires_openssl_tls1_3 |
| 9935 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 9936 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9937 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 9938 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9939 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 9940 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9941 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/ecdsa_secp256r1.crt \ |
| 9942 | key_file=data_files/ecdsa_secp256r1.key" \ |
| 9943 | 0 \ |
| 9944 | -c "got a certificate request" \ |
| 9945 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 9946 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 9947 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9948 | |
| 9949 | requires_gnutls_tls1_3 |
| 9950 | requires_gnutls_next_no_ticket |
| 9951 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 9952 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9953 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 9954 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9955 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 9956 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9957 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/ecdsa_secp256r1.crt \ |
| 9958 | key_file=data_files/ecdsa_secp256r1.key" \ |
| 9959 | 0 \ |
| 9960 | -c "got a certificate request" \ |
| 9961 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 9962 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 9963 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9964 | |
| 9965 | requires_openssl_tls1_3 |
| 9966 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 9967 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9968 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 9969 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9970 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 9971 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9972 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/ecdsa_secp384r1.crt \ |
| 9973 | key_file=data_files/ecdsa_secp384r1.key" \ |
| 9974 | 0 \ |
| 9975 | -c "got a certificate request" \ |
| 9976 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 9977 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 9978 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9979 | |
| 9980 | requires_gnutls_tls1_3 |
| 9981 | requires_gnutls_next_no_ticket |
| 9982 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 9983 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9984 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 9985 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9986 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 9987 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9988 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/ecdsa_secp384r1.crt \ |
| 9989 | key_file=data_files/ecdsa_secp384r1.key" \ |
| 9990 | 0 \ |
| 9991 | -c "got a certificate request" \ |
| 9992 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 9993 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 9994 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 9995 | |
| 9996 | requires_openssl_tls1_3 |
| 9997 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 9998 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9999 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10000 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10001 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10002 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10003 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 10004 | key_file=data_files/ecdsa_secp521r1.key" \ |
| 10005 | 0 \ |
| 10006 | -c "got a certificate request" \ |
| 10007 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10008 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10009 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10010 | |
| 10011 | requires_gnutls_tls1_3 |
| 10012 | requires_gnutls_next_no_ticket |
| 10013 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10014 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10015 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10016 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10017 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10018 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10019 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 10020 | key_file=data_files/ecdsa_secp521r1.key" \ |
| 10021 | 0 \ |
| 10022 | -c "got a certificate request" \ |
| 10023 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10024 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10025 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10026 | |
| 10027 | requires_openssl_tls1_3 |
| 10028 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10029 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10030 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10031 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10032 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10033 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10034 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10035 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 10036 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 10037 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10038 | -c "got a certificate request" \ |
| 10039 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10040 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 10041 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10042 | |
| 10043 | requires_gnutls_tls1_3 |
| 10044 | requires_gnutls_next_no_ticket |
| 10045 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10046 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10047 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10048 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10049 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10050 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10051 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10052 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 10053 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 10054 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10055 | -c "got a certificate request" \ |
| 10056 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10057 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 10058 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 10059 | |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 10060 | requires_openssl_tls1_3 |
| 10061 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10062 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10063 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10064 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10065 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 10066 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - openssl" \ |
| 10067 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 10068 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 10069 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384" \ |
| 10070 | 0 \ |
| 10071 | -c "got a certificate request" \ |
| 10072 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10073 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10074 | -c "Protocol is TLSv1.3" |
| 10075 | |
| 10076 | requires_gnutls_tls1_3 |
| 10077 | requires_gnutls_next_no_ticket |
| 10078 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10079 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10080 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10081 | requires_config_enabled MBEDTLS_RSA_C |
| 10082 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10083 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - gnutls" \ |
| 10084 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 10085 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 10086 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384" \ |
| 10087 | 0 \ |
| 10088 | -c "got a certificate request" \ |
| 10089 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10090 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10091 | -c "Protocol is TLSv1.3" |
| 10092 | |
| 10093 | requires_openssl_tls1_3 |
| 10094 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10095 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10096 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10097 | requires_config_enabled MBEDTLS_RSA_C |
| 10098 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10099 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - openssl" \ |
| 10100 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 10101 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 10102 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512" \ |
| 10103 | 0 \ |
| 10104 | -c "got a certificate request" \ |
| 10105 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10106 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10107 | -c "Protocol is TLSv1.3" |
| 10108 | |
| 10109 | requires_gnutls_tls1_3 |
| 10110 | requires_gnutls_next_no_ticket |
| 10111 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10112 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10113 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10114 | requires_config_enabled MBEDTLS_RSA_C |
| 10115 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10116 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - gnutls" \ |
| 10117 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 10118 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 10119 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512" \ |
| 10120 | 0 \ |
| 10121 | -c "got a certificate request" \ |
| 10122 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10123 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10124 | -c "Protocol is TLSv1.3" |
| 10125 | |
| 10126 | requires_openssl_tls1_3 |
| 10127 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10128 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10129 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10130 | requires_config_enabled MBEDTLS_RSA_C |
| 10131 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | ccb005e | 2022-02-22 17:38:34 +0800 | [diff] [blame] | 10132 | run_test "TLS 1.3: Client authentication, client alg not in server list - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10133 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 10134 | -sigalgs ecdsa_secp256r1_sha256" \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 10135 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 10136 | key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512" \ |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 10137 | 1 \ |
| 10138 | -c "got a certificate request" \ |
| 10139 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10140 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 10141 | -c "signature algorithm not in received or offered list." \ |
| 10142 | -C "unkown pk type" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 10143 | |
| 10144 | requires_gnutls_tls1_3 |
| 10145 | requires_gnutls_next_no_ticket |
| 10146 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10147 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10148 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10149 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10150 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10151 | run_test "TLS 1.3: Client authentication, client alg not in server list - gnutls" \ |
| 10152 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:-SIGN-ALL:+SIGN-ECDSA-SECP256R1-SHA256:%NO_TICKETS" \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 10153 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 10154 | key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512" \ |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 10155 | 1 \ |
| 10156 | -c "got a certificate request" \ |
| 10157 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10158 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 10159 | -c "signature algorithm not in received or offered list." \ |
| 10160 | -C "unkown pk type" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 10161 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10162 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 10163 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 10164 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10165 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 10166 | requires_openssl_tls1_3 |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 10167 | run_test "TLS 1.3: HelloRetryRequest check, ciphersuite TLS_AES_128_GCM_SHA256 - openssl" \ |
| 10168 | "$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" \ |
| 10169 | "$P_CLI debug_level=4 force_version=tls13" \ |
| 10170 | 0 \ |
| 10171 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 10172 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame^] | 10173 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 10174 | -c "HTTP/1.0 200 ok" |
| 10175 | |
| 10176 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10177 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10178 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10179 | requires_config_enabled MBEDTLS_SSL_CLI_C |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 10180 | requires_openssl_tls1_3 |
| 10181 | 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] | 10182 | "$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] | 10183 | "$P_CLI debug_level=4 force_version=tls13" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 10184 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 10185 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 10186 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame^] | 10187 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 10188 | -c "HTTP/1.0 200 ok" |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 10189 | |
| 10190 | requires_gnutls_tls1_3 |
| 10191 | requires_gnutls_next_no_ticket |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10192 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 10193 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 10194 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10195 | requires_config_enabled MBEDTLS_SSL_CLI_C |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 10196 | run_test "TLS 1.3: HelloRetryRequest check, ciphersuite TLS_AES_128_GCM_SHA256 - gnutls" \ |
| 10197 | "$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" \ |
| 10198 | "$P_CLI debug_level=4 force_version=tls13" \ |
| 10199 | 0 \ |
| 10200 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 10201 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame^] | 10202 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 10203 | -c "HTTP/1.0 200 OK" |
| 10204 | |
| 10205 | requires_gnutls_tls1_3 |
| 10206 | requires_gnutls_next_no_ticket |
| 10207 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10208 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10209 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10210 | requires_config_enabled MBEDTLS_SSL_CLI_C |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 10211 | 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] | 10212 | "$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] | 10213 | "$P_CLI debug_level=4 force_version=tls13" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 10214 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 10215 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 10216 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame^] | 10217 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 10218 | -c "HTTP/1.0 200 OK" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 10219 | |
Gilles Peskine | 2baaf60 | 2022-01-07 15:46:12 +0100 | [diff] [blame] | 10220 | for i in opt-testcases/*.sh |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 10221 | do |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 10222 | TEST_SUITE_NAME=${i##*/} |
| 10223 | TEST_SUITE_NAME=${TEST_SUITE_NAME%.*} |
| 10224 | . "$i" |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 10225 | done |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 10226 | unset TEST_SUITE_NAME |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 10227 | |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 10228 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10229 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 10230 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 10231 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10232 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 10233 | 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] | 10234 | "$O_NEXT_SRV -msg -tls1_3 -no_middlebox -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
| 10235 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
| 10236 | 0 \ |
| 10237 | -c "HTTP/1.0 200 ok" |
| 10238 | |
| 10239 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10240 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 10241 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 10242 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10243 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 10244 | 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] | 10245 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
| 10246 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
| 10247 | 1 \ |
| 10248 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 10249 | |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 10250 | requires_gnutls_tls1_3 |
| 10251 | requires_gnutls_next_no_ticket |
| 10252 | requires_gnutls_next_disable_tls13_compat |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10253 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 10254 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10255 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10256 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 10257 | run_test "TLS 1.3 m->G both peers do not support middlebox compatibility" \ |
| 10258 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE --disable-client-cert" \ |
| 10259 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
| 10260 | 0 \ |
| 10261 | -c "HTTP/1.0 200 OK" |
| 10262 | |
| 10263 | requires_gnutls_tls1_3 |
| 10264 | requires_gnutls_next_no_ticket |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10265 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 10266 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10267 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10268 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 10269 | run_test "TLS 1.3 m->G server with middlebox compat support, not client" \ |
| 10270 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --disable-client-cert" \ |
| 10271 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
| 10272 | 1 \ |
| 10273 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 10274 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 10275 | # Test heap memory usage after handshake |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10276 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 10277 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 10278 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 10279 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10280 | requires_max_content_len 16384 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 10281 | run_tests_memory_after_hanshake |
| 10282 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 10283 | # Final report |
| 10284 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10285 | echo "------------------------------------------------------------------------" |
| 10286 | |
| 10287 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 10288 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10289 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 10290 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10291 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 10292 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 10293 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10294 | |
| 10295 | exit $FAILS |