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 | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 84 | O_NEXT_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_NEXT s_client -CAfile data_files/test-ca_cat12.crt" |
XiaokangQian | d5d5b60 | 2022-05-23 09:16:20 +0000 | [diff] [blame^] | 85 | O_NEXT_CLI_NO_CERT="echo 'GET / HTTP/1.0' | $OPENSSL_NEXT s_client" |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 86 | else |
| 87 | O_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 88 | O_NEXT_SRV_NO_CERT=false |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 89 | O_NEXT_CLI=false |
| 90 | fi |
| 91 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 92 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 93 | 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] | 94 | G_NEXT_SRV_NO_CERT="$GNUTLS_NEXT_SERV" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 95 | else |
| 96 | G_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 97 | G_NEXT_SRV_NO_CERT=false |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 98 | fi |
| 99 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 100 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 101 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile data_files/test-ca_cat12.crt" |
XiaokangQian | d5d5b60 | 2022-05-23 09:16:20 +0000 | [diff] [blame^] | 102 | G_NEXT_CLI_NO_CERT="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 103 | else |
| 104 | G_NEXT_CLI=false |
| 105 | fi |
| 106 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 107 | TESTS=0 |
| 108 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 109 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 110 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 111 | CONFIG_H='../include/mbedtls/mbedtls_config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 112 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 113 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 114 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 115 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 116 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 117 | SHOW_TEST_NUMBER=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 118 | RUN_TEST_NUMBER='' |
| 119 | |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 120 | PRESERVE_LOGS=0 |
| 121 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 122 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 123 | # port which is this plus 10000. Each port number may be independently |
| 124 | # overridden by a command line option. |
| 125 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 126 | PXY_PORT=$((SRV_PORT + 10000)) |
| 127 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 128 | print_usage() { |
| 129 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 130 | printf " -h|--help\tPrint this help.\n" |
| 131 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 132 | printf " -f|--filter\tOnly matching tests are executed (substring or BRE)\n" |
| 133 | printf " -e|--exclude\tMatching tests are excluded (substring or BRE)\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 134 | 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] | 135 | 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] | 136 | printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 137 | printf " --outcome-file\tFile where test outcomes are written\n" |
| 138 | printf " \t(default: \$MBEDTLS_TEST_OUTCOME_FILE, none if empty)\n" |
| 139 | printf " --port \tTCP/UDP port (default: randomish 1xxxx)\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 140 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 141 | 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] | 142 | } |
| 143 | |
| 144 | get_options() { |
| 145 | while [ $# -gt 0 ]; do |
| 146 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 147 | -f|--filter) |
| 148 | shift; FILTER=$1 |
| 149 | ;; |
| 150 | -e|--exclude) |
| 151 | shift; EXCLUDE=$1 |
| 152 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 153 | -m|--memcheck) |
| 154 | MEMCHECK=1 |
| 155 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 156 | -n|--number) |
| 157 | shift; RUN_TEST_NUMBER=$1 |
| 158 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 159 | -s|--show-numbers) |
| 160 | SHOW_TEST_NUMBER=1 |
| 161 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 162 | -p|--preserve-logs) |
| 163 | PRESERVE_LOGS=1 |
| 164 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 165 | --port) |
| 166 | shift; SRV_PORT=$1 |
| 167 | ;; |
| 168 | --proxy-port) |
| 169 | shift; PXY_PORT=$1 |
| 170 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 171 | --seed) |
| 172 | shift; SEED="$1" |
| 173 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 174 | -h|--help) |
| 175 | print_usage |
| 176 | exit 0 |
| 177 | ;; |
| 178 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 179 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 180 | print_usage |
| 181 | exit 1 |
| 182 | ;; |
| 183 | esac |
| 184 | shift |
| 185 | done |
| 186 | } |
| 187 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 188 | # Make the outcome file path relative to the original directory, not |
| 189 | # to .../tests |
| 190 | case "$MBEDTLS_TEST_OUTCOME_FILE" in |
| 191 | [!/]*) |
| 192 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" |
| 193 | ;; |
| 194 | esac |
| 195 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 196 | # Read boolean configuration options from mbedtls_config.h for easy and quick |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 197 | # testing. Skip non-boolean options (with something other than spaces |
| 198 | # and a comment after "#define SYMBOL"). The variable contains a |
| 199 | # space-separated list of symbols. |
Jerry Yu | d0fcf7f | 2021-12-10 18:45:51 +0800 | [diff] [blame] | 200 | CONFIGS_ENABLED=" $(echo `$P_QUERY -l` )" |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 201 | # Skip next test; use this macro to skip tests which are legitimate |
| 202 | # in theory and expected to be re-introduced at some point, but |
| 203 | # aren't expected to succeed at the moment due to problems outside |
| 204 | # our control (such as bugs in other TLS implementations). |
| 205 | skip_next_test() { |
| 206 | SKIP_NEXT="YES" |
| 207 | } |
| 208 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 209 | # skip next test if the flag is not enabled in mbedtls_config.h |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 210 | requires_config_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 211 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 212 | *" $1"[\ =]*) :;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 213 | *) SKIP_NEXT="YES";; |
| 214 | esac |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 215 | } |
| 216 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 217 | # skip next test if the flag is enabled in mbedtls_config.h |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 218 | requires_config_disabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 219 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 220 | *" $1"[\ =]*) SKIP_NEXT="YES";; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 221 | esac |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 222 | } |
| 223 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 224 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 225 | # This function uses the query_config command line option to query the |
| 226 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 227 | # program. The command will always return a success value if the |
| 228 | # configuration is defined and the value will be printed to stdout. |
| 229 | # |
| 230 | # Note that if the configuration is not defined or is defined to nothing, |
| 231 | # the output of this function will be an empty string. |
| 232 | ${P_SRV} "query_config=${1}" |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 233 | } |
| 234 | |
| 235 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 236 | VAL="$( get_config_value_or_default "$1" )" |
| 237 | if [ -z "$VAL" ]; then |
| 238 | # Should never happen |
| 239 | echo "Mbed TLS configuration $1 is not defined" |
| 240 | exit 1 |
| 241 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 242 | SKIP_NEXT="YES" |
| 243 | fi |
| 244 | } |
| 245 | |
| 246 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 247 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 248 | if [ -z "$VAL" ]; then |
| 249 | # Should never happen |
| 250 | echo "Mbed TLS configuration $1 is not defined" |
| 251 | exit 1 |
| 252 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 253 | SKIP_NEXT="YES" |
| 254 | fi |
| 255 | } |
| 256 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 257 | requires_config_value_equals() { |
| 258 | VAL=$( get_config_value_or_default "$1" ) |
| 259 | if [ -z "$VAL" ]; then |
| 260 | # Should never happen |
| 261 | echo "Mbed TLS configuration $1 is not defined" |
| 262 | exit 1 |
| 263 | elif [ "$VAL" -ne "$2" ]; then |
| 264 | SKIP_NEXT="YES" |
| 265 | fi |
| 266 | } |
| 267 | |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 268 | # Require Mbed TLS to support the given protocol version. |
| 269 | # |
| 270 | # Inputs: |
| 271 | # * $1: protocol version in mbedtls syntax (argument to force_version=) |
| 272 | requires_protocol_version() { |
| 273 | # Support for DTLS is detected separately in detect_dtls(). |
| 274 | case "$1" in |
| 275 | tls12|dtls12) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2;; |
| 276 | tls13|dtls13) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3;; |
| 277 | *) echo "Unknown required protocol version: $1"; exit 1;; |
| 278 | esac |
| 279 | } |
| 280 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 281 | # Space-separated list of ciphersuites supported by this build of |
| 282 | # Mbed TLS. |
| 283 | P_CIPHERSUITES=" $($P_CLI --help 2>/dev/null | |
XiaokangQian | 4b82ca1 | 2021-11-18 08:27:17 +0000 | [diff] [blame] | 284 | grep 'TLS-\|TLS1-3' | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 285 | tr -s ' \n' ' ')" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 286 | requires_ciphersuite_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 287 | case $P_CIPHERSUITES in |
| 288 | *" $1 "*) :;; |
| 289 | *) SKIP_NEXT="YES";; |
| 290 | esac |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 291 | } |
| 292 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 293 | # detect_required_features CMD [RUN_TEST_OPTION...] |
| 294 | # If CMD (call to a TLS client or server program) requires certain features, |
| 295 | # arrange to only run the following test case if those features are enabled. |
| 296 | detect_required_features() { |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 297 | case "$1" in |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 298 | *\ force_version=*) |
| 299 | tmp="${1##*\ force_version=}" |
| 300 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 301 | requires_protocol_version "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 302 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 303 | |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 304 | case "$1" in |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 305 | *\ force_ciphersuite=*) |
| 306 | tmp="${1##*\ force_ciphersuite=}" |
| 307 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 308 | requires_ciphersuite_enabled "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 309 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 310 | |
Gilles Peskine | 740b734 | 2022-04-08 19:29:27 +0200 | [diff] [blame] | 311 | case " $1 " in |
| 312 | *[-_\ =]tickets=[^0]*) |
| 313 | requires_config_enabled MBEDTLS_SSL_TICKET_C;; |
| 314 | esac |
| 315 | case " $1 " in |
| 316 | *[-_\ =]alpn=*) |
| 317 | requires_config_enabled MBEDTLS_SSL_ALPN;; |
| 318 | esac |
| 319 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 320 | unset tmp |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 321 | } |
| 322 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 323 | requires_certificate_authentication () { |
| 324 | if [ "$PSK_ONLY" = "YES" ]; then |
| 325 | SKIP_NEXT="YES" |
| 326 | fi |
| 327 | } |
| 328 | |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 329 | adapt_cmd_for_psk () { |
| 330 | case "$2" in |
| 331 | *openssl*) s='-psk abc123 -nocert';; |
| 332 | *gnutls-*) s='--pskkey=abc123';; |
| 333 | *) s='psk=abc123';; |
| 334 | esac |
| 335 | eval $1='"$2 $s"' |
| 336 | unset s |
| 337 | } |
| 338 | |
| 339 | # maybe_adapt_for_psk [RUN_TEST_OPTION...] |
| 340 | # If running in a PSK-only build, maybe adapt the test to use a pre-shared key. |
| 341 | # |
| 342 | # If not running in a PSK-only build, do nothing. |
| 343 | # If the test looks like it doesn't use a pre-shared key but can run with a |
| 344 | # pre-shared key, pass a pre-shared key. If the test looks like it can't run |
| 345 | # with a pre-shared key, skip it. If the test looks like it's already using |
| 346 | # a pre-shared key, do nothing. |
| 347 | # |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 348 | # This code does not consider builds with ECDHE-PSK or RSA-PSK. |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 349 | # |
| 350 | # Inputs: |
| 351 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: client/server/proxy commands. |
| 352 | # * $PSK_ONLY: YES if running in a PSK-only build (no asymmetric key exchanges). |
| 353 | # * "$@": options passed to run_test. |
| 354 | # |
| 355 | # Outputs: |
| 356 | # * $CLI_CMD, $SRV_CMD: may be modified to add PSK-relevant arguments. |
| 357 | # * $SKIP_NEXT: set to YES if the test can't run with PSK. |
| 358 | maybe_adapt_for_psk() { |
| 359 | if [ "$PSK_ONLY" != "YES" ]; then |
| 360 | return |
| 361 | fi |
| 362 | if [ "$SKIP_NEXT" = "YES" ]; then |
| 363 | return |
| 364 | fi |
| 365 | case "$CLI_CMD $SRV_CMD" in |
| 366 | *[-_\ =]psk*|*[-_\ =]PSK*) |
| 367 | return;; |
| 368 | *force_ciphersuite*) |
| 369 | # The test case forces a non-PSK cipher suite. In some cases, a |
| 370 | # PSK cipher suite could be substituted, but we're not ready for |
| 371 | # that yet. |
| 372 | SKIP_NEXT="YES" |
| 373 | return;; |
| 374 | *\ auth_mode=*|*[-_\ =]crt[_=]*) |
| 375 | # The test case involves certificates. PSK won't do. |
| 376 | SKIP_NEXT="YES" |
| 377 | return;; |
| 378 | esac |
| 379 | adapt_cmd_for_psk CLI_CMD "$CLI_CMD" |
| 380 | adapt_cmd_for_psk SRV_CMD "$SRV_CMD" |
| 381 | } |
| 382 | |
| 383 | case " $CONFIGS_ENABLED " in |
| 384 | *\ MBEDTLS_KEY_EXCHANGE_[^P]*) PSK_ONLY="NO";; |
| 385 | *\ MBEDTLS_KEY_EXCHANGE_P[^S]*) PSK_ONLY="NO";; |
| 386 | *\ MBEDTLS_KEY_EXCHANGE_PS[^K]*) PSK_ONLY="NO";; |
| 387 | *\ MBEDTLS_KEY_EXCHANGE_PSK[^_]*) PSK_ONLY="NO";; |
| 388 | *\ MBEDTLS_KEY_EXCHANGE_PSK_ENABLED\ *) PSK_ONLY="YES";; |
| 389 | *) PSK_ONLY="NO";; |
| 390 | esac |
| 391 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 392 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 393 | requires_openssl_with_fallback_scsv() { |
| 394 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 395 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 396 | then |
| 397 | OPENSSL_HAS_FBSCSV="YES" |
| 398 | else |
| 399 | OPENSSL_HAS_FBSCSV="NO" |
| 400 | fi |
| 401 | fi |
| 402 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 403 | SKIP_NEXT="YES" |
| 404 | fi |
| 405 | } |
| 406 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 407 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 408 | requires_max_content_len() { |
| 409 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 410 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 411 | } |
| 412 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 413 | # skip next test if GnuTLS isn't available |
| 414 | requires_gnutls() { |
| 415 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 416 | 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] | 417 | GNUTLS_AVAILABLE="YES" |
| 418 | else |
| 419 | GNUTLS_AVAILABLE="NO" |
| 420 | fi |
| 421 | fi |
| 422 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 423 | SKIP_NEXT="YES" |
| 424 | fi |
| 425 | } |
| 426 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 427 | # skip next test if GnuTLS-next isn't available |
| 428 | requires_gnutls_next() { |
| 429 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 430 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 431 | GNUTLS_NEXT_AVAILABLE="YES" |
| 432 | else |
| 433 | GNUTLS_NEXT_AVAILABLE="NO" |
| 434 | fi |
| 435 | fi |
| 436 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 437 | SKIP_NEXT="YES" |
| 438 | fi |
| 439 | } |
| 440 | |
| 441 | # skip next test if OpenSSL-legacy isn't available |
| 442 | requires_openssl_legacy() { |
| 443 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 444 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 445 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 446 | else |
| 447 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 448 | fi |
| 449 | fi |
| 450 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 451 | SKIP_NEXT="YES" |
| 452 | fi |
| 453 | } |
| 454 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 455 | requires_openssl_next() { |
| 456 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then |
| 457 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then |
| 458 | OPENSSL_NEXT_AVAILABLE="YES" |
| 459 | else |
| 460 | OPENSSL_NEXT_AVAILABLE="NO" |
| 461 | fi |
| 462 | fi |
| 463 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 464 | SKIP_NEXT="YES" |
| 465 | fi |
| 466 | } |
| 467 | |
| 468 | # skip next test if tls1_3 is not available |
| 469 | requires_openssl_tls1_3() { |
| 470 | requires_openssl_next |
| 471 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 472 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 473 | fi |
| 474 | if [ -z "${OPENSSL_TLS1_3_AVAILABLE:-}" ]; then |
| 475 | if $OPENSSL_NEXT s_client -help 2>&1 | grep tls1_3 >/dev/null |
| 476 | then |
| 477 | OPENSSL_TLS1_3_AVAILABLE="YES" |
| 478 | else |
| 479 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 480 | fi |
| 481 | fi |
| 482 | if [ "$OPENSSL_TLS1_3_AVAILABLE" = "NO" ]; then |
| 483 | SKIP_NEXT="YES" |
| 484 | fi |
| 485 | } |
| 486 | |
| 487 | # skip next test if tls1_3 is not available |
| 488 | requires_gnutls_tls1_3() { |
| 489 | requires_gnutls_next |
| 490 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 491 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 492 | fi |
| 493 | if [ -z "${GNUTLS_TLS1_3_AVAILABLE:-}" ]; then |
| 494 | if $GNUTLS_NEXT_CLI -l 2>&1 | grep VERS-TLS1.3 >/dev/null |
| 495 | then |
| 496 | GNUTLS_TLS1_3_AVAILABLE="YES" |
| 497 | else |
| 498 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 499 | fi |
| 500 | fi |
| 501 | if [ "$GNUTLS_TLS1_3_AVAILABLE" = "NO" ]; then |
| 502 | SKIP_NEXT="YES" |
| 503 | fi |
| 504 | } |
| 505 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 506 | # Check %NO_TICKETS option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 507 | requires_gnutls_next_no_ticket() { |
| 508 | requires_gnutls_next |
| 509 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 510 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 511 | fi |
| 512 | if [ -z "${GNUTLS_NO_TICKETS_AVAILABLE:-}" ]; then |
| 513 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep NO_TICKETS >/dev/null |
| 514 | then |
| 515 | GNUTLS_NO_TICKETS_AVAILABLE="YES" |
| 516 | else |
| 517 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 518 | fi |
| 519 | fi |
| 520 | if [ "$GNUTLS_NO_TICKETS_AVAILABLE" = "NO" ]; then |
| 521 | SKIP_NEXT="YES" |
| 522 | fi |
| 523 | } |
| 524 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 525 | # Check %DISABLE_TLS13_COMPAT_MODE option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 526 | requires_gnutls_next_disable_tls13_compat() { |
| 527 | requires_gnutls_next |
| 528 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 529 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 530 | fi |
| 531 | if [ -z "${GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE:-}" ]; then |
| 532 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep DISABLE_TLS13_COMPAT_MODE >/dev/null |
| 533 | then |
| 534 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="YES" |
| 535 | else |
| 536 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 537 | fi |
| 538 | fi |
| 539 | if [ "$GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE" = "NO" ]; then |
| 540 | SKIP_NEXT="YES" |
| 541 | fi |
| 542 | } |
| 543 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 544 | # skip next test if IPv6 isn't available on this host |
| 545 | requires_ipv6() { |
| 546 | if [ -z "${HAS_IPV6:-}" ]; then |
| 547 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 548 | SRV_PID=$! |
| 549 | sleep 1 |
| 550 | kill $SRV_PID >/dev/null 2>&1 |
| 551 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 552 | HAS_IPV6="NO" |
| 553 | else |
| 554 | HAS_IPV6="YES" |
| 555 | fi |
| 556 | rm -r $SRV_OUT |
| 557 | fi |
| 558 | |
| 559 | if [ "$HAS_IPV6" = "NO" ]; then |
| 560 | SKIP_NEXT="YES" |
| 561 | fi |
| 562 | } |
| 563 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 564 | # skip next test if it's i686 or uname is not available |
| 565 | requires_not_i686() { |
| 566 | if [ -z "${IS_I686:-}" ]; then |
| 567 | IS_I686="YES" |
| 568 | if which "uname" >/dev/null 2>&1; then |
| 569 | if [ -z "$(uname -a | grep i686)" ]; then |
| 570 | IS_I686="NO" |
| 571 | fi |
| 572 | fi |
| 573 | fi |
| 574 | if [ "$IS_I686" = "YES" ]; then |
| 575 | SKIP_NEXT="YES" |
| 576 | fi |
| 577 | } |
| 578 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 579 | # Calculate the input & output maximum content lengths set in the config |
David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 580 | MAX_CONTENT_LEN=16384 |
Yuto Takano | 2be6f1a | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 581 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 582 | 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] | 583 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 584 | # Calculate the maximum content length that fits both |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 585 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 586 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 587 | fi |
| 588 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 589 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 590 | fi |
| 591 | |
| 592 | # skip the next test if the SSL output buffer is less than 16KB |
| 593 | requires_full_size_output_buffer() { |
| 594 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 595 | SKIP_NEXT="YES" |
| 596 | fi |
| 597 | } |
| 598 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 599 | # skip the next test if valgrind is in use |
| 600 | not_with_valgrind() { |
| 601 | if [ "$MEMCHECK" -gt 0 ]; then |
| 602 | SKIP_NEXT="YES" |
| 603 | fi |
| 604 | } |
| 605 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 606 | # skip the next test if valgrind is NOT in use |
| 607 | only_with_valgrind() { |
| 608 | if [ "$MEMCHECK" -eq 0 ]; then |
| 609 | SKIP_NEXT="YES" |
| 610 | fi |
| 611 | } |
| 612 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 613 | # 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] | 614 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 615 | CLI_DELAY_FACTOR=$1 |
| 616 | } |
| 617 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 618 | # wait for the given seconds after the client finished in the next test |
| 619 | server_needs_more_time() { |
| 620 | SRV_DELAY_SECONDS=$1 |
| 621 | } |
| 622 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 623 | # print_name <name> |
| 624 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 625 | TESTS=$(( $TESTS + 1 )) |
| 626 | LINE="" |
| 627 | |
| 628 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 629 | LINE="$TESTS " |
| 630 | fi |
| 631 | |
| 632 | LINE="$LINE$1" |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 633 | printf "%s " "$LINE" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 634 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 635 | for i in `seq 1 $LEN`; do printf '.'; done |
| 636 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 637 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 638 | } |
| 639 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 640 | # record_outcome <outcome> [<failure-reason>] |
| 641 | # The test name must be in $NAME. |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 642 | # Use $TEST_SUITE_NAME as the test suite name if set. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 643 | record_outcome() { |
| 644 | echo "$1" |
| 645 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 646 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 647 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 648 | "${TEST_SUITE_NAME:-ssl-opt}" "$NAME" \ |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 649 | "$1" "${2-}" \ |
| 650 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 651 | fi |
| 652 | } |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 653 | unset TEST_SUITE_NAME |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 654 | |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 655 | # True if the presence of the given pattern in a log definitely indicates |
| 656 | # that the test has failed. False if the presence is inconclusive. |
| 657 | # |
| 658 | # Inputs: |
| 659 | # * $1: pattern found in the logs |
| 660 | # * $TIMES_LEFT: >0 if retrying is an option |
| 661 | # |
| 662 | # Outputs: |
| 663 | # * $outcome: set to a retry reason if the pattern is inconclusive, |
| 664 | # unchanged otherwise. |
| 665 | # * Return value: 1 if the pattern is inconclusive, |
| 666 | # 0 if the failure is definitive. |
| 667 | log_pattern_presence_is_conclusive() { |
| 668 | # If we've run out of attempts, then don't retry no matter what. |
| 669 | if [ $TIMES_LEFT -eq 0 ]; then |
| 670 | return 0 |
| 671 | fi |
| 672 | case $1 in |
| 673 | "resend") |
| 674 | # An undesired resend may have been caused by the OS dropping or |
| 675 | # delaying a packet at an inopportune time. |
| 676 | outcome="RETRY(resend)" |
| 677 | return 1;; |
| 678 | esac |
| 679 | } |
| 680 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 681 | # fail <message> |
| 682 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 683 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 684 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 685 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 686 | mv $SRV_OUT o-srv-${TESTS}.log |
| 687 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 688 | if [ -n "$PXY_CMD" ]; then |
| 689 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 690 | fi |
| 691 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 692 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 693 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 694 | echo " ! server output:" |
| 695 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 696 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 697 | echo " ! client output:" |
| 698 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 699 | if [ -n "$PXY_CMD" ]; then |
| 700 | echo " ! ========================================================" |
| 701 | echo " ! proxy output:" |
| 702 | cat o-pxy-${TESTS}.log |
| 703 | fi |
| 704 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 705 | fi |
| 706 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 707 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 708 | } |
| 709 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 710 | # is_polar <cmd_line> |
| 711 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 712 | case "$1" in |
| 713 | *ssl_client2*) true;; |
| 714 | *ssl_server2*) true;; |
| 715 | *) false;; |
| 716 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 717 | } |
| 718 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 719 | # openssl s_server doesn't have -www with DTLS |
| 720 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 721 | case "$SRV_CMD" in |
| 722 | *s_server*-dtls*) |
| 723 | NEEDS_INPUT=1 |
| 724 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 725 | *) NEEDS_INPUT=0;; |
| 726 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 727 | } |
| 728 | |
| 729 | # provide input to commands that need it |
| 730 | provide_input() { |
| 731 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 732 | return |
| 733 | fi |
| 734 | |
| 735 | while true; do |
| 736 | echo "HTTP/1.0 200 OK" |
| 737 | sleep 1 |
| 738 | done |
| 739 | } |
| 740 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 741 | # has_mem_err <log_file_name> |
| 742 | has_mem_err() { |
| 743 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 744 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 745 | then |
| 746 | return 1 # false: does not have errors |
| 747 | else |
| 748 | return 0 # true: has errors |
| 749 | fi |
| 750 | } |
| 751 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 752 | # 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] | 753 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 754 | wait_app_start() { |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 755 | newline=' |
| 756 | ' |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 757 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 758 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 759 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 760 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 761 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 762 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 763 | # Make a tight loop, server normally takes less than 1s to start. |
Paul Elliott | 58ed8a7 | 2021-10-19 17:56:39 +0100 | [diff] [blame] | 764 | while true; do |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 765 | SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -t) |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 766 | # When we use a proxy, it will be listening on the same port we |
| 767 | # are checking for as well as the server and lsof will list both. |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 768 | case ${newline}${SERVER_PIDS}${newline} in |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 769 | *${newline}${2}${newline}*) break;; |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 770 | esac |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 771 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 772 | echo "$3 START TIMEOUT" |
| 773 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 774 | break |
| 775 | fi |
| 776 | # Linux and *BSD support decimal arguments to sleep. On other |
| 777 | # OSes this may be a tight loop. |
| 778 | sleep 0.1 2>/dev/null || true |
| 779 | done |
| 780 | } |
| 781 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 782 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 783 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 784 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 785 | } |
| 786 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 787 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 788 | # Wait for server process $2 to be listening on port $1. |
| 789 | wait_server_start() { |
| 790 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 791 | } |
| 792 | |
| 793 | # Wait for proxy process $2 to be listening on port $1. |
| 794 | wait_proxy_start() { |
| 795 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 796 | } |
| 797 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 798 | # 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] | 799 | # 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] | 800 | # acceptable bounds |
| 801 | check_server_hello_time() { |
| 802 | # 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] | 803 | 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] | 804 | # Get the Unix timestamp for now |
| 805 | CUR_TIME=$(date +'%s') |
| 806 | THRESHOLD_IN_SECS=300 |
| 807 | |
| 808 | # Check if the ServerHello time was printed |
| 809 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 810 | return 1 |
| 811 | fi |
| 812 | |
| 813 | # Check the time in ServerHello is within acceptable bounds |
| 814 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 815 | # The time in ServerHello is at least 5 minutes before now |
| 816 | return 1 |
| 817 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 818 | # 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] | 819 | return 1 |
| 820 | else |
| 821 | return 0 |
| 822 | fi |
| 823 | } |
| 824 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 825 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 826 | handshake_memory_get() { |
| 827 | OUTPUT_VARIABLE="$1" |
| 828 | OUTPUT_FILE="$2" |
| 829 | |
| 830 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 831 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 832 | |
| 833 | # Check if memory usage was read |
| 834 | if [ -z "$MEM_USAGE" ]; then |
| 835 | echo "Error: Can not read the value of handshake memory usage" |
| 836 | return 1 |
| 837 | else |
| 838 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 839 | return 0 |
| 840 | fi |
| 841 | } |
| 842 | |
| 843 | # Get handshake memory usage from server or client output and check if this value |
| 844 | # is not higher than the maximum given by the first argument |
| 845 | handshake_memory_check() { |
| 846 | MAX_MEMORY="$1" |
| 847 | OUTPUT_FILE="$2" |
| 848 | |
| 849 | # Get memory usage |
| 850 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 851 | return 1 |
| 852 | fi |
| 853 | |
| 854 | # Check if memory usage is below max value |
| 855 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 856 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 857 | "but should be below $MAX_MEMORY bytes" |
| 858 | return 1 |
| 859 | else |
| 860 | return 0 |
| 861 | fi |
| 862 | } |
| 863 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 864 | # wait for client to terminate and set CLI_EXIT |
| 865 | # must be called right after starting the client |
| 866 | wait_client_done() { |
| 867 | CLI_PID=$! |
| 868 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 869 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 870 | CLI_DELAY_FACTOR=1 |
| 871 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 872 | ( 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] | 873 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 874 | |
| 875 | wait $CLI_PID |
| 876 | CLI_EXIT=$? |
| 877 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 878 | kill $DOG_PID >/dev/null 2>&1 |
| 879 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 880 | |
| 881 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 882 | |
| 883 | sleep $SRV_DELAY_SECONDS |
| 884 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 885 | } |
| 886 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 887 | # check if the given command uses dtls and sets global variable DTLS |
| 888 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 889 | case "$1" in |
Paul Elliott | 1428f25 | 2021-10-12 16:02:55 +0100 | [diff] [blame] | 890 | *dtls=1*|*-dtls*|*-u*) DTLS=1;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 891 | *) DTLS=0;; |
| 892 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 893 | } |
| 894 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 895 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 896 | is_gnutls() { |
| 897 | case "$1" in |
| 898 | *gnutls-cli*) |
| 899 | CMD_IS_GNUTLS=1 |
| 900 | ;; |
| 901 | *gnutls-serv*) |
| 902 | CMD_IS_GNUTLS=1 |
| 903 | ;; |
| 904 | *) |
| 905 | CMD_IS_GNUTLS=0 |
| 906 | ;; |
| 907 | esac |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 908 | } |
| 909 | |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 910 | # Determine what calc_verify trace is to be expected, if any. |
| 911 | # |
| 912 | # calc_verify is only called for two things: to calculate the |
| 913 | # extended master secret, and to process client authentication. |
| 914 | # |
| 915 | # Warning: the current implementation assumes that extended_ms is not |
| 916 | # disabled on the client or on the server. |
| 917 | # |
| 918 | # Inputs: |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 919 | # * $1: the value of the server auth_mode parameter. |
| 920 | # 'required' if client authentication is expected, |
| 921 | # 'none' or absent if not. |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 922 | # * $CONFIGS_ENABLED |
| 923 | # |
| 924 | # Outputs: |
| 925 | # * $maybe_calc_verify: set to a trace expected in the debug logs |
| 926 | set_maybe_calc_verify() { |
| 927 | maybe_calc_verify= |
| 928 | case $CONFIGS_ENABLED in |
| 929 | *\ MBEDTLS_SSL_EXTENDED_MASTER_SECRET\ *) :;; |
| 930 | *) |
| 931 | case ${1-} in |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 932 | ''|none) return;; |
| 933 | required) :;; |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 934 | *) echo "Bad parameter 1 to set_maybe_calc_verify: $1"; exit 1;; |
| 935 | esac |
| 936 | esac |
| 937 | case $CONFIGS_ENABLED in |
| 938 | *\ MBEDTLS_USE_PSA_CRYPTO\ *) maybe_calc_verify="PSA calc verify";; |
| 939 | *) maybe_calc_verify="<= calc verify";; |
| 940 | esac |
| 941 | } |
| 942 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 943 | # Compare file content |
| 944 | # Usage: find_in_both pattern file1 file2 |
| 945 | # extract from file1 the first line matching the pattern |
| 946 | # check in file2 that the same line can be found |
| 947 | find_in_both() { |
| 948 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 949 | if [ -z "$srv_pattern" ]; then |
| 950 | return 1; |
| 951 | fi |
| 952 | |
| 953 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 954 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 955 | else |
| 956 | return 1; |
| 957 | fi |
| 958 | } |
| 959 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 960 | SKIP_HANDSHAKE_CHECK="NO" |
| 961 | skip_handshake_stage_check() { |
| 962 | SKIP_HANDSHAKE_CHECK="YES" |
| 963 | } |
| 964 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 965 | # Analyze the commands that will be used in a test. |
| 966 | # |
| 967 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass |
| 968 | # extra arguments or go through wrappers. |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 969 | # |
| 970 | # Inputs: |
| 971 | # * $@: supplemental options to run_test() (after the mandatory arguments). |
| 972 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: the client, proxy and server commands. |
| 973 | # * $DTLS: 1 if DTLS, otherwise 0. |
| 974 | # |
| 975 | # Outputs: |
| 976 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: may be tweaked. |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 977 | analyze_test_commands() { |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 978 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 979 | # 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] | 980 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 981 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 982 | case " $SRV_CMD " in |
| 983 | *' server_addr=::1 '*) |
| 984 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 985 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 986 | fi |
| 987 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 988 | # update CMD_IS_GNUTLS variable |
| 989 | is_gnutls "$SRV_CMD" |
| 990 | |
| 991 | # if the server uses gnutls but doesn't set priority, explicitly |
| 992 | # set the default priority |
| 993 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 994 | case "$SRV_CMD" in |
| 995 | *--priority*) :;; |
| 996 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 997 | esac |
| 998 | fi |
| 999 | |
| 1000 | # update CMD_IS_GNUTLS variable |
| 1001 | is_gnutls "$CLI_CMD" |
| 1002 | |
| 1003 | # if the client uses gnutls but doesn't set priority, explicitly |
| 1004 | # set the default priority |
| 1005 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1006 | case "$CLI_CMD" in |
| 1007 | *--priority*) :;; |
| 1008 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 1009 | esac |
| 1010 | fi |
| 1011 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1012 | # fix client port |
| 1013 | if [ -n "$PXY_CMD" ]; then |
| 1014 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 1015 | else |
| 1016 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 1017 | fi |
| 1018 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1019 | # prepend valgrind to our commands if active |
| 1020 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1021 | if is_polar "$SRV_CMD"; then |
| 1022 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 1023 | fi |
| 1024 | if is_polar "$CLI_CMD"; then |
| 1025 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 1026 | fi |
| 1027 | fi |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1028 | } |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1029 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1030 | # Check for failure conditions after a test case. |
| 1031 | # |
| 1032 | # Inputs from run_test: |
| 1033 | # * positional parameters: test options (see run_test documentation) |
| 1034 | # * $CLI_EXIT: client return code |
| 1035 | # * $CLI_EXPECT: expected client return code |
| 1036 | # * $SRV_RET: server return code |
| 1037 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1038 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1039 | # |
| 1040 | # Outputs: |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1041 | # * $outcome: one of PASS/RETRY*/FAIL |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1042 | check_test_failure() { |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1043 | outcome=FAIL |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1044 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1045 | if [ $TIMES_LEFT -gt 0 ] && |
| 1046 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null |
| 1047 | then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1048 | outcome="RETRY(client-timeout)" |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1049 | return |
| 1050 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1051 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1052 | # 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] | 1053 | # (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] | 1054 | # expected client exit to incorrectly succeed in case of catastrophic |
| 1055 | # failure) |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1056 | if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ] |
| 1057 | then |
| 1058 | if is_polar "$SRV_CMD"; then |
| 1059 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
| 1060 | else |
| 1061 | fail "server or client failed to reach handshake stage" |
| 1062 | return |
| 1063 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1064 | fi |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1065 | if is_polar "$CLI_CMD"; then |
| 1066 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
| 1067 | else |
| 1068 | fail "server or client failed to reach handshake stage" |
| 1069 | return |
| 1070 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1071 | fi |
| 1072 | fi |
| 1073 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1074 | SKIP_HANDSHAKE_CHECK="NO" |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 1075 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 1076 | # exit with status 0 when interrupted by a signal, and we don't really |
| 1077 | # care anyway), in case e.g. the server reports a memory leak. |
| 1078 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 1079 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1080 | return |
| 1081 | fi |
| 1082 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1083 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1084 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 1085 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1086 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1087 | 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] | 1088 | return |
| 1089 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1090 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1091 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1092 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1093 | # 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] | 1094 | while [ $# -gt 0 ] |
| 1095 | do |
| 1096 | case $1 in |
| 1097 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1098 | 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] | 1099 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1100 | return |
| 1101 | fi |
| 1102 | ;; |
| 1103 | |
| 1104 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1105 | 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] | 1106 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1107 | return |
| 1108 | fi |
| 1109 | ;; |
| 1110 | |
| 1111 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1112 | 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] | 1113 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1114 | fail "pattern '$2' MUST NOT be present in the Server output" |
| 1115 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1116 | return |
| 1117 | fi |
| 1118 | ;; |
| 1119 | |
| 1120 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1121 | 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] | 1122 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1123 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 1124 | fi |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1125 | return |
| 1126 | fi |
| 1127 | ;; |
| 1128 | |
| 1129 | # The filtering in the following two options (-u and -U) do the following |
| 1130 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 1131 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1132 | # - keep one of each non-unique line |
| 1133 | # - count how many lines remain |
| 1134 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 1135 | # if there were no duplicates. |
| 1136 | "-U") |
| 1137 | 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 |
| 1138 | fail "lines following pattern '$2' must be unique in Server output" |
| 1139 | return |
| 1140 | fi |
| 1141 | ;; |
| 1142 | |
| 1143 | "-u") |
| 1144 | 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 |
| 1145 | 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] | 1146 | return |
| 1147 | fi |
| 1148 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 1149 | "-F") |
| 1150 | if ! $2 "$SRV_OUT"; then |
| 1151 | fail "function call to '$2' failed on Server output" |
| 1152 | return |
| 1153 | fi |
| 1154 | ;; |
| 1155 | "-f") |
| 1156 | if ! $2 "$CLI_OUT"; then |
| 1157 | fail "function call to '$2' failed on Client output" |
| 1158 | return |
| 1159 | fi |
| 1160 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1161 | "-g") |
| 1162 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 1163 | fail "function call to '$2' failed on Server and Client output" |
| 1164 | return |
| 1165 | fi |
| 1166 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1167 | |
| 1168 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1169 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1170 | exit 1 |
| 1171 | esac |
| 1172 | shift 2 |
| 1173 | done |
| 1174 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1175 | # check valgrind's results |
| 1176 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1177 | 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] | 1178 | fail "Server has memory errors" |
| 1179 | return |
| 1180 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1181 | 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] | 1182 | fail "Client has memory errors" |
| 1183 | return |
| 1184 | fi |
| 1185 | fi |
| 1186 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1187 | # if we're here, everything is ok |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1188 | outcome=PASS |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1189 | } |
| 1190 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1191 | # Run the current test case: start the server and if applicable the proxy, run |
| 1192 | # the client, wait for all processes to finish or time out. |
| 1193 | # |
| 1194 | # Inputs: |
| 1195 | # * $NAME: test case name |
| 1196 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run |
| 1197 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs |
| 1198 | # |
| 1199 | # Outputs: |
| 1200 | # * $CLI_EXIT: client return code |
| 1201 | # * $SRV_RET: server return code |
| 1202 | do_run_test_once() { |
| 1203 | # run the commands |
| 1204 | if [ -n "$PXY_CMD" ]; then |
| 1205 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
| 1206 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 1207 | PXY_PID=$! |
| 1208 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
| 1209 | fi |
| 1210 | |
| 1211 | check_osrv_dtls |
| 1212 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
| 1213 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 1214 | SRV_PID=$! |
| 1215 | wait_server_start "$SRV_PORT" "$SRV_PID" |
| 1216 | |
| 1217 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
| 1218 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 1219 | wait_client_done |
| 1220 | |
| 1221 | sleep 0.05 |
| 1222 | |
| 1223 | # terminate the server (and the proxy) |
| 1224 | kill $SRV_PID |
| 1225 | wait $SRV_PID |
| 1226 | SRV_RET=$? |
| 1227 | |
| 1228 | if [ -n "$PXY_CMD" ]; then |
| 1229 | kill $PXY_PID >/dev/null 2>&1 |
| 1230 | wait $PXY_PID |
| 1231 | fi |
| 1232 | } |
| 1233 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1234 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
| 1235 | # Options: -s pattern pattern that must be present in server output |
| 1236 | # -c pattern pattern that must be present in client output |
| 1237 | # -u pattern lines after pattern must be unique in client output |
| 1238 | # -f call shell function on client output |
| 1239 | # -S pattern pattern that must be absent in server output |
| 1240 | # -C pattern pattern that must be absent in client output |
| 1241 | # -U pattern lines after pattern must be unique in server output |
| 1242 | # -F call shell function on server output |
| 1243 | # -g call shell function on server and client output |
| 1244 | run_test() { |
| 1245 | NAME="$1" |
| 1246 | shift 1 |
| 1247 | |
| 1248 | if is_excluded "$NAME"; then |
| 1249 | SKIP_NEXT="NO" |
| 1250 | # There was no request to run the test, so don't record its outcome. |
| 1251 | return |
| 1252 | fi |
| 1253 | |
| 1254 | print_name "$NAME" |
| 1255 | |
| 1256 | # Do we only run numbered tests? |
| 1257 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 1258 | case ",$RUN_TEST_NUMBER," in |
| 1259 | *",$TESTS,"*) :;; |
| 1260 | *) SKIP_NEXT="YES";; |
| 1261 | esac |
| 1262 | fi |
| 1263 | |
| 1264 | # does this test use a proxy? |
| 1265 | if [ "X$1" = "X-p" ]; then |
| 1266 | PXY_CMD="$2" |
| 1267 | shift 2 |
| 1268 | else |
| 1269 | PXY_CMD="" |
| 1270 | fi |
| 1271 | |
| 1272 | # get commands and client output |
| 1273 | SRV_CMD="$1" |
| 1274 | CLI_CMD="$2" |
| 1275 | CLI_EXPECT="$3" |
| 1276 | shift 3 |
| 1277 | |
| 1278 | # Check if test uses files |
| 1279 | case "$SRV_CMD $CLI_CMD" in |
| 1280 | *data_files/*) |
| 1281 | requires_config_enabled MBEDTLS_FS_IO;; |
| 1282 | esac |
| 1283 | |
Gilles Peskine | 82a4ab2 | 2022-02-25 19:46:30 +0100 | [diff] [blame] | 1284 | # Check if the test uses DTLS. |
| 1285 | detect_dtls "$SRV_CMD" |
| 1286 | if [ "$DTLS" -eq 1 ]; then |
| 1287 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 1288 | fi |
| 1289 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 1290 | # If the client or server requires certain features that can be detected |
| 1291 | # from their command-line arguments, check that they're enabled. |
| 1292 | detect_required_features "$SRV_CMD" "$@" |
| 1293 | detect_required_features "$CLI_CMD" "$@" |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1294 | |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 1295 | # If we're in a PSK-only build and the test can be adapted to PSK, do that. |
| 1296 | maybe_adapt_for_psk "$@" |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1297 | |
| 1298 | # should we skip? |
| 1299 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 1300 | SKIP_NEXT="NO" |
| 1301 | record_outcome "SKIP" |
| 1302 | SKIPS=$(( $SKIPS + 1 )) |
| 1303 | return |
| 1304 | fi |
| 1305 | |
| 1306 | analyze_test_commands "$@" |
| 1307 | |
Andrzej Kurek | 8db7c0e | 2022-04-01 08:52:06 -0400 | [diff] [blame] | 1308 | # One regular run and two retries |
| 1309 | TIMES_LEFT=3 |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1310 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1311 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1312 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1313 | do_run_test_once |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1314 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1315 | check_test_failure "$@" |
| 1316 | case $outcome in |
| 1317 | PASS) break;; |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1318 | RETRY*) printf "$outcome ";; |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1319 | FAIL) return;; |
| 1320 | esac |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1321 | done |
| 1322 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1323 | # If we get this far, the test case passed. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1324 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1325 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1326 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1327 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1328 | if [ -n "$PXY_CMD" ]; then |
| 1329 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1330 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1331 | fi |
| 1332 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1333 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1334 | } |
| 1335 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1336 | run_test_psa() { |
| 1337 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1338 | set_maybe_calc_verify none |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1339 | run_test "PSA-supported ciphersuite: $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1340 | "$P_SRV debug_level=3 force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1341 | "$P_CLI debug_level=3 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1342 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1343 | -c "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1344 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1345 | -s "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1346 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1347 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1348 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1349 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1350 | -S "error" \ |
| 1351 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1352 | unset maybe_calc_verify |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1353 | } |
| 1354 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1355 | run_test_psa_force_curve() { |
| 1356 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1357 | set_maybe_calc_verify none |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1358 | run_test "PSA - ECDH with $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1359 | "$P_SRV debug_level=4 force_version=tls12 curves=$1" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1360 | "$P_CLI debug_level=4 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 curves=$1" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1361 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1362 | -c "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1363 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1364 | -s "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1365 | -s "calc PSA finished" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1366 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1367 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1368 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1369 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1370 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1371 | unset maybe_calc_verify |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1372 | } |
| 1373 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1374 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1375 | # a maximum fragment length. |
| 1376 | # first argument ($1) is MFL for SSL client |
| 1377 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1378 | run_test_memory_after_hanshake_with_mfl() |
| 1379 | { |
| 1380 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1381 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1382 | |
| 1383 | # Leave some margin for robustness |
| 1384 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1385 | |
| 1386 | run_test "Handshake memory usage (MFL $1)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1387 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1388 | "$P_CLI debug_level=3 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1389 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1390 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1391 | 0 \ |
| 1392 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1393 | } |
| 1394 | |
| 1395 | |
| 1396 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1397 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1398 | run_tests_memory_after_hanshake() |
| 1399 | { |
| 1400 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1401 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1402 | |
| 1403 | # first test with default MFU is to get reference memory usage |
| 1404 | MEMORY_USAGE_MFL_16K=0 |
| 1405 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1406 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1407 | "$P_CLI debug_level=3 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1408 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1409 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1410 | 0 \ |
| 1411 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1412 | |
| 1413 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1414 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1415 | |
| 1416 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1417 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1418 | |
| 1419 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1420 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1421 | |
| 1422 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1423 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1424 | } |
| 1425 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1426 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1427 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1428 | rm -f context_srv.txt |
| 1429 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1430 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1431 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1432 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1433 | 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] | 1434 | exit 1 |
| 1435 | } |
| 1436 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1437 | # |
| 1438 | # MAIN |
| 1439 | # |
| 1440 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1441 | get_options "$@" |
| 1442 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1443 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1444 | # patterns rather than regular expressions, use a case statement instead |
| 1445 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1446 | # detects simple cases: plain substring, everything, nothing. |
| 1447 | # |
| 1448 | # As an exception, the character '.' is treated as an ordinary character |
| 1449 | # if it is the only special character in the string. This is because it's |
| 1450 | # rare to need "any one character", but needing a literal '.' is common |
| 1451 | # (e.g. '-f "DTLS 1.2"'). |
| 1452 | need_grep= |
| 1453 | case "$FILTER" in |
| 1454 | '^$') simple_filter=;; |
| 1455 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1456 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1457 | need_grep=1;; |
| 1458 | *) # No regexp or shell-pattern special character |
| 1459 | simple_filter="*$FILTER*";; |
| 1460 | esac |
| 1461 | case "$EXCLUDE" in |
| 1462 | '^$') simple_exclude=;; |
| 1463 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1464 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1465 | need_grep=1;; |
| 1466 | *) # No regexp or shell-pattern special character |
| 1467 | simple_exclude="*$EXCLUDE*";; |
| 1468 | esac |
| 1469 | if [ -n "$need_grep" ]; then |
| 1470 | is_excluded () { |
| 1471 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1472 | } |
| 1473 | else |
| 1474 | is_excluded () { |
| 1475 | case "$1" in |
| 1476 | $simple_exclude) true;; |
| 1477 | $simple_filter) false;; |
| 1478 | *) true;; |
| 1479 | esac |
| 1480 | } |
| 1481 | fi |
| 1482 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1483 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1484 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1485 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1486 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1487 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1488 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1489 | exit 1 |
| 1490 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1491 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1492 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1493 | exit 1 |
| 1494 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1495 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1496 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1497 | exit 1 |
| 1498 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1499 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1500 | if which valgrind >/dev/null 2>&1; then :; else |
| 1501 | echo "Memcheck not possible. Valgrind not found" |
| 1502 | exit 1 |
| 1503 | fi |
| 1504 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1505 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 1506 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1507 | exit 1 |
| 1508 | fi |
| 1509 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1510 | # used by watchdog |
| 1511 | MAIN_PID="$$" |
| 1512 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1513 | # We use somewhat arbitrary delays for tests: |
| 1514 | # - how long do we wait for the server to start (when lsof not available)? |
| 1515 | # - how long do we allow for the client to finish? |
| 1516 | # (not to check performance, just to avoid waiting indefinitely) |
| 1517 | # Things are slower with valgrind, so give extra time here. |
| 1518 | # |
| 1519 | # Note: without lsof, there is a trade-off between the running time of this |
| 1520 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1521 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1522 | # 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] | 1523 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1524 | START_DELAY=6 |
| 1525 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1526 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1527 | START_DELAY=2 |
| 1528 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1529 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1530 | |
| 1531 | # some particular tests need more time: |
| 1532 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1533 | # - for the server, we sleep for a number of seconds after the client exits |
| 1534 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1535 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1536 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1537 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1538 | # 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] | 1539 | # +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] | 1540 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 1541 | # 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] | 1542 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
XiaokangQian | d5d5b60 | 2022-05-23 09:16:20 +0000 | [diff] [blame^] | 1543 | P_SRV_NO_CERT="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1544 | 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] | 1545 | 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] | 1546 | O_SRV="$O_SRV -accept $SRV_PORT" |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1547 | 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] | 1548 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1549 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1550 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1551 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1552 | 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] | 1553 | 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] | 1554 | fi |
| 1555 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 1556 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 1557 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1558 | 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] | 1559 | O_NEXT_CLI="$O_NEXT_CLI -connect 127.0.0.1:+SRV_PORT" |
XiaokangQian | d5d5b60 | 2022-05-23 09:16:20 +0000 | [diff] [blame^] | 1560 | O_NEXT_CLI_NO_CERT="$O_NEXT_CLI_NO_CERT -connect 127.0.0.1:+SRV_PORT" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 1561 | fi |
| 1562 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1563 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1564 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1565 | 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] | 1566 | fi |
| 1567 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1568 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1569 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1570 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1571 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1572 | # Allow SHA-1, because many of our test certificates use it |
| 1573 | P_SRV="$P_SRV allow_sha1=1" |
| 1574 | P_CLI="$P_CLI allow_sha1=1" |
| 1575 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1576 | # Also pick a unique name for intermediate files |
| 1577 | SRV_OUT="srv_out.$$" |
| 1578 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1579 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1580 | SESSION="session.$$" |
| 1581 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1582 | SKIP_NEXT="NO" |
| 1583 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1584 | trap cleanup INT TERM HUP |
| 1585 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1586 | # Basic test |
| 1587 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1588 | # Checks that: |
| 1589 | # - 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] | 1590 | # - the expected parameters are selected |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1591 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 1592 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Gilles Peskine | 1438e16 | 2022-04-05 22:00:32 +0200 | [diff] [blame] | 1593 | requires_config_enabled MBEDTLS_SHA512_C # "signature_algorithm ext: 6" |
| 1594 | requires_config_enabled MBEDTLS_ECP_DP_CURVE25519_ENABLED |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1595 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1596 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1597 | "$P_CLI" \ |
| 1598 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1599 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1600 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1601 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 1602 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1603 | -S "error" \ |
| 1604 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1605 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1606 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 1607 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1608 | run_test "Default, DTLS" \ |
| 1609 | "$P_SRV dtls=1" \ |
| 1610 | "$P_CLI dtls=1" \ |
| 1611 | 0 \ |
| 1612 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1613 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1614 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1615 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1616 | run_test "TLS client auth: required" \ |
| 1617 | "$P_SRV auth_mode=required" \ |
| 1618 | "$P_CLI" \ |
| 1619 | 0 \ |
| 1620 | -s "Verifying peer X.509 certificate... ok" |
| 1621 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1622 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 1623 | run_test "key size: TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1624 | "$P_SRV" \ |
| 1625 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1626 | 0 \ |
| 1627 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1628 | -c "Key size is 256" |
| 1629 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1630 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 1631 | run_test "key size: TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1632 | "$P_SRV" \ |
| 1633 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1634 | 0 \ |
| 1635 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1636 | -c "Key size is 128" |
| 1637 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1638 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1639 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1640 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1641 | requires_config_enabled MBEDTLS_SHA256_C |
| 1642 | run_test "TLS: password protected client key" \ |
| 1643 | "$P_SRV auth_mode=required" \ |
| 1644 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1645 | 0 |
| 1646 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1647 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1648 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1649 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1650 | requires_config_enabled MBEDTLS_SHA256_C |
| 1651 | run_test "TLS: password protected server key" \ |
| 1652 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1653 | "$P_CLI" \ |
| 1654 | 0 |
| 1655 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1656 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1657 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1658 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1659 | requires_config_enabled MBEDTLS_RSA_C |
| 1660 | requires_config_enabled MBEDTLS_SHA256_C |
| 1661 | run_test "TLS: password protected server key, two certificates" \ |
| 1662 | "$P_SRV \ |
| 1663 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1664 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1665 | "$P_CLI" \ |
| 1666 | 0 |
| 1667 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1668 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1669 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1670 | run_test "CA callback on client" \ |
| 1671 | "$P_SRV debug_level=3" \ |
| 1672 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1673 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1674 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1675 | -S "error" \ |
| 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 | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1679 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1680 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1681 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1682 | requires_config_enabled MBEDTLS_SHA256_C |
| 1683 | run_test "CA callback on server" \ |
| 1684 | "$P_SRV auth_mode=required" \ |
| 1685 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1686 | key_file=data_files/server5.key" \ |
| 1687 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1688 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1689 | -s "Verifying peer X.509 certificate... ok" \ |
| 1690 | -S "error" \ |
| 1691 | -C "error" |
| 1692 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1693 | # Test using an EC opaque private key for client authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1694 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1695 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1696 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1697 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1698 | requires_config_enabled MBEDTLS_SHA256_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1699 | run_test "TLS-ECDHE-ECDSA Opaque key for client authentication" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1700 | "$P_SRV auth_mode=required crt_file=data_files/server5.crt \ |
| 1701 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1702 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1703 | key_file=data_files/server5.key" \ |
| 1704 | 0 \ |
| 1705 | -c "key type: Opaque" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1706 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1707 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1708 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1709 | -S "error" \ |
| 1710 | -C "error" |
| 1711 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1712 | # Test using a RSA opaque private key for client authentication |
| 1713 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1714 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1715 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1716 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1717 | requires_config_enabled MBEDTLS_RSA_C |
| 1718 | requires_config_enabled MBEDTLS_SHA256_C |
| 1719 | run_test "TLS-ECDHE-RSA Opaque key for client authentication" \ |
| 1720 | "$P_SRV auth_mode=required crt_file=data_files/server2-sha256.crt \ |
| 1721 | key_file=data_files/server2.key" \ |
| 1722 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 1723 | key_file=data_files/server2.key" \ |
| 1724 | 0 \ |
| 1725 | -c "key type: Opaque" \ |
| 1726 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 1727 | -s "Verifying peer X.509 certificate... ok" \ |
| 1728 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 1729 | -S "error" \ |
| 1730 | -C "error" |
| 1731 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 1732 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1733 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1734 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1735 | requires_config_enabled MBEDTLS_RSA_C |
| 1736 | requires_config_enabled MBEDTLS_SHA256_C |
| 1737 | run_test "TLS-DHE-RSA Opaque key for client authentication" \ |
| 1738 | "$P_SRV auth_mode=required crt_file=data_files/server2-sha256.crt \ |
| 1739 | key_file=data_files/server2.key" \ |
| 1740 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 1741 | key_file=data_files/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 1742 | 0 \ |
| 1743 | -c "key type: Opaque" \ |
| 1744 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 1745 | -s "Verifying peer X.509 certificate... ok" \ |
| 1746 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 1747 | -S "error" \ |
| 1748 | -C "error" |
| 1749 | |
Przemek Stekiel | 8da6da3 | 2022-05-16 14:37:50 +0200 | [diff] [blame] | 1750 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1751 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1752 | requires_config_enabled MBEDTLS_RSA_C |
| 1753 | run_test "RSA opaque key on server configured for decryption" \ |
| 1754 | "$P_SRV debug_level=1 key_opaque=1 key_opaque_algs=rsa-decrypt,none" \ |
| 1755 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA256" \ |
| 1756 | 0 \ |
| 1757 | -c "Verifying peer X.509 certificate... ok" \ |
| 1758 | -c "Ciphersuite is TLS-RSA-" \ |
| 1759 | -s "key types: Opaque, Opaque" \ |
| 1760 | -s "Ciphersuite is TLS-RSA-" \ |
| 1761 | -S "error" \ |
| 1762 | -C "error" |
| 1763 | |
| 1764 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1765 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1766 | requires_config_enabled MBEDTLS_RSA_C |
| 1767 | run_test "RSA-PSK opaque key on server configured for decryption" \ |
| 1768 | "$P_SRV debug_level=1 key_opaque=1 key_opaque_algs=rsa-decrypt,none \ |
| 1769 | psk=abc123 psk_identity=foo" \ |
| 1770 | "$P_CLI force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \ |
| 1771 | psk=abc123 psk_identity=foo" \ |
| 1772 | 0 \ |
| 1773 | -c "Verifying peer X.509 certificate... ok" \ |
| 1774 | -c "Ciphersuite is TLS-RSA-PSK-" \ |
| 1775 | -s "key types: Opaque, Opaque" \ |
| 1776 | -s "Ciphersuite is TLS-RSA-PSK-" \ |
| 1777 | -S "error" \ |
| 1778 | -C "error" |
| 1779 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1780 | # Test using an EC opaque private key for server authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1781 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1782 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1783 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1784 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1785 | requires_config_enabled MBEDTLS_SHA256_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1786 | run_test "TLS-ECDHE-ECDSA Opaque key for server authentication" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1787 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
| 1788 | key_file=data_files/server5.key" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1789 | "$P_CLI crt_file=data_files/server5.crt \ |
| 1790 | key_file=data_files/server5.key" \ |
| 1791 | 0 \ |
| 1792 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1793 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 1794 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1795 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1796 | -S "error" \ |
| 1797 | -C "error" |
| 1798 | |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 1799 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1800 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1801 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1802 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1803 | requires_config_enabled MBEDTLS_SHA256_C |
| 1804 | run_test "Opaque key for server authentication (ECDH-)" \ |
Neil Armstrong | b7b549a | 2022-03-25 15:13:02 +0100 | [diff] [blame] | 1805 | "$P_SRV force_version=tls12 auth_mode=required key_opaque=1\ |
| 1806 | crt_file=data_files/server5.ku-ka.crt\ |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 1807 | key_file=data_files/server5.key" \ |
| 1808 | "$P_CLI" \ |
| 1809 | 0 \ |
| 1810 | -c "Verifying peer X.509 certificate... ok" \ |
| 1811 | -c "Ciphersuite is TLS-ECDH-" \ |
| 1812 | -s "key types: Opaque, none" \ |
| 1813 | -s "Ciphersuite is TLS-ECDH-" \ |
| 1814 | -S "error" \ |
| 1815 | -C "error" |
| 1816 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1817 | # Test using a RSA opaque private key for server authentication |
| 1818 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1819 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1820 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1821 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1822 | requires_config_enabled MBEDTLS_RSA_C |
| 1823 | requires_config_enabled MBEDTLS_SHA256_C |
| 1824 | run_test "TLS-ECDHE-RSA Opaque key for server authentication" \ |
| 1825 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 1826 | key_file=data_files/server2.key" \ |
| 1827 | "$P_CLI crt_file=data_files/server2-sha256.crt \ |
| 1828 | key_file=data_files/server2.key" \ |
| 1829 | 0 \ |
| 1830 | -c "Verifying peer X.509 certificate... ok" \ |
| 1831 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 1832 | -s "key types: Opaque, none" \ |
| 1833 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 1834 | -S "error" \ |
| 1835 | -C "error" |
| 1836 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 1837 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1838 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1839 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1840 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1841 | requires_config_enabled MBEDTLS_RSA_C |
| 1842 | requires_config_enabled MBEDTLS_SHA256_C |
| 1843 | run_test "TLS-DHE-RSA Opaque key for server authentication" \ |
| 1844 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 1845 | key_file=data_files/server2.key" \ |
| 1846 | "$P_CLI crt_file=data_files/server2-sha256.crt \ |
| 1847 | key_file=data_files/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 1848 | 0 \ |
| 1849 | -c "Verifying peer X.509 certificate... ok" \ |
| 1850 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 1851 | -s "key types: Opaque, none" \ |
| 1852 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 1853 | -S "error" \ |
| 1854 | -C "error" |
| 1855 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1856 | # Test using an EC opaque private key for client/server authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1857 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1858 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1859 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1860 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1861 | requires_config_enabled MBEDTLS_SHA256_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1862 | run_test "TLS-ECDHE-ECDSA Opaque key for client/server authentication" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1863 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
| 1864 | key_file=data_files/server5.key" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1865 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1866 | key_file=data_files/server5.key" \ |
| 1867 | 0 \ |
| 1868 | -c "key type: Opaque" \ |
| 1869 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1870 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 1871 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1872 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1873 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1874 | -S "error" \ |
| 1875 | -C "error" |
| 1876 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1877 | # Test using a RSA opaque private key for client/server authentication |
| 1878 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1879 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1880 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1881 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1882 | requires_config_enabled MBEDTLS_RSA_C |
| 1883 | requires_config_enabled MBEDTLS_SHA256_C |
| 1884 | run_test "TLS-ECDHE-RSA Opaque key for client/server authentication" \ |
| 1885 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 1886 | key_file=data_files/server2.key" \ |
| 1887 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 1888 | key_file=data_files/server2.key" \ |
| 1889 | 0 \ |
| 1890 | -c "key type: Opaque" \ |
| 1891 | -c "Verifying peer X.509 certificate... ok" \ |
| 1892 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 1893 | -s "key types: Opaque, none" \ |
| 1894 | -s "Verifying peer X.509 certificate... ok" \ |
| 1895 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 1896 | -S "error" \ |
| 1897 | -C "error" |
| 1898 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 1899 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1900 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1901 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1902 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1903 | requires_config_enabled MBEDTLS_RSA_C |
| 1904 | requires_config_enabled MBEDTLS_SHA256_C |
| 1905 | run_test "TLS-DHE-RSA Opaque key for client/server authentication" \ |
| 1906 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 1907 | key_file=data_files/server2.key" \ |
| 1908 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 1909 | key_file=data_files/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 1910 | 0 \ |
| 1911 | -c "key type: Opaque" \ |
| 1912 | -c "Verifying peer X.509 certificate... ok" \ |
| 1913 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 1914 | -s "key types: Opaque, none" \ |
| 1915 | -s "Verifying peer X.509 certificate... ok" \ |
| 1916 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 1917 | -S "error" \ |
| 1918 | -C "error" |
| 1919 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1920 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 1921 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 1922 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 1923 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 1924 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 1925 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 1926 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 1927 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 1928 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 1929 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 1930 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 1931 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1932 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1933 | run_test_psa_force_curve "secp521r1" |
| 1934 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 1935 | run_test_psa_force_curve "brainpoolP512r1" |
| 1936 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 1937 | run_test_psa_force_curve "secp384r1" |
| 1938 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1939 | run_test_psa_force_curve "brainpoolP384r1" |
| 1940 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1941 | run_test_psa_force_curve "secp256r1" |
| 1942 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1943 | run_test_psa_force_curve "secp256k1" |
| 1944 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1945 | run_test_psa_force_curve "brainpoolP256r1" |
| 1946 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1947 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1948 | ## SECP224K1 is buggy via the PSA API |
Dave Rodgman | 017a199 | 2022-03-31 14:07:01 +0100 | [diff] [blame] | 1949 | ## (https://github.com/Mbed-TLS/mbedtls/issues/3541), |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1950 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 1951 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 1952 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 1953 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1954 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1955 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1956 | run_test_psa_force_curve "secp192r1" |
| 1957 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1958 | run_test_psa_force_curve "secp192k1" |
| 1959 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1960 | # Test current time in ServerHello |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1961 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1962 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 1963 | run_test "ServerHello contains gmt_unix_time" \ |
| 1964 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1965 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1966 | 0 \ |
| 1967 | -f "check_server_hello_time" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1968 | -F "check_server_hello_time" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1969 | |
| 1970 | # Test for uniqueness of IVs in AEAD ciphersuites |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1971 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1972 | run_test "Unique IV in GCM" \ |
| 1973 | "$P_SRV exchanges=20 debug_level=4" \ |
| 1974 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 1975 | 0 \ |
| 1976 | -u "IV used" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1977 | -U "IV used" |
| 1978 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1979 | # Tests for certificate verification callback |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1980 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1981 | run_test "Configuration-specific CRT verification callback" \ |
| 1982 | "$P_SRV debug_level=3" \ |
| 1983 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1984 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1985 | -S "error" \ |
| 1986 | -c "Verify requested for " \ |
| 1987 | -c "Use configuration-specific verification callback" \ |
| 1988 | -C "Use context-specific verification callback" \ |
| 1989 | -C "error" |
| 1990 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1991 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1992 | run_test "Context-specific CRT verification callback" \ |
| 1993 | "$P_SRV debug_level=3" \ |
| 1994 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 1995 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1996 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1997 | -c "Verify requested for " \ |
| 1998 | -c "Use context-specific verification callback" \ |
| 1999 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2000 | -C "error" |
| 2001 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2002 | # Tests for SHA-1 support |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2003 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2004 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 2005 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 2006 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 2007 | 1 \ |
| 2008 | -c "The certificate is signed with an unacceptable hash" |
| 2009 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2010 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2011 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 2012 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 2013 | "$P_CLI allow_sha1=1" \ |
| 2014 | 0 |
| 2015 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2016 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2017 | run_test "SHA-256 allowed by default in server certificate" \ |
| 2018 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 2019 | "$P_CLI allow_sha1=0" \ |
| 2020 | 0 |
| 2021 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2022 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2023 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 2024 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 2025 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 2026 | 1 \ |
| 2027 | -s "The certificate is signed with an unacceptable hash" |
| 2028 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2029 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2030 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 2031 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 2032 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 2033 | 0 |
| 2034 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2035 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2036 | run_test "SHA-256 allowed by default in client certificate" \ |
| 2037 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 2038 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 2039 | 0 |
| 2040 | |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2041 | # Dummy TLS 1.3 test |
| 2042 | # Currently only checking that passing TLS 1.3 key exchange modes to |
| 2043 | # ssl_client2/ssl_server2 example programs works. |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2044 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2045 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2046 | run_test "TLS 1.3: key exchange mode parameter passing: PSK only" \ |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2047 | "$P_SRV tls13_kex_modes=psk debug_level=4" \ |
| 2048 | "$P_CLI tls13_kex_modes=psk debug_level=4" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2049 | 0 |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2050 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2051 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2052 | run_test "TLS 1.3: key exchange mode parameter passing: PSK-ephemeral only" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2053 | "$P_SRV tls13_kex_modes=psk_ephemeral" \ |
| 2054 | "$P_CLI tls13_kex_modes=psk_ephemeral" \ |
| 2055 | 0 |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2056 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2057 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2058 | 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] | 2059 | "$P_SRV tls13_kex_modes=ephemeral" \ |
| 2060 | "$P_CLI tls13_kex_modes=ephemeral" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2061 | 0 |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2062 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2063 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2064 | run_test "TLS 1.3: key exchange mode parameter passing: All ephemeral" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2065 | "$P_SRV tls13_kex_modes=ephemeral_all" \ |
| 2066 | "$P_CLI tls13_kex_modes=ephemeral_all" \ |
| 2067 | 0 |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2068 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2069 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2070 | run_test "TLS 1.3: key exchange mode parameter passing: All PSK" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2071 | "$P_SRV tls13_kex_modes=psk_all" \ |
| 2072 | "$P_CLI tls13_kex_modes=psk_all" \ |
| 2073 | 0 |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2074 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2075 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2076 | run_test "TLS 1.3: key exchange mode parameter passing: All" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2077 | "$P_SRV tls13_kex_modes=all" \ |
| 2078 | "$P_CLI tls13_kex_modes=all" \ |
| 2079 | 0 |
| 2080 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2081 | # Tests for datagram packing |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2082 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2083 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 2084 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2085 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2086 | 0 \ |
| 2087 | -c "next record in same datagram" \ |
| 2088 | -s "next record in same datagram" |
| 2089 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2090 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2091 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 2092 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2093 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2094 | 0 \ |
| 2095 | -s "next record in same datagram" \ |
| 2096 | -C "next record in same datagram" |
| 2097 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2098 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2099 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 2100 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2101 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2102 | 0 \ |
| 2103 | -S "next record in same datagram" \ |
| 2104 | -c "next record in same datagram" |
| 2105 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2106 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2107 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 2108 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2109 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2110 | 0 \ |
| 2111 | -S "next record in same datagram" \ |
| 2112 | -C "next record in same datagram" |
| 2113 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2114 | # Tests for Context serialization |
| 2115 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2116 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2117 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2118 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2119 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2120 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2121 | 0 \ |
| 2122 | -c "Deserializing connection..." \ |
| 2123 | -S "Deserializing connection..." |
| 2124 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2125 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2126 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2127 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 2128 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2129 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2130 | 0 \ |
| 2131 | -c "Deserializing connection..." \ |
| 2132 | -S "Deserializing connection..." |
| 2133 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2134 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2135 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2136 | run_test "Context serialization, client serializes, GCM" \ |
| 2137 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2138 | "$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] | 2139 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2140 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2141 | -S "Deserializing connection..." |
| 2142 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2143 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2144 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2145 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2146 | run_test "Context serialization, client serializes, with CID" \ |
| 2147 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2148 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2149 | 0 \ |
| 2150 | -c "Deserializing connection..." \ |
| 2151 | -S "Deserializing connection..." |
| 2152 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2153 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2154 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2155 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2156 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2157 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2158 | 0 \ |
| 2159 | -C "Deserializing connection..." \ |
| 2160 | -s "Deserializing connection..." |
| 2161 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2162 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2163 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2164 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 2165 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2166 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2167 | 0 \ |
| 2168 | -C "Deserializing connection..." \ |
| 2169 | -s "Deserializing connection..." |
| 2170 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2171 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2172 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2173 | run_test "Context serialization, server serializes, GCM" \ |
| 2174 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2175 | "$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] | 2176 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2177 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2178 | -s "Deserializing connection..." |
| 2179 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2180 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2181 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2182 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2183 | run_test "Context serialization, server serializes, with CID" \ |
| 2184 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2185 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2186 | 0 \ |
| 2187 | -C "Deserializing connection..." \ |
| 2188 | -s "Deserializing connection..." |
| 2189 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2190 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2191 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2192 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2193 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2194 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2195 | 0 \ |
| 2196 | -c "Deserializing connection..." \ |
| 2197 | -s "Deserializing connection..." |
| 2198 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2199 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2200 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2201 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 2202 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2203 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2204 | 0 \ |
| 2205 | -c "Deserializing connection..." \ |
| 2206 | -s "Deserializing connection..." |
| 2207 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2208 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2209 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2210 | run_test "Context serialization, both serialize, GCM" \ |
| 2211 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2212 | "$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] | 2213 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2214 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2215 | -s "Deserializing connection..." |
| 2216 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2217 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2218 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2219 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2220 | run_test "Context serialization, both serialize, with CID" \ |
| 2221 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2222 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2223 | 0 \ |
| 2224 | -c "Deserializing connection..." \ |
| 2225 | -s "Deserializing connection..." |
| 2226 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2227 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2228 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2229 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2230 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2231 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2232 | 0 \ |
| 2233 | -c "Deserializing connection..." \ |
| 2234 | -S "Deserializing connection..." |
| 2235 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2236 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2237 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2238 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 2239 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2240 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2241 | 0 \ |
| 2242 | -c "Deserializing connection..." \ |
| 2243 | -S "Deserializing connection..." |
| 2244 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2245 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2246 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2247 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 2248 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2249 | "$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] | 2250 | 0 \ |
| 2251 | -c "Deserializing connection..." \ |
| 2252 | -S "Deserializing connection..." |
| 2253 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2254 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2255 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2256 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2257 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 2258 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2259 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2260 | 0 \ |
| 2261 | -c "Deserializing connection..." \ |
| 2262 | -S "Deserializing connection..." |
| 2263 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2264 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2265 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2266 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2267 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2268 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2269 | 0 \ |
| 2270 | -C "Deserializing connection..." \ |
| 2271 | -s "Deserializing connection..." |
| 2272 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2273 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2274 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2275 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 2276 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2277 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2278 | 0 \ |
| 2279 | -C "Deserializing connection..." \ |
| 2280 | -s "Deserializing connection..." |
| 2281 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2282 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2283 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2284 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 2285 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2286 | "$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] | 2287 | 0 \ |
| 2288 | -C "Deserializing connection..." \ |
| 2289 | -s "Deserializing connection..." |
| 2290 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2291 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2292 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2293 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2294 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 2295 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2296 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2297 | 0 \ |
| 2298 | -C "Deserializing connection..." \ |
| 2299 | -s "Deserializing connection..." |
| 2300 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2301 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2302 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2303 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2304 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2305 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2306 | 0 \ |
| 2307 | -c "Deserializing connection..." \ |
| 2308 | -s "Deserializing connection..." |
| 2309 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2310 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2311 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2312 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 2313 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2314 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2315 | 0 \ |
| 2316 | -c "Deserializing connection..." \ |
| 2317 | -s "Deserializing connection..." |
| 2318 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2319 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2320 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2321 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 2322 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2323 | "$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] | 2324 | 0 \ |
| 2325 | -c "Deserializing connection..." \ |
| 2326 | -s "Deserializing connection..." |
| 2327 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2328 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2329 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2330 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2331 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 2332 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2333 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2334 | 0 \ |
| 2335 | -c "Deserializing connection..." \ |
| 2336 | -s "Deserializing connection..." |
| 2337 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2338 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 2339 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2340 | run_test "Saving the serialized context to a file" \ |
| 2341 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 2342 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 2343 | 0 \ |
| 2344 | -s "Save serialized context to a file... ok" \ |
| 2345 | -c "Save serialized context to a file... ok" |
| 2346 | rm -f context_srv.txt |
| 2347 | rm -f context_cli.txt |
| 2348 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2349 | # Tests for DTLS Connection ID extension |
| 2350 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2351 | # So far, the CID API isn't implemented, so we can't |
| 2352 | # grep for output witnessing its use. This needs to be |
| 2353 | # changed once the CID extension is implemented. |
| 2354 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2355 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2356 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2357 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2358 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 2359 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2360 | 0 \ |
| 2361 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2362 | -s "found CID extension" \ |
| 2363 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2364 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2365 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2366 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2367 | -C "found CID extension" \ |
| 2368 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2369 | -C "Copy CIDs into SSL transform" \ |
| 2370 | -c "Use of Connection ID was rejected by the server" |
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 disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2375 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2376 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 2377 | 0 \ |
| 2378 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2379 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2380 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2381 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2382 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2383 | -C "found CID extension" \ |
| 2384 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2385 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 2386 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2387 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2388 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2389 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2390 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2391 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2392 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 2393 | 0 \ |
| 2394 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2395 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2396 | -c "client hello, adding CID extension" \ |
| 2397 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2398 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2399 | -s "server hello, adding CID extension" \ |
| 2400 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2401 | -c "Use of CID extension negotiated" \ |
| 2402 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2403 | -c "Copy CIDs into SSL transform" \ |
| 2404 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2405 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2406 | -s "Use of Connection ID has been negotiated" \ |
| 2407 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2408 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2409 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2410 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2411 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2412 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2413 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 2414 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 2415 | 0 \ |
| 2416 | -c "Enable use of CID extension." \ |
| 2417 | -s "Enable use of CID extension." \ |
| 2418 | -c "client hello, adding CID extension" \ |
| 2419 | -s "found CID extension" \ |
| 2420 | -s "Use of CID extension negotiated" \ |
| 2421 | -s "server hello, adding CID extension" \ |
| 2422 | -c "found CID extension" \ |
| 2423 | -c "Use of CID extension negotiated" \ |
| 2424 | -s "Copy CIDs into SSL transform" \ |
| 2425 | -c "Copy CIDs into SSL transform" \ |
| 2426 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2427 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2428 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2429 | -c "Use of Connection ID has been negotiated" \ |
| 2430 | -c "ignoring unexpected CID" \ |
| 2431 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2432 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2433 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2434 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2435 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 2436 | -p "$P_PXY mtu=800" \ |
| 2437 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2438 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2439 | 0 \ |
| 2440 | -c "Enable use of CID extension." \ |
| 2441 | -s "Enable use of CID extension." \ |
| 2442 | -c "client hello, adding CID extension" \ |
| 2443 | -s "found CID extension" \ |
| 2444 | -s "Use of CID extension negotiated" \ |
| 2445 | -s "server hello, adding CID extension" \ |
| 2446 | -c "found CID extension" \ |
| 2447 | -c "Use of CID extension negotiated" \ |
| 2448 | -s "Copy CIDs into SSL transform" \ |
| 2449 | -c "Copy CIDs into SSL transform" \ |
| 2450 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2451 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2452 | -s "Use of Connection ID has been negotiated" \ |
| 2453 | -c "Use of Connection ID has been negotiated" |
| 2454 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2455 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2456 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2457 | 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] | 2458 | -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] | 2459 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2460 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2461 | 0 \ |
| 2462 | -c "Enable use of CID extension." \ |
| 2463 | -s "Enable use of CID extension." \ |
| 2464 | -c "client hello, adding CID extension" \ |
| 2465 | -s "found CID extension" \ |
| 2466 | -s "Use of CID extension negotiated" \ |
| 2467 | -s "server hello, adding CID extension" \ |
| 2468 | -c "found CID extension" \ |
| 2469 | -c "Use of CID extension negotiated" \ |
| 2470 | -s "Copy CIDs into SSL transform" \ |
| 2471 | -c "Copy CIDs into SSL transform" \ |
| 2472 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2473 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2474 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2475 | -c "Use of Connection ID has been negotiated" \ |
| 2476 | -c "ignoring unexpected CID" \ |
| 2477 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2478 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2479 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2480 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2481 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2482 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2483 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2484 | 0 \ |
| 2485 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2486 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2487 | -c "client hello, adding CID extension" \ |
| 2488 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2489 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2490 | -s "server hello, adding CID extension" \ |
| 2491 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2492 | -c "Use of CID extension negotiated" \ |
| 2493 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2494 | -c "Copy CIDs into SSL transform" \ |
| 2495 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2496 | -s "Peer CID (length 0 Bytes):" \ |
| 2497 | -s "Use of Connection ID has been negotiated" \ |
| 2498 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2499 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2500 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2501 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2502 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2503 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2504 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2505 | 0 \ |
| 2506 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2507 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2508 | -c "client hello, adding CID extension" \ |
| 2509 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2510 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2511 | -s "server hello, adding CID extension" \ |
| 2512 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2513 | -c "Use of CID extension negotiated" \ |
| 2514 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2515 | -c "Copy CIDs into SSL transform" \ |
| 2516 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2517 | -c "Peer CID (length 0 Bytes):" \ |
| 2518 | -s "Use of Connection ID has been negotiated" \ |
| 2519 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2520 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2521 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2522 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2523 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2524 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2525 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2526 | 0 \ |
| 2527 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2528 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2529 | -c "client hello, adding CID extension" \ |
| 2530 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2531 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2532 | -s "server hello, adding CID extension" \ |
| 2533 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2534 | -c "Use of CID extension negotiated" \ |
| 2535 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2536 | -c "Copy CIDs into SSL transform" \ |
| 2537 | -S "Use of Connection ID has been negotiated" \ |
| 2538 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2539 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2540 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2541 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2542 | 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] | 2543 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2544 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2545 | 0 \ |
| 2546 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2547 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2548 | -c "client hello, adding CID extension" \ |
| 2549 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2550 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2551 | -s "server hello, adding CID extension" \ |
| 2552 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2553 | -c "Use of CID extension negotiated" \ |
| 2554 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2555 | -c "Copy CIDs into SSL transform" \ |
| 2556 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2557 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2558 | -s "Use of Connection ID has been negotiated" \ |
| 2559 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2560 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2561 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2562 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2563 | 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] | 2564 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2565 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2566 | 0 \ |
| 2567 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2568 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2569 | -c "client hello, adding CID extension" \ |
| 2570 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2571 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2572 | -s "server hello, adding CID extension" \ |
| 2573 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2574 | -c "Use of CID extension negotiated" \ |
| 2575 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2576 | -c "Copy CIDs into SSL transform" \ |
| 2577 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2578 | -s "Peer CID (length 0 Bytes):" \ |
| 2579 | -s "Use of Connection ID has been negotiated" \ |
| 2580 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2581 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2582 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2583 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2584 | 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] | 2585 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2586 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2587 | 0 \ |
| 2588 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2589 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2590 | -c "client hello, adding CID extension" \ |
| 2591 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2592 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2593 | -s "server hello, adding CID extension" \ |
| 2594 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2595 | -c "Use of CID extension negotiated" \ |
| 2596 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2597 | -c "Copy CIDs into SSL transform" \ |
| 2598 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2599 | -c "Peer CID (length 0 Bytes):" \ |
| 2600 | -s "Use of Connection ID has been negotiated" \ |
| 2601 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2602 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2603 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2604 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2605 | 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] | 2606 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2607 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2608 | 0 \ |
| 2609 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2610 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2611 | -c "client hello, adding CID extension" \ |
| 2612 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2613 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2614 | -s "server hello, adding CID extension" \ |
| 2615 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2616 | -c "Use of CID extension negotiated" \ |
| 2617 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2618 | -c "Copy CIDs into SSL transform" \ |
| 2619 | -S "Use of Connection ID has been negotiated" \ |
| 2620 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2621 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2622 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2623 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2624 | 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] | 2625 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2626 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2627 | 0 \ |
| 2628 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2629 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2630 | -c "client hello, adding CID extension" \ |
| 2631 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2632 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2633 | -s "server hello, adding CID extension" \ |
| 2634 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2635 | -c "Use of CID extension negotiated" \ |
| 2636 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2637 | -c "Copy CIDs into SSL transform" \ |
| 2638 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2639 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2640 | -s "Use of Connection ID has been negotiated" \ |
| 2641 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2642 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2643 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2644 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2645 | 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] | 2646 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2647 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2648 | 0 \ |
| 2649 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2650 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2651 | -c "client hello, adding CID extension" \ |
| 2652 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2653 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2654 | -s "server hello, adding CID extension" \ |
| 2655 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2656 | -c "Use of CID extension negotiated" \ |
| 2657 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2658 | -c "Copy CIDs into SSL transform" \ |
| 2659 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2660 | -s "Peer CID (length 0 Bytes):" \ |
| 2661 | -s "Use of Connection ID has been negotiated" \ |
| 2662 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2663 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2664 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2665 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2666 | 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] | 2667 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2668 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2669 | 0 \ |
| 2670 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2671 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2672 | -c "client hello, adding CID extension" \ |
| 2673 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2674 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2675 | -s "server hello, adding CID extension" \ |
| 2676 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2677 | -c "Use of CID extension negotiated" \ |
| 2678 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2679 | -c "Copy CIDs into SSL transform" \ |
| 2680 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2681 | -c "Peer CID (length 0 Bytes):" \ |
| 2682 | -s "Use of Connection ID has been negotiated" \ |
| 2683 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2684 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2685 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2686 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2687 | 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] | 2688 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2689 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2690 | 0 \ |
| 2691 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2692 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2693 | -c "client hello, adding CID extension" \ |
| 2694 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2695 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2696 | -s "server hello, adding CID extension" \ |
| 2697 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2698 | -c "Use of CID extension negotiated" \ |
| 2699 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2700 | -c "Copy CIDs into SSL transform" \ |
| 2701 | -S "Use of Connection ID has been negotiated" \ |
| 2702 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2703 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2704 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2705 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 2706 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2707 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2708 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2709 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2710 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2711 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2712 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2713 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2714 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2715 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2716 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2717 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2718 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2719 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2720 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2721 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2722 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2723 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2724 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2725 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2726 | 0 \ |
| 2727 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2728 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2729 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2730 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2731 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2732 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2733 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2734 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2735 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2736 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2737 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2738 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2739 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 2740 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2741 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2742 | 0 \ |
| 2743 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2744 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2745 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2746 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2747 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2748 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2749 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2750 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2751 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2752 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2753 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2754 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2755 | 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] | 2756 | -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] | 2757 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2758 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2759 | 0 \ |
| 2760 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2761 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2762 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2763 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2764 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2765 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2766 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2767 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2768 | -c "ignoring unexpected CID" \ |
| 2769 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2770 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2771 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2772 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2773 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2774 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2775 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2776 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2777 | 0 \ |
| 2778 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2779 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2780 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2781 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2782 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2783 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2784 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2785 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2786 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2787 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2788 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2789 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2790 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 2791 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2792 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2793 | 0 \ |
| 2794 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2795 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2796 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2797 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2798 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2799 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2800 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2801 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2802 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2803 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2804 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2805 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2806 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2807 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2808 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2809 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2810 | 0 \ |
| 2811 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2812 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2813 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2814 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2815 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2816 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2817 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2818 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2819 | -c "ignoring unexpected CID" \ |
| 2820 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2821 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2822 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2823 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2824 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2825 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2826 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2827 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2828 | 0 \ |
| 2829 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2830 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2831 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2832 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2833 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2834 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2835 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2836 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2837 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2838 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2839 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 2840 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2841 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2842 | 0 \ |
| 2843 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2844 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2845 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2846 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2847 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2848 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2849 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2850 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2851 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2852 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2853 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2854 | -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] | 2855 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2856 | "$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" \ |
| 2857 | 0 \ |
| 2858 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2859 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2860 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2861 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2862 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2863 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2864 | -c "ignoring unexpected CID" \ |
| 2865 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2866 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2867 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2868 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2869 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2870 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2871 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2872 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2873 | 0 \ |
| 2874 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2875 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2876 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2877 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2878 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2879 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2880 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2881 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2882 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 2883 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2884 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2885 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2886 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2887 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2888 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2889 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2890 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2891 | 0 \ |
| 2892 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2893 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2894 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2895 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2896 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2897 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2898 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2899 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2900 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2901 | -c "ignoring unexpected CID" \ |
| 2902 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2903 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2904 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2905 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2906 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2907 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 2908 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2909 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2910 | 0 \ |
| 2911 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2912 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2913 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2914 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2915 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2916 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2917 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2918 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2919 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2920 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2921 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2922 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2923 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2924 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2925 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2926 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2927 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2928 | 0 \ |
| 2929 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2930 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2931 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2932 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2933 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2934 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2935 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2936 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2937 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2938 | -c "ignoring unexpected CID" \ |
| 2939 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2940 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 2941 | # 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] | 2942 | # tests check that the buffer contents are reallocated when the message is |
| 2943 | # larger than the buffer. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2944 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2945 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2946 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2947 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2948 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 2949 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2950 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 2951 | 0 \ |
| 2952 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2953 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2954 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2955 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2956 | -s "Reallocating in_buf" \ |
| 2957 | -s "Reallocating out_buf" |
| 2958 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2959 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2960 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2961 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2962 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2963 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 2964 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2965 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 2966 | 0 \ |
| 2967 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2968 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2969 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2970 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2971 | -s "Reallocating in_buf" \ |
| 2972 | -s "Reallocating out_buf" |
| 2973 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2974 | # Tests for Encrypt-then-MAC extension |
| 2975 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2976 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2977 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2978 | "$P_SRV debug_level=3 \ |
| 2979 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2980 | "$P_CLI debug_level=3" \ |
| 2981 | 0 \ |
| 2982 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2983 | -s "found encrypt then mac extension" \ |
| 2984 | -s "server hello, adding encrypt then mac extension" \ |
| 2985 | -c "found encrypt_then_mac extension" \ |
| 2986 | -c "using encrypt then mac" \ |
| 2987 | -s "using encrypt then mac" |
| 2988 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2989 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2990 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2991 | "$P_SRV debug_level=3 etm=0 \ |
| 2992 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2993 | "$P_CLI debug_level=3 etm=1" \ |
| 2994 | 0 \ |
| 2995 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2996 | -s "found encrypt then mac extension" \ |
| 2997 | -S "server hello, adding encrypt then mac extension" \ |
| 2998 | -C "found encrypt_then_mac extension" \ |
| 2999 | -C "using encrypt then mac" \ |
| 3000 | -S "using encrypt then mac" |
| 3001 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3002 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 3003 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 3004 | "$P_SRV debug_level=3 etm=1 \ |
| 3005 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 3006 | "$P_CLI debug_level=3 etm=1" \ |
| 3007 | 0 \ |
| 3008 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3009 | -s "found encrypt then mac extension" \ |
| 3010 | -S "server hello, adding encrypt then mac extension" \ |
| 3011 | -C "found encrypt_then_mac extension" \ |
| 3012 | -C "using encrypt then mac" \ |
| 3013 | -S "using encrypt then mac" |
| 3014 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3015 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3016 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3017 | "$P_SRV debug_level=3 etm=1 \ |
| 3018 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3019 | "$P_CLI debug_level=3 etm=0" \ |
| 3020 | 0 \ |
| 3021 | -C "client hello, adding encrypt_then_mac extension" \ |
| 3022 | -S "found encrypt then mac extension" \ |
| 3023 | -S "server hello, adding encrypt then mac extension" \ |
| 3024 | -C "found encrypt_then_mac extension" \ |
| 3025 | -C "using encrypt then mac" \ |
| 3026 | -S "using encrypt then mac" |
| 3027 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3028 | # Tests for Extended Master Secret extension |
| 3029 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3030 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3031 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3032 | run_test "Extended Master Secret: default" \ |
| 3033 | "$P_SRV debug_level=3" \ |
| 3034 | "$P_CLI debug_level=3" \ |
| 3035 | 0 \ |
| 3036 | -c "client hello, adding extended_master_secret extension" \ |
| 3037 | -s "found extended master secret extension" \ |
| 3038 | -s "server hello, adding extended master secret extension" \ |
| 3039 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3040 | -c "session hash for extended master secret" \ |
| 3041 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3042 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3043 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3044 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3045 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 3046 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 3047 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 3048 | 0 \ |
| 3049 | -c "client hello, adding extended_master_secret extension" \ |
| 3050 | -s "found extended master secret extension" \ |
| 3051 | -S "server hello, adding extended master secret extension" \ |
| 3052 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3053 | -C "session hash for extended master secret" \ |
| 3054 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3055 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3056 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3057 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3058 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 3059 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 3060 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 3061 | 0 \ |
| 3062 | -C "client hello, adding extended_master_secret extension" \ |
| 3063 | -S "found extended master secret extension" \ |
| 3064 | -S "server hello, adding extended master secret extension" \ |
| 3065 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3066 | -C "session hash for extended master secret" \ |
| 3067 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3068 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3069 | # Test sending and receiving empty application data records |
| 3070 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3071 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3072 | run_test "Encrypt then MAC: empty application data record" \ |
| 3073 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 3074 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 3075 | 0 \ |
| 3076 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3077 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3078 | -c "0 bytes written in 1 fragments" |
| 3079 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3080 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3081 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3082 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 3083 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 3084 | 0 \ |
| 3085 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3086 | -c "0 bytes written in 1 fragments" |
| 3087 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3088 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3089 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 3090 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 3091 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 3092 | 0 \ |
| 3093 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3094 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3095 | -c "0 bytes written in 1 fragments" |
| 3096 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3097 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3098 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3099 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 3100 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 3101 | 0 \ |
| 3102 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3103 | -c "0 bytes written in 1 fragments" |
| 3104 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3105 | # Tests for CBC 1/n-1 record splitting |
| 3106 | |
| 3107 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3108 | "$P_SRV force_version=tls12" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3109 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3110 | request_size=123" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3111 | 0 \ |
| 3112 | -s "Read from client: 123 bytes read" \ |
| 3113 | -S "Read from client: 1 bytes read" \ |
| 3114 | -S "122 bytes read" |
| 3115 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3116 | # Tests for Session Tickets |
| 3117 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3118 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3119 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3120 | "$P_SRV debug_level=3 tickets=1" \ |
| 3121 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3122 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3123 | -c "client hello, adding session ticket extension" \ |
| 3124 | -s "found session ticket extension" \ |
| 3125 | -s "server hello, adding session ticket extension" \ |
| 3126 | -c "found session_ticket extension" \ |
| 3127 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3128 | -S "session successfully restored from cache" \ |
| 3129 | -s "session successfully restored from ticket" \ |
| 3130 | -s "a session has been resumed" \ |
| 3131 | -c "a session has been resumed" |
| 3132 | |
Jerry Yu | baa4934 | 2022-02-15 10:26:40 +0800 | [diff] [blame] | 3133 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 3134 | run_test "Session resume using tickets: manual rotation" \ |
| 3135 | "$P_SRV debug_level=3 tickets=1 ticket_rotate=1" \ |
| 3136 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3137 | 0 \ |
| 3138 | -c "client hello, adding session ticket extension" \ |
| 3139 | -s "found session ticket extension" \ |
| 3140 | -s "server hello, adding session ticket extension" \ |
| 3141 | -c "found session_ticket extension" \ |
| 3142 | -c "parse new session ticket" \ |
| 3143 | -S "session successfully restored from cache" \ |
| 3144 | -s "session successfully restored from ticket" \ |
| 3145 | -s "a session has been resumed" \ |
| 3146 | -c "a session has been resumed" |
| 3147 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3148 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3149 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3150 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 3151 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 3152 | 0 \ |
| 3153 | -c "client hello, adding session ticket extension" \ |
| 3154 | -s "found session ticket extension" \ |
| 3155 | -s "server hello, adding session ticket extension" \ |
| 3156 | -c "found session_ticket extension" \ |
| 3157 | -c "parse new session ticket" \ |
| 3158 | -S "session successfully restored from cache" \ |
| 3159 | -s "session successfully restored from ticket" \ |
| 3160 | -s "a session has been resumed" \ |
| 3161 | -c "a session has been resumed" |
| 3162 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3163 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3164 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3165 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 3166 | "$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] | 3167 | 0 \ |
| 3168 | -c "client hello, adding session ticket extension" \ |
| 3169 | -s "found session ticket extension" \ |
| 3170 | -s "server hello, adding session ticket extension" \ |
| 3171 | -c "found session_ticket extension" \ |
| 3172 | -c "parse new session ticket" \ |
| 3173 | -S "session successfully restored from cache" \ |
| 3174 | -S "session successfully restored from ticket" \ |
| 3175 | -S "a session has been resumed" \ |
| 3176 | -C "a session has been resumed" |
| 3177 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3178 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3179 | run_test "Session resume using tickets: session copy" \ |
| 3180 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 3181 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 3182 | 0 \ |
| 3183 | -c "client hello, adding session ticket extension" \ |
| 3184 | -s "found session ticket extension" \ |
| 3185 | -s "server hello, adding session ticket extension" \ |
| 3186 | -c "found session_ticket extension" \ |
| 3187 | -c "parse new session ticket" \ |
| 3188 | -S "session successfully restored from cache" \ |
| 3189 | -s "session successfully restored from ticket" \ |
| 3190 | -s "a session has been resumed" \ |
| 3191 | -c "a session has been resumed" |
| 3192 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3193 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3194 | run_test "Session resume using tickets: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 3195 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3196 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3197 | 0 \ |
| 3198 | -c "client hello, adding session ticket extension" \ |
| 3199 | -c "found session_ticket extension" \ |
| 3200 | -c "parse new session ticket" \ |
| 3201 | -c "a session has been resumed" |
| 3202 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3203 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3204 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3205 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3206 | "( $O_CLI -sess_out $SESSION; \ |
| 3207 | $O_CLI -sess_in $SESSION; \ |
| 3208 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3209 | 0 \ |
| 3210 | -s "found session ticket extension" \ |
| 3211 | -s "server hello, adding session ticket extension" \ |
| 3212 | -S "session successfully restored from cache" \ |
| 3213 | -s "session successfully restored from ticket" \ |
| 3214 | -s "a session has been resumed" |
| 3215 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3216 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3217 | run_test "Session resume using tickets: AES-128-GCM" \ |
| 3218 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-GCM" \ |
| 3219 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3220 | 0 \ |
| 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" \ |
| 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 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3232 | run_test "Session resume using tickets: AES-192-GCM" \ |
| 3233 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-GCM" \ |
| 3234 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3235 | 0 \ |
| 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" \ |
| 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" |
| 3245 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3246 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3247 | run_test "Session resume using tickets: AES-128-CCM" \ |
| 3248 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-CCM" \ |
| 3249 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3250 | 0 \ |
| 3251 | -c "client hello, adding session ticket extension" \ |
| 3252 | -s "found session ticket extension" \ |
| 3253 | -s "server hello, adding session ticket extension" \ |
| 3254 | -c "found session_ticket extension" \ |
| 3255 | -c "parse new session ticket" \ |
| 3256 | -S "session successfully restored from cache" \ |
| 3257 | -s "session successfully restored from ticket" \ |
| 3258 | -s "a session has been resumed" \ |
| 3259 | -c "a session has been resumed" |
| 3260 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3261 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3262 | run_test "Session resume using tickets: AES-192-CCM" \ |
| 3263 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-CCM" \ |
| 3264 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3265 | 0 \ |
| 3266 | -c "client hello, adding session ticket extension" \ |
| 3267 | -s "found session ticket extension" \ |
| 3268 | -s "server hello, adding session ticket extension" \ |
| 3269 | -c "found session_ticket extension" \ |
| 3270 | -c "parse new session ticket" \ |
| 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 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3277 | run_test "Session resume using tickets: AES-256-CCM" \ |
| 3278 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-256-CCM" \ |
| 3279 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3280 | 0 \ |
| 3281 | -c "client hello, adding session ticket extension" \ |
| 3282 | -s "found session ticket extension" \ |
| 3283 | -s "server hello, adding session ticket extension" \ |
| 3284 | -c "found session_ticket extension" \ |
| 3285 | -c "parse new session ticket" \ |
| 3286 | -S "session successfully restored from cache" \ |
| 3287 | -s "session successfully restored from ticket" \ |
| 3288 | -s "a session has been resumed" \ |
| 3289 | -c "a session has been resumed" |
| 3290 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3291 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3292 | run_test "Session resume using tickets: CAMELLIA-128-CCM" \ |
| 3293 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-128-CCM" \ |
| 3294 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3295 | 0 \ |
| 3296 | -c "client hello, adding session ticket extension" \ |
| 3297 | -s "found session ticket extension" \ |
| 3298 | -s "server hello, adding session ticket extension" \ |
| 3299 | -c "found session_ticket extension" \ |
| 3300 | -c "parse new session ticket" \ |
| 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 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3307 | run_test "Session resume using tickets: CAMELLIA-192-CCM" \ |
| 3308 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-192-CCM" \ |
| 3309 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3310 | 0 \ |
| 3311 | -c "client hello, adding session ticket extension" \ |
| 3312 | -s "found session ticket extension" \ |
| 3313 | -s "server hello, adding session ticket extension" \ |
| 3314 | -c "found session_ticket extension" \ |
| 3315 | -c "parse new session ticket" \ |
| 3316 | -S "session successfully restored from cache" \ |
| 3317 | -s "session successfully restored from ticket" \ |
| 3318 | -s "a session has been resumed" \ |
| 3319 | -c "a session has been resumed" |
| 3320 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3321 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3322 | run_test "Session resume using tickets: CAMELLIA-256-CCM" \ |
| 3323 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-256-CCM" \ |
| 3324 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3325 | 0 \ |
| 3326 | -c "client hello, adding session ticket extension" \ |
| 3327 | -s "found session ticket extension" \ |
| 3328 | -s "server hello, adding session ticket extension" \ |
| 3329 | -c "found session_ticket extension" \ |
| 3330 | -c "parse new session ticket" \ |
| 3331 | -S "session successfully restored from cache" \ |
| 3332 | -s "session successfully restored from ticket" \ |
| 3333 | -s "a session has been resumed" \ |
| 3334 | -c "a session has been resumed" |
| 3335 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3336 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3337 | run_test "Session resume using tickets: ARIA-128-GCM" \ |
| 3338 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-GCM" \ |
| 3339 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3340 | 0 \ |
| 3341 | -c "client hello, adding session ticket extension" \ |
| 3342 | -s "found session ticket extension" \ |
| 3343 | -s "server hello, adding session ticket extension" \ |
| 3344 | -c "found session_ticket extension" \ |
| 3345 | -c "parse new session ticket" \ |
| 3346 | -S "session successfully restored from cache" \ |
| 3347 | -s "session successfully restored from ticket" \ |
| 3348 | -s "a session has been resumed" \ |
| 3349 | -c "a session has been resumed" |
| 3350 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3351 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3352 | run_test "Session resume using tickets: ARIA-192-GCM" \ |
| 3353 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-GCM" \ |
| 3354 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3355 | 0 \ |
| 3356 | -c "client hello, adding session ticket extension" \ |
| 3357 | -s "found session ticket extension" \ |
| 3358 | -s "server hello, adding session ticket extension" \ |
| 3359 | -c "found session_ticket extension" \ |
| 3360 | -c "parse new session ticket" \ |
| 3361 | -S "session successfully restored from cache" \ |
| 3362 | -s "session successfully restored from ticket" \ |
| 3363 | -s "a session has been resumed" \ |
| 3364 | -c "a session has been resumed" |
| 3365 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3366 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3367 | run_test "Session resume using tickets: ARIA-256-GCM" \ |
| 3368 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-GCM" \ |
| 3369 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3370 | 0 \ |
| 3371 | -c "client hello, adding session ticket extension" \ |
| 3372 | -s "found session ticket extension" \ |
| 3373 | -s "server hello, adding session ticket extension" \ |
| 3374 | -c "found session_ticket extension" \ |
| 3375 | -c "parse new session ticket" \ |
| 3376 | -S "session successfully restored from cache" \ |
| 3377 | -s "session successfully restored from ticket" \ |
| 3378 | -s "a session has been resumed" \ |
| 3379 | -c "a session has been resumed" |
| 3380 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3381 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3382 | run_test "Session resume using tickets: ARIA-128-CCM" \ |
| 3383 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-CCM" \ |
| 3384 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3385 | 0 \ |
| 3386 | -c "client hello, adding session ticket extension" \ |
| 3387 | -s "found session ticket extension" \ |
| 3388 | -s "server hello, adding session ticket extension" \ |
| 3389 | -c "found session_ticket extension" \ |
| 3390 | -c "parse new session ticket" \ |
| 3391 | -S "session successfully restored from cache" \ |
| 3392 | -s "session successfully restored from ticket" \ |
| 3393 | -s "a session has been resumed" \ |
| 3394 | -c "a session has been resumed" |
| 3395 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3396 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3397 | run_test "Session resume using tickets: ARIA-192-CCM" \ |
| 3398 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-CCM" \ |
| 3399 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3400 | 0 \ |
| 3401 | -c "client hello, adding session ticket extension" \ |
| 3402 | -s "found session ticket extension" \ |
| 3403 | -s "server hello, adding session ticket extension" \ |
| 3404 | -c "found session_ticket extension" \ |
| 3405 | -c "parse new session ticket" \ |
| 3406 | -S "session successfully restored from cache" \ |
| 3407 | -s "session successfully restored from ticket" \ |
| 3408 | -s "a session has been resumed" \ |
| 3409 | -c "a session has been resumed" |
| 3410 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3411 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3412 | run_test "Session resume using tickets: ARIA-256-CCM" \ |
| 3413 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-CCM" \ |
| 3414 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3415 | 0 \ |
| 3416 | -c "client hello, adding session ticket extension" \ |
| 3417 | -s "found session ticket extension" \ |
| 3418 | -s "server hello, adding session ticket extension" \ |
| 3419 | -c "found session_ticket extension" \ |
| 3420 | -c "parse new session ticket" \ |
| 3421 | -S "session successfully restored from cache" \ |
| 3422 | -s "session successfully restored from ticket" \ |
| 3423 | -s "a session has been resumed" \ |
| 3424 | -c "a session has been resumed" |
| 3425 | |
Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 3426 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 3427 | run_test "Session resume using tickets: CHACHA20-POLY1305" \ |
| 3428 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CHACHA20-POLY1305" \ |
| 3429 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3430 | 0 \ |
| 3431 | -c "client hello, adding session ticket extension" \ |
| 3432 | -s "found session ticket extension" \ |
| 3433 | -s "server hello, adding session ticket extension" \ |
| 3434 | -c "found session_ticket extension" \ |
| 3435 | -c "parse new session ticket" \ |
| 3436 | -S "session successfully restored from cache" \ |
| 3437 | -s "session successfully restored from ticket" \ |
| 3438 | -s "a session has been resumed" \ |
| 3439 | -c "a session has been resumed" |
| 3440 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3441 | # Tests for Session Tickets with DTLS |
| 3442 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3443 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3444 | run_test "Session resume using tickets, DTLS: basic" \ |
| 3445 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3446 | "$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] | 3447 | 0 \ |
| 3448 | -c "client hello, adding session ticket extension" \ |
| 3449 | -s "found session ticket extension" \ |
| 3450 | -s "server hello, adding session ticket extension" \ |
| 3451 | -c "found session_ticket extension" \ |
| 3452 | -c "parse new session ticket" \ |
| 3453 | -S "session successfully restored from cache" \ |
| 3454 | -s "session successfully restored from ticket" \ |
| 3455 | -s "a session has been resumed" \ |
| 3456 | -c "a session has been resumed" |
| 3457 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3458 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3459 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 3460 | "$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] | 3461 | "$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] | 3462 | 0 \ |
| 3463 | -c "client hello, adding session ticket extension" \ |
| 3464 | -s "found session ticket extension" \ |
| 3465 | -s "server hello, adding session ticket extension" \ |
| 3466 | -c "found session_ticket extension" \ |
| 3467 | -c "parse new session ticket" \ |
| 3468 | -S "session successfully restored from cache" \ |
| 3469 | -s "session successfully restored from ticket" \ |
| 3470 | -s "a session has been resumed" \ |
| 3471 | -c "a session has been resumed" |
| 3472 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3473 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3474 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 3475 | "$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] | 3476 | "$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] | 3477 | 0 \ |
| 3478 | -c "client hello, adding session ticket extension" \ |
| 3479 | -s "found session ticket extension" \ |
| 3480 | -s "server hello, adding session ticket extension" \ |
| 3481 | -c "found session_ticket extension" \ |
| 3482 | -c "parse new session ticket" \ |
| 3483 | -S "session successfully restored from cache" \ |
| 3484 | -S "session successfully restored from ticket" \ |
| 3485 | -S "a session has been resumed" \ |
| 3486 | -C "a session has been resumed" |
| 3487 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3488 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3489 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 3490 | "$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] | 3491 | "$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] | 3492 | 0 \ |
| 3493 | -c "client hello, adding session ticket extension" \ |
| 3494 | -s "found session ticket extension" \ |
| 3495 | -s "server hello, adding session ticket extension" \ |
| 3496 | -c "found session_ticket extension" \ |
| 3497 | -c "parse new session ticket" \ |
| 3498 | -S "session successfully restored from cache" \ |
| 3499 | -s "session successfully restored from ticket" \ |
| 3500 | -s "a session has been resumed" \ |
| 3501 | -c "a session has been resumed" |
| 3502 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3503 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3504 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 3505 | "$O_SRV -dtls" \ |
| 3506 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 3507 | 0 \ |
| 3508 | -c "client hello, adding session ticket extension" \ |
| 3509 | -c "found session_ticket extension" \ |
| 3510 | -c "parse new session ticket" \ |
| 3511 | -c "a session has been resumed" |
| 3512 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3513 | # 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] | 3514 | # 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] | 3515 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3516 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3517 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 3518 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3519 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 3520 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3521 | rm -f $SESSION )" \ |
| 3522 | 0 \ |
| 3523 | -s "found session ticket extension" \ |
| 3524 | -s "server hello, adding session ticket extension" \ |
| 3525 | -S "session successfully restored from cache" \ |
| 3526 | -s "session successfully restored from ticket" \ |
| 3527 | -s "a session has been resumed" |
| 3528 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3529 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3530 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3531 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3532 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3533 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3534 | "$P_SRV debug_level=3 tickets=0" \ |
| 3535 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3536 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3537 | -c "client hello, adding session ticket extension" \ |
| 3538 | -s "found session ticket extension" \ |
| 3539 | -S "server hello, adding session ticket extension" \ |
| 3540 | -C "found session_ticket extension" \ |
| 3541 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3542 | -s "session successfully restored from cache" \ |
| 3543 | -S "session successfully restored from ticket" \ |
| 3544 | -s "a session has been resumed" \ |
| 3545 | -c "a session has been resumed" |
| 3546 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3547 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3548 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3549 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3550 | "$P_SRV debug_level=3 tickets=1" \ |
| 3551 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3552 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3553 | -C "client hello, adding session ticket extension" \ |
| 3554 | -S "found session ticket extension" \ |
| 3555 | -S "server hello, adding session ticket extension" \ |
| 3556 | -C "found session_ticket extension" \ |
| 3557 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3558 | -s "session successfully restored from cache" \ |
| 3559 | -S "session successfully restored from ticket" \ |
| 3560 | -s "a session has been resumed" \ |
| 3561 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3562 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3563 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3564 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3565 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3566 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 3567 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3568 | 0 \ |
| 3569 | -S "session successfully restored from cache" \ |
| 3570 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3571 | -S "a session has been resumed" \ |
| 3572 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3573 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3574 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3575 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3576 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3577 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 3578 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3579 | 0 \ |
| 3580 | -s "session successfully restored from cache" \ |
| 3581 | -S "session successfully restored from ticket" \ |
| 3582 | -s "a session has been resumed" \ |
| 3583 | -c "a session has been resumed" |
| 3584 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3585 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3586 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 3587 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3588 | "$P_SRV debug_level=3 tickets=0" \ |
| 3589 | "$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] | 3590 | 0 \ |
| 3591 | -s "session successfully restored from cache" \ |
| 3592 | -S "session successfully restored from ticket" \ |
| 3593 | -s "a session has been resumed" \ |
| 3594 | -c "a session has been resumed" |
| 3595 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3596 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3597 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3598 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3599 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 3600 | "$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] | 3601 | 0 \ |
| 3602 | -S "session successfully restored from cache" \ |
| 3603 | -S "session successfully restored from ticket" \ |
| 3604 | -S "a session has been resumed" \ |
| 3605 | -C "a session has been resumed" |
| 3606 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3607 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3608 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3609 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3610 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 3611 | "$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] | 3612 | 0 \ |
| 3613 | -s "session successfully restored from cache" \ |
| 3614 | -S "session successfully restored from ticket" \ |
| 3615 | -s "a session has been resumed" \ |
| 3616 | -c "a session has been resumed" |
| 3617 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3618 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3619 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3620 | run_test "Session resume using cache: session copy" \ |
| 3621 | "$P_SRV debug_level=3 tickets=0" \ |
| 3622 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 3623 | 0 \ |
| 3624 | -s "session successfully restored from cache" \ |
| 3625 | -S "session successfully restored from ticket" \ |
| 3626 | -s "a session has been resumed" \ |
| 3627 | -c "a session has been resumed" |
| 3628 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3629 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3630 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3631 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3632 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3633 | "( $O_CLI -sess_out $SESSION; \ |
| 3634 | $O_CLI -sess_in $SESSION; \ |
| 3635 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 3636 | 0 \ |
| 3637 | -s "found session ticket extension" \ |
| 3638 | -S "server hello, adding session ticket extension" \ |
| 3639 | -s "session successfully restored from cache" \ |
| 3640 | -S "session successfully restored from ticket" \ |
| 3641 | -s "a session has been resumed" |
| 3642 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3643 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3644 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3645 | run_test "Session resume using cache: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 3646 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3647 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 3648 | 0 \ |
| 3649 | -C "found session_ticket extension" \ |
| 3650 | -C "parse new session ticket" \ |
| 3651 | -c "a session has been resumed" |
| 3652 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3653 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 3654 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3655 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3656 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3657 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 3658 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3659 | "$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] | 3660 | 0 \ |
| 3661 | -c "client hello, adding session ticket extension" \ |
| 3662 | -s "found session ticket extension" \ |
| 3663 | -S "server hello, adding session ticket extension" \ |
| 3664 | -C "found session_ticket extension" \ |
| 3665 | -C "parse new session ticket" \ |
| 3666 | -s "session successfully restored from cache" \ |
| 3667 | -S "session successfully restored from ticket" \ |
| 3668 | -s "a session has been resumed" \ |
| 3669 | -c "a session has been resumed" |
| 3670 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3671 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3672 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3673 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 3674 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3675 | "$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] | 3676 | 0 \ |
| 3677 | -C "client hello, adding session ticket extension" \ |
| 3678 | -S "found session ticket extension" \ |
| 3679 | -S "server hello, adding session ticket extension" \ |
| 3680 | -C "found session_ticket extension" \ |
| 3681 | -C "parse new session ticket" \ |
| 3682 | -s "session successfully restored from cache" \ |
| 3683 | -S "session successfully restored from ticket" \ |
| 3684 | -s "a session has been resumed" \ |
| 3685 | -c "a session has been resumed" |
| 3686 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3687 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3688 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3689 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 3690 | "$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] | 3691 | "$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] | 3692 | 0 \ |
| 3693 | -S "session successfully restored from cache" \ |
| 3694 | -S "session successfully restored from ticket" \ |
| 3695 | -S "a session has been resumed" \ |
| 3696 | -C "a session has been resumed" |
| 3697 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3698 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3699 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3700 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 3701 | "$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] | 3702 | "$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] | 3703 | 0 \ |
| 3704 | -s "session successfully restored from cache" \ |
| 3705 | -S "session successfully restored from ticket" \ |
| 3706 | -s "a session has been resumed" \ |
| 3707 | -c "a session has been resumed" |
| 3708 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3709 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3710 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3711 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 3712 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3713 | "$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] | 3714 | 0 \ |
| 3715 | -s "session successfully restored from cache" \ |
| 3716 | -S "session successfully restored from ticket" \ |
| 3717 | -s "a session has been resumed" \ |
| 3718 | -c "a session has been resumed" |
| 3719 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3720 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3721 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3722 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 3723 | "$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] | 3724 | "$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] | 3725 | 0 \ |
| 3726 | -S "session successfully restored from cache" \ |
| 3727 | -S "session successfully restored from ticket" \ |
| 3728 | -S "a session has been resumed" \ |
| 3729 | -C "a session has been resumed" |
| 3730 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3731 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3732 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3733 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 3734 | "$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] | 3735 | "$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] | 3736 | 0 \ |
| 3737 | -s "session successfully restored from cache" \ |
| 3738 | -S "session successfully restored from ticket" \ |
| 3739 | -s "a session has been resumed" \ |
| 3740 | -c "a session has been resumed" |
| 3741 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3742 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3743 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3744 | run_test "Session resume using cache, DTLS: session copy" \ |
| 3745 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3746 | "$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] | 3747 | 0 \ |
| 3748 | -s "session successfully restored from cache" \ |
| 3749 | -S "session successfully restored from ticket" \ |
| 3750 | -s "a session has been resumed" \ |
| 3751 | -c "a session has been resumed" |
| 3752 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3753 | # 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] | 3754 | # 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] | 3755 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3756 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3757 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3758 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 3759 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3760 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 3761 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3762 | rm -f $SESSION )" \ |
| 3763 | 0 \ |
| 3764 | -s "found session ticket extension" \ |
| 3765 | -S "server hello, adding session ticket extension" \ |
| 3766 | -s "session successfully restored from cache" \ |
| 3767 | -S "session successfully restored from ticket" \ |
| 3768 | -s "a session has been resumed" |
| 3769 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3770 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3771 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3772 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 3773 | "$O_SRV -dtls" \ |
| 3774 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 3775 | 0 \ |
| 3776 | -C "found session_ticket extension" \ |
| 3777 | -C "parse new session ticket" \ |
| 3778 | -c "a session has been resumed" |
| 3779 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3780 | # Tests for Max Fragment Length extension |
| 3781 | |
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 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3784 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3785 | "$P_SRV debug_level=3" \ |
| 3786 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3787 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3788 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3789 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3790 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3791 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [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 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3797 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3798 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3799 | run_test "Max fragment length: enabled, default, larger message" \ |
| 3800 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3801 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3802 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3803 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3804 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3805 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3806 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3807 | -C "client hello, adding max_fragment_length extension" \ |
| 3808 | -S "found max fragment length extension" \ |
| 3809 | -S "server hello, max_fragment_length extension" \ |
| 3810 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3811 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3812 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3813 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3814 | |
| 3815 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3816 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3817 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 3818 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3819 | "$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] | 3820 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3821 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3822 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3823 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3824 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3825 | -C "client hello, adding max_fragment_length extension" \ |
| 3826 | -S "found max fragment length extension" \ |
| 3827 | -S "server hello, max_fragment_length extension" \ |
| 3828 | -C "found max_fragment_length extension" \ |
| 3829 | -c "fragment larger than.*maximum " |
| 3830 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3831 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 3832 | # (session fragment length will be 16384 regardless of mbedtls |
| 3833 | # content length configuration.) |
| 3834 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3835 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3836 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3837 | run_test "Max fragment length: disabled, larger message" \ |
| 3838 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3839 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3840 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3841 | -C "Maximum incoming record payload length is 16384" \ |
| 3842 | -C "Maximum outgoing record payload length is 16384" \ |
| 3843 | -S "Maximum incoming record payload length is 16384" \ |
| 3844 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3845 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3846 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3847 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3848 | |
| 3849 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3850 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 3851 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3852 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3853 | "$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] | 3854 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3855 | -C "Maximum incoming record payload length is 16384" \ |
| 3856 | -C "Maximum outgoing record payload length is 16384" \ |
| 3857 | -S "Maximum incoming record payload length is 16384" \ |
| 3858 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3859 | -c "fragment larger than.*maximum " |
| 3860 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3861 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3862 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3863 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3864 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3865 | "$P_SRV debug_level=3" \ |
| 3866 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3867 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3868 | -c "Maximum incoming record payload length is 4096" \ |
| 3869 | -c "Maximum outgoing record payload length is 4096" \ |
| 3870 | -s "Maximum incoming record payload length is 4096" \ |
| 3871 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3872 | -c "client hello, adding max_fragment_length extension" \ |
| 3873 | -s "found max fragment length extension" \ |
| 3874 | -s "server hello, max_fragment_length extension" \ |
| 3875 | -c "found max_fragment_length extension" |
| 3876 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3877 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3878 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3879 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3880 | run_test "Max fragment length: client 512, server 1024" \ |
| 3881 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3882 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3883 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3884 | -c "Maximum incoming record payload length is 512" \ |
| 3885 | -c "Maximum outgoing record payload length is 512" \ |
| 3886 | -s "Maximum incoming record payload length is 512" \ |
| 3887 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3888 | -c "client hello, adding max_fragment_length extension" \ |
| 3889 | -s "found max fragment length extension" \ |
| 3890 | -s "server hello, max_fragment_length extension" \ |
| 3891 | -c "found max_fragment_length extension" |
| 3892 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3893 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3894 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3895 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3896 | run_test "Max fragment length: client 512, server 2048" \ |
| 3897 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3898 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3899 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3900 | -c "Maximum incoming record payload length is 512" \ |
| 3901 | -c "Maximum outgoing record payload length is 512" \ |
| 3902 | -s "Maximum incoming record payload length is 512" \ |
| 3903 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3904 | -c "client hello, adding max_fragment_length extension" \ |
| 3905 | -s "found max fragment length extension" \ |
| 3906 | -s "server hello, max_fragment_length extension" \ |
| 3907 | -c "found max_fragment_length extension" |
| 3908 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3909 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3910 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3911 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3912 | run_test "Max fragment length: client 512, server 4096" \ |
| 3913 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3914 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3915 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3916 | -c "Maximum incoming record payload length is 512" \ |
| 3917 | -c "Maximum outgoing record payload length is 512" \ |
| 3918 | -s "Maximum incoming record payload length is 512" \ |
| 3919 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3920 | -c "client hello, adding max_fragment_length extension" \ |
| 3921 | -s "found max fragment length extension" \ |
| 3922 | -s "server hello, max_fragment_length extension" \ |
| 3923 | -c "found max_fragment_length extension" |
| 3924 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3925 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3926 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3927 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3928 | run_test "Max fragment length: client 1024, server 512" \ |
| 3929 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3930 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3931 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3932 | -c "Maximum incoming record payload length is 1024" \ |
| 3933 | -c "Maximum outgoing record payload length is 1024" \ |
| 3934 | -s "Maximum incoming record payload length is 1024" \ |
| 3935 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3936 | -c "client hello, adding max_fragment_length extension" \ |
| 3937 | -s "found max fragment length extension" \ |
| 3938 | -s "server hello, max_fragment_length extension" \ |
| 3939 | -c "found max_fragment_length extension" |
| 3940 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3941 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3942 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3943 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3944 | run_test "Max fragment length: client 1024, server 2048" \ |
| 3945 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3946 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3947 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3948 | -c "Maximum incoming record payload length is 1024" \ |
| 3949 | -c "Maximum outgoing record payload length is 1024" \ |
| 3950 | -s "Maximum incoming record payload length is 1024" \ |
| 3951 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3952 | -c "client hello, adding max_fragment_length extension" \ |
| 3953 | -s "found max fragment length extension" \ |
| 3954 | -s "server hello, max_fragment_length extension" \ |
| 3955 | -c "found max_fragment_length extension" |
| 3956 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3957 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3958 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3959 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3960 | run_test "Max fragment length: client 1024, server 4096" \ |
| 3961 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3962 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3963 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3964 | -c "Maximum incoming record payload length is 1024" \ |
| 3965 | -c "Maximum outgoing record payload length is 1024" \ |
| 3966 | -s "Maximum incoming record payload length is 1024" \ |
| 3967 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3968 | -c "client hello, adding max_fragment_length extension" \ |
| 3969 | -s "found max fragment length extension" \ |
| 3970 | -s "server hello, max_fragment_length extension" \ |
| 3971 | -c "found max_fragment_length extension" |
| 3972 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3973 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3974 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3975 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3976 | run_test "Max fragment length: client 2048, server 512" \ |
| 3977 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3978 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3979 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3980 | -c "Maximum incoming record payload length is 2048" \ |
| 3981 | -c "Maximum outgoing record payload length is 2048" \ |
| 3982 | -s "Maximum incoming record payload length is 2048" \ |
| 3983 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3984 | -c "client hello, adding max_fragment_length extension" \ |
| 3985 | -s "found max fragment length extension" \ |
| 3986 | -s "server hello, max_fragment_length extension" \ |
| 3987 | -c "found max_fragment_length extension" |
| 3988 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3989 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3990 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3991 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3992 | run_test "Max fragment length: client 2048, server 1024" \ |
| 3993 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3994 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3995 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3996 | -c "Maximum incoming record payload length is 2048" \ |
| 3997 | -c "Maximum outgoing record payload length is 2048" \ |
| 3998 | -s "Maximum incoming record payload length is 2048" \ |
| 3999 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4000 | -c "client hello, adding max_fragment_length extension" \ |
| 4001 | -s "found max fragment length extension" \ |
| 4002 | -s "server hello, max_fragment_length extension" \ |
| 4003 | -c "found max_fragment_length extension" |
| 4004 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4005 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4006 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4007 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4008 | run_test "Max fragment length: client 2048, server 4096" \ |
| 4009 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 4010 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4011 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4012 | -c "Maximum incoming record payload length is 2048" \ |
| 4013 | -c "Maximum outgoing record payload length is 2048" \ |
| 4014 | -s "Maximum incoming record payload length is 2048" \ |
| 4015 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4016 | -c "client hello, adding max_fragment_length extension" \ |
| 4017 | -s "found max fragment length extension" \ |
| 4018 | -s "server hello, max_fragment_length extension" \ |
| 4019 | -c "found max_fragment_length extension" |
| 4020 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4021 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4022 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4023 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4024 | run_test "Max fragment length: client 4096, server 512" \ |
| 4025 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 4026 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4027 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4028 | -c "Maximum incoming record payload length is 4096" \ |
| 4029 | -c "Maximum outgoing record payload length is 4096" \ |
| 4030 | -s "Maximum incoming record payload length is 4096" \ |
| 4031 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4032 | -c "client hello, adding max_fragment_length extension" \ |
| 4033 | -s "found max fragment length extension" \ |
| 4034 | -s "server hello, max_fragment_length extension" \ |
| 4035 | -c "found max_fragment_length extension" |
| 4036 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4037 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4038 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4039 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4040 | run_test "Max fragment length: client 4096, server 1024" \ |
| 4041 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 4042 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4043 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4044 | -c "Maximum incoming record payload length is 4096" \ |
| 4045 | -c "Maximum outgoing record payload length is 4096" \ |
| 4046 | -s "Maximum incoming record payload length is 4096" \ |
| 4047 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4048 | -c "client hello, adding max_fragment_length extension" \ |
| 4049 | -s "found max fragment length extension" \ |
| 4050 | -s "server hello, max_fragment_length extension" \ |
| 4051 | -c "found max_fragment_length extension" |
| 4052 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4053 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4054 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4055 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4056 | run_test "Max fragment length: client 4096, server 2048" \ |
| 4057 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 4058 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4059 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4060 | -c "Maximum incoming record payload length is 4096" \ |
| 4061 | -c "Maximum outgoing record payload length is 4096" \ |
| 4062 | -s "Maximum incoming record payload length is 4096" \ |
| 4063 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4064 | -c "client hello, adding max_fragment_length extension" \ |
| 4065 | -s "found max fragment length extension" \ |
| 4066 | -s "server hello, max_fragment_length extension" \ |
| 4067 | -c "found max_fragment_length extension" |
| 4068 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4069 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4070 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4071 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4072 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4073 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 4074 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4075 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4076 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4077 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4078 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4079 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4080 | -C "client hello, adding max_fragment_length extension" \ |
| 4081 | -S "found max fragment length extension" \ |
| 4082 | -S "server hello, max_fragment_length extension" \ |
| 4083 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4084 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4085 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4086 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4087 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4088 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4089 | run_test "Max fragment length: gnutls server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4090 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4091 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4092 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4093 | -c "Maximum incoming record payload length is 4096" \ |
| 4094 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4095 | -c "client hello, adding max_fragment_length extension" \ |
| 4096 | -c "found max_fragment_length extension" |
| 4097 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4098 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4099 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4100 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4101 | run_test "Max fragment length: client, message just fits" \ |
| 4102 | "$P_SRV debug_level=3" \ |
| 4103 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 4104 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4105 | -c "Maximum incoming record payload length is 2048" \ |
| 4106 | -c "Maximum outgoing record payload length is 2048" \ |
| 4107 | -s "Maximum incoming record payload length is 2048" \ |
| 4108 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4109 | -c "client hello, adding max_fragment_length extension" \ |
| 4110 | -s "found max fragment length extension" \ |
| 4111 | -s "server hello, max_fragment_length extension" \ |
| 4112 | -c "found max_fragment_length extension" \ |
| 4113 | -c "2048 bytes written in 1 fragments" \ |
| 4114 | -s "2048 bytes read" |
| 4115 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4116 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4117 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4118 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4119 | run_test "Max fragment length: client, larger message" \ |
| 4120 | "$P_SRV debug_level=3" \ |
| 4121 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 4122 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4123 | -c "Maximum incoming record payload length is 2048" \ |
| 4124 | -c "Maximum outgoing record payload length is 2048" \ |
| 4125 | -s "Maximum incoming record payload length is 2048" \ |
| 4126 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4127 | -c "client hello, adding max_fragment_length extension" \ |
| 4128 | -s "found max fragment length extension" \ |
| 4129 | -s "server hello, max_fragment_length extension" \ |
| 4130 | -c "found max_fragment_length extension" \ |
| 4131 | -c "2345 bytes written in 2 fragments" \ |
| 4132 | -s "2048 bytes read" \ |
| 4133 | -s "297 bytes read" |
| 4134 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4135 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4136 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
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 | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 4138 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4139 | "$P_SRV debug_level=3 dtls=1" \ |
| 4140 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 4141 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4142 | -c "Maximum incoming record payload length is 2048" \ |
| 4143 | -c "Maximum outgoing record payload length is 2048" \ |
| 4144 | -s "Maximum incoming record payload length is 2048" \ |
| 4145 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4146 | -c "client hello, adding max_fragment_length extension" \ |
| 4147 | -s "found max fragment length extension" \ |
| 4148 | -s "server hello, max_fragment_length extension" \ |
| 4149 | -c "found max_fragment_length extension" \ |
| 4150 | -c "fragment larger than.*maximum" |
| 4151 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4152 | # Tests for renegotiation |
| 4153 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4154 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4155 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4156 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4157 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4158 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4159 | 0 \ |
| 4160 | -C "client hello, adding renegotiation extension" \ |
| 4161 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4162 | -S "found renegotiation extension" \ |
| 4163 | -s "server hello, secure renegotiation extension" \ |
| 4164 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4165 | -C "=> renegotiate" \ |
| 4166 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4167 | -S "write hello request" |
| 4168 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4169 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4170 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4171 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4172 | "$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] | 4173 | "$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] | 4174 | 0 \ |
| 4175 | -c "client hello, adding renegotiation extension" \ |
| 4176 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4177 | -s "found renegotiation extension" \ |
| 4178 | -s "server hello, secure renegotiation extension" \ |
| 4179 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4180 | -c "=> renegotiate" \ |
| 4181 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4182 | -S "write hello request" |
| 4183 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4184 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4185 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4186 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4187 | "$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] | 4188 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4189 | 0 \ |
| 4190 | -c "client hello, adding renegotiation extension" \ |
| 4191 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4192 | -s "found renegotiation extension" \ |
| 4193 | -s "server hello, secure renegotiation extension" \ |
| 4194 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4195 | -c "=> renegotiate" \ |
| 4196 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4197 | -s "write hello request" |
| 4198 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4199 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 4200 | # 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] | 4201 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4202 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4203 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4204 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 4205 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 4206 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4207 | 0 \ |
| 4208 | -c "client hello, adding renegotiation extension" \ |
| 4209 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4210 | -s "found renegotiation extension" \ |
| 4211 | -s "server hello, secure renegotiation extension" \ |
| 4212 | -c "found renegotiation extension" \ |
| 4213 | -c "=> renegotiate" \ |
| 4214 | -s "=> renegotiate" \ |
| 4215 | -S "write hello request" \ |
| 4216 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 4217 | |
| 4218 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 4219 | # 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] | 4220 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4221 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4222 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4223 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 4224 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 4225 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 4226 | 0 \ |
| 4227 | -c "client hello, adding renegotiation extension" \ |
| 4228 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4229 | -s "found renegotiation extension" \ |
| 4230 | -s "server hello, secure renegotiation extension" \ |
| 4231 | -c "found renegotiation extension" \ |
| 4232 | -c "=> renegotiate" \ |
| 4233 | -s "=> renegotiate" \ |
| 4234 | -s "write hello request" \ |
| 4235 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 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 | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4239 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4240 | "$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] | 4241 | "$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] | 4242 | 0 \ |
| 4243 | -c "client hello, adding renegotiation extension" \ |
| 4244 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4245 | -s "found renegotiation extension" \ |
| 4246 | -s "server hello, secure renegotiation extension" \ |
| 4247 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4248 | -c "=> renegotiate" \ |
| 4249 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4250 | -s "write hello request" |
| 4251 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4252 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4253 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4254 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4255 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4256 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 4257 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 4258 | "$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" \ |
| 4259 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4260 | -c "Maximum incoming record payload length is 2048" \ |
| 4261 | -c "Maximum outgoing record payload length is 2048" \ |
| 4262 | -s "Maximum incoming record payload length is 2048" \ |
| 4263 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4264 | -c "client hello, adding max_fragment_length extension" \ |
| 4265 | -s "found max fragment length extension" \ |
| 4266 | -s "server hello, max_fragment_length extension" \ |
| 4267 | -c "found max_fragment_length extension" \ |
| 4268 | -c "client hello, adding renegotiation extension" \ |
| 4269 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4270 | -s "found renegotiation extension" \ |
| 4271 | -s "server hello, secure renegotiation extension" \ |
| 4272 | -c "found renegotiation extension" \ |
| 4273 | -c "=> renegotiate" \ |
| 4274 | -s "=> renegotiate" \ |
| 4275 | -s "write hello request" |
| 4276 | |
| 4277 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4278 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4279 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4280 | "$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] | 4281 | "$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] | 4282 | 1 \ |
| 4283 | -c "client hello, adding renegotiation extension" \ |
| 4284 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4285 | -S "found renegotiation extension" \ |
| 4286 | -s "server hello, secure renegotiation extension" \ |
| 4287 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4288 | -c "=> renegotiate" \ |
| 4289 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4290 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 4291 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4292 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4293 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4294 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
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 | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4296 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4297 | "$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] | 4298 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4299 | 0 \ |
| 4300 | -C "client hello, adding renegotiation extension" \ |
| 4301 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4302 | -S "found renegotiation extension" \ |
| 4303 | -s "server hello, secure renegotiation extension" \ |
| 4304 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4305 | -C "=> renegotiate" \ |
| 4306 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4307 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 4308 | -S "SSL - An unexpected message was received from our peer" \ |
| 4309 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 4310 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4311 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4312 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4313 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4314 | "$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] | 4315 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4316 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4317 | 0 \ |
| 4318 | -C "client hello, adding renegotiation extension" \ |
| 4319 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4320 | -S "found renegotiation extension" \ |
| 4321 | -s "server hello, secure renegotiation extension" \ |
| 4322 | -c "found renegotiation extension" \ |
| 4323 | -C "=> renegotiate" \ |
| 4324 | -S "=> renegotiate" \ |
| 4325 | -s "write hello request" \ |
| 4326 | -S "SSL - An unexpected message was received from our peer" \ |
| 4327 | -S "failed" |
| 4328 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 4329 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4330 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4331 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4332 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4333 | "$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] | 4334 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4335 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4336 | 0 \ |
| 4337 | -C "client hello, adding renegotiation extension" \ |
| 4338 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4339 | -S "found renegotiation extension" \ |
| 4340 | -s "server hello, secure renegotiation extension" \ |
| 4341 | -c "found renegotiation extension" \ |
| 4342 | -C "=> renegotiate" \ |
| 4343 | -S "=> renegotiate" \ |
| 4344 | -s "write hello request" \ |
| 4345 | -S "SSL - An unexpected message was received from our peer" \ |
| 4346 | -S "failed" |
| 4347 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4348 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4349 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4350 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4351 | "$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] | 4352 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4353 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4354 | 0 \ |
| 4355 | -C "client hello, adding renegotiation extension" \ |
| 4356 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4357 | -S "found renegotiation extension" \ |
| 4358 | -s "server hello, secure renegotiation extension" \ |
| 4359 | -c "found renegotiation extension" \ |
| 4360 | -C "=> renegotiate" \ |
| 4361 | -S "=> renegotiate" \ |
| 4362 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 4363 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4364 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4365 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4366 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4367 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4368 | "$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] | 4369 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4370 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4371 | 0 \ |
| 4372 | -c "client hello, adding renegotiation extension" \ |
| 4373 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4374 | -s "found renegotiation extension" \ |
| 4375 | -s "server hello, secure renegotiation extension" \ |
| 4376 | -c "found renegotiation extension" \ |
| 4377 | -c "=> renegotiate" \ |
| 4378 | -s "=> renegotiate" \ |
| 4379 | -s "write hello request" \ |
| 4380 | -S "SSL - An unexpected message was received from our peer" \ |
| 4381 | -S "failed" |
| 4382 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4383 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4384 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4385 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4386 | "$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] | 4387 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 4388 | 0 \ |
| 4389 | -C "client hello, adding renegotiation extension" \ |
| 4390 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4391 | -S "found renegotiation extension" \ |
| 4392 | -s "server hello, secure renegotiation extension" \ |
| 4393 | -c "found renegotiation extension" \ |
| 4394 | -S "record counter limit reached: renegotiate" \ |
| 4395 | -C "=> renegotiate" \ |
| 4396 | -S "=> renegotiate" \ |
| 4397 | -S "write hello request" \ |
| 4398 | -S "SSL - An unexpected message was received from our peer" \ |
| 4399 | -S "failed" |
| 4400 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 4401 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4402 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4403 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4404 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4405 | "$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] | 4406 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4407 | 0 \ |
| 4408 | -c "client hello, adding renegotiation extension" \ |
| 4409 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4410 | -s "found renegotiation extension" \ |
| 4411 | -s "server hello, secure renegotiation extension" \ |
| 4412 | -c "found renegotiation extension" \ |
| 4413 | -s "record counter limit reached: renegotiate" \ |
| 4414 | -c "=> renegotiate" \ |
| 4415 | -s "=> renegotiate" \ |
| 4416 | -s "write hello request" \ |
| 4417 | -S "SSL - An unexpected message was received from our peer" \ |
| 4418 | -S "failed" |
| 4419 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4420 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4421 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4422 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4423 | "$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] | 4424 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4425 | 0 \ |
| 4426 | -c "client hello, adding renegotiation extension" \ |
| 4427 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4428 | -s "found renegotiation extension" \ |
| 4429 | -s "server hello, secure renegotiation extension" \ |
| 4430 | -c "found renegotiation extension" \ |
| 4431 | -s "record counter limit reached: renegotiate" \ |
| 4432 | -c "=> renegotiate" \ |
| 4433 | -s "=> renegotiate" \ |
| 4434 | -s "write hello request" \ |
| 4435 | -S "SSL - An unexpected message was received from our peer" \ |
| 4436 | -S "failed" |
| 4437 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4438 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4439 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4440 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4441 | "$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] | 4442 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 4443 | 0 \ |
| 4444 | -C "client hello, adding renegotiation extension" \ |
| 4445 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4446 | -S "found renegotiation extension" \ |
| 4447 | -s "server hello, secure renegotiation extension" \ |
| 4448 | -c "found renegotiation extension" \ |
| 4449 | -S "record counter limit reached: renegotiate" \ |
| 4450 | -C "=> renegotiate" \ |
| 4451 | -S "=> renegotiate" \ |
| 4452 | -S "write hello request" \ |
| 4453 | -S "SSL - An unexpected message was received from our peer" \ |
| 4454 | -S "failed" |
| 4455 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4456 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4457 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4458 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4459 | "$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] | 4460 | "$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] | 4461 | 0 \ |
| 4462 | -c "client hello, adding renegotiation extension" \ |
| 4463 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4464 | -s "found renegotiation extension" \ |
| 4465 | -s "server hello, secure renegotiation extension" \ |
| 4466 | -c "found renegotiation extension" \ |
| 4467 | -c "=> renegotiate" \ |
| 4468 | -s "=> renegotiate" \ |
| 4469 | -S "write hello request" |
| 4470 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4471 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4472 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4473 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4474 | "$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] | 4475 | "$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] | 4476 | 0 \ |
| 4477 | -c "client hello, adding renegotiation extension" \ |
| 4478 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4479 | -s "found renegotiation extension" \ |
| 4480 | -s "server hello, secure renegotiation extension" \ |
| 4481 | -c "found renegotiation extension" \ |
| 4482 | -c "=> renegotiate" \ |
| 4483 | -s "=> renegotiate" \ |
| 4484 | -s "write hello request" |
| 4485 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4486 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4487 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4488 | run_test "Renegotiation: openssl server, client-initiated" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4489 | "$O_SRV -www -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4490 | "$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] | 4491 | 0 \ |
| 4492 | -c "client hello, adding renegotiation extension" \ |
| 4493 | -c "found renegotiation extension" \ |
| 4494 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4495 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 4496 | -C "error" \ |
| 4497 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4498 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4499 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4500 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4501 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4502 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4503 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4504 | "$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] | 4505 | 0 \ |
| 4506 | -c "client hello, adding renegotiation extension" \ |
| 4507 | -c "found renegotiation extension" \ |
| 4508 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4509 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 4510 | -C "error" \ |
| 4511 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4512 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4513 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4514 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4515 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4516 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4517 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%DISABLE_SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4518 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 4519 | 1 \ |
| 4520 | -c "client hello, adding renegotiation extension" \ |
| 4521 | -C "found renegotiation extension" \ |
| 4522 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4523 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4524 | -c "error" \ |
| 4525 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4526 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4527 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4528 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4529 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4530 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4531 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%DISABLE_SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4532 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 4533 | allow_legacy=0" \ |
| 4534 | 1 \ |
| 4535 | -c "client hello, adding renegotiation extension" \ |
| 4536 | -C "found renegotiation extension" \ |
| 4537 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4538 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4539 | -c "error" \ |
| 4540 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4541 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4542 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4543 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4544 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4545 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4546 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%DISABLE_SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4547 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 4548 | allow_legacy=1" \ |
| 4549 | 0 \ |
| 4550 | -c "client hello, adding renegotiation extension" \ |
| 4551 | -C "found renegotiation extension" \ |
| 4552 | -c "=> renegotiate" \ |
| 4553 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4554 | -C "error" \ |
| 4555 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4556 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4557 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4558 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 4559 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 4560 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 4561 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4562 | 0 \ |
| 4563 | -c "client hello, adding renegotiation extension" \ |
| 4564 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4565 | -s "found renegotiation extension" \ |
| 4566 | -s "server hello, secure renegotiation extension" \ |
| 4567 | -c "found renegotiation extension" \ |
| 4568 | -c "=> renegotiate" \ |
| 4569 | -s "=> renegotiate" \ |
| 4570 | -S "write hello request" |
| 4571 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4572 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4573 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 4574 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 4575 | "$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] | 4576 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 4577 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 4578 | 0 \ |
| 4579 | -c "client hello, adding renegotiation extension" \ |
| 4580 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4581 | -s "found renegotiation extension" \ |
| 4582 | -s "server hello, secure renegotiation extension" \ |
| 4583 | -c "found renegotiation extension" \ |
| 4584 | -c "=> renegotiate" \ |
| 4585 | -s "=> renegotiate" \ |
| 4586 | -s "write hello request" |
| 4587 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4588 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4589 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 4590 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 4591 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 4592 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 4593 | 0 \ |
| 4594 | -c "client hello, adding renegotiation extension" \ |
| 4595 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4596 | -s "found renegotiation extension" \ |
| 4597 | -s "server hello, secure renegotiation extension" \ |
| 4598 | -s "record counter limit reached: renegotiate" \ |
| 4599 | -c "=> renegotiate" \ |
| 4600 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4601 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 4602 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 4603 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4604 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
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 | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 4606 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 4607 | "$G_SRV -u --mtu 4096" \ |
| 4608 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 4609 | 0 \ |
| 4610 | -c "client hello, adding renegotiation extension" \ |
| 4611 | -c "found renegotiation extension" \ |
| 4612 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4613 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 4614 | -C "error" \ |
| 4615 | -s "Extra-header:" |
| 4616 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 4617 | # Test for the "secure renegotiation" extension only (no actual renegotiation) |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4618 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4619 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4620 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4621 | run_test "Renego ext: gnutls server strict, client default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4622 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4623 | "$P_CLI debug_level=3" \ |
| 4624 | 0 \ |
| 4625 | -c "found renegotiation extension" \ |
| 4626 | -C "error" \ |
| 4627 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4628 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4629 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4630 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4631 | run_test "Renego ext: gnutls server unsafe, client default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4632 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%DISABLE_SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4633 | "$P_CLI debug_level=3" \ |
| 4634 | 0 \ |
| 4635 | -C "found renegotiation extension" \ |
| 4636 | -C "error" \ |
| 4637 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4638 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4639 | requires_gnutls |
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 | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4641 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4642 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%DISABLE_SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4643 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 4644 | 1 \ |
| 4645 | -C "found renegotiation extension" \ |
| 4646 | -c "error" \ |
| 4647 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4648 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4649 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4650 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4651 | run_test "Renego ext: gnutls client strict, server default" \ |
| 4652 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4653 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4654 | 0 \ |
| 4655 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4656 | -s "server hello, secure renegotiation extension" |
| 4657 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4658 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4659 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4660 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 4661 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4662 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4663 | 0 \ |
| 4664 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4665 | -S "server hello, secure renegotiation extension" |
| 4666 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4667 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4668 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4669 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 4670 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4671 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4672 | 1 \ |
| 4673 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4674 | -S "server hello, secure renegotiation extension" |
| 4675 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4676 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 4677 | |
| 4678 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4679 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4680 | run_test "DER format: no trailing bytes" \ |
| 4681 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 4682 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4683 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4684 | 0 \ |
| 4685 | -c "Handshake was completed" \ |
| 4686 | |
| 4687 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4688 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4689 | run_test "DER format: with a trailing zero byte" \ |
| 4690 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 4691 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4692 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4693 | 0 \ |
| 4694 | -c "Handshake was completed" \ |
| 4695 | |
| 4696 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4697 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4698 | run_test "DER format: with a trailing random byte" \ |
| 4699 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 4700 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4701 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4702 | 0 \ |
| 4703 | -c "Handshake was completed" \ |
| 4704 | |
| 4705 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4706 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4707 | run_test "DER format: with 2 trailing random bytes" \ |
| 4708 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 4709 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4710 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4711 | 0 \ |
| 4712 | -c "Handshake was completed" \ |
| 4713 | |
| 4714 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4715 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4716 | run_test "DER format: with 4 trailing random bytes" \ |
| 4717 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 4718 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4719 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4720 | 0 \ |
| 4721 | -c "Handshake was completed" \ |
| 4722 | |
| 4723 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4724 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4725 | run_test "DER format: with 8 trailing random bytes" \ |
| 4726 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 4727 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4728 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4729 | 0 \ |
| 4730 | -c "Handshake was completed" \ |
| 4731 | |
| 4732 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4733 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4734 | run_test "DER format: with 9 trailing random bytes" \ |
| 4735 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 4736 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4737 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4738 | 0 \ |
| 4739 | -c "Handshake was completed" \ |
| 4740 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4741 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 4742 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4743 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4744 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4745 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4746 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4747 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4748 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4749 | 1 \ |
| 4750 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4751 | -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] | 4752 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4753 | -c "X509 - Certificate verification failed" |
| 4754 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4755 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4756 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4757 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4758 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4759 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4760 | 0 \ |
| 4761 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4762 | -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] | 4763 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4764 | -C "X509 - Certificate verification failed" |
| 4765 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4766 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 4767 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 4768 | "$P_SRV" \ |
| 4769 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 4770 | 0 \ |
| 4771 | -c "x509_verify_cert() returned" \ |
| 4772 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4773 | -c "! Certificate verification flags"\ |
| 4774 | -C "! mbedtls_ssl_handshake returned" \ |
| 4775 | -C "X509 - Certificate verification failed" \ |
| 4776 | -C "SSL - No CA Chain is set, but required to operate" |
| 4777 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4778 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 4779 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 4780 | "$P_SRV" \ |
| 4781 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 4782 | 1 \ |
| 4783 | -c "x509_verify_cert() returned" \ |
| 4784 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4785 | -c "! Certificate verification flags"\ |
| 4786 | -c "! mbedtls_ssl_handshake returned" \ |
| 4787 | -c "SSL - No CA Chain is set, but required to operate" |
| 4788 | |
| 4789 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4790 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4791 | # the client informs the server about the supported curves - it does, though, in the |
| 4792 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4793 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4794 | # different means to have the server ignoring the client's supported curve list. |
| 4795 | |
| 4796 | requires_config_enabled MBEDTLS_ECP_C |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4797 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 4798 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4799 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4800 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4801 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4802 | 1 \ |
| 4803 | -c "bad certificate (EC key curve)"\ |
| 4804 | -c "! Certificate verification flags"\ |
| 4805 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4806 | |
| 4807 | requires_config_enabled MBEDTLS_ECP_C |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4808 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 4809 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4810 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4811 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4812 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4813 | 1 \ |
| 4814 | -c "bad certificate (EC key curve)"\ |
| 4815 | -c "! Certificate verification flags"\ |
| 4816 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4817 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4818 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4819 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 4820 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4821 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4822 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4823 | 0 \ |
| 4824 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4825 | -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] | 4826 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4827 | -C "X509 - Certificate verification failed" |
| 4828 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4829 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 4830 | run_test "Authentication: client SHA256, server required" \ |
| 4831 | "$P_SRV auth_mode=required" \ |
| 4832 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4833 | key_file=data_files/server6.key \ |
| 4834 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4835 | 0 \ |
| 4836 | -c "Supported Signature Algorithm found: 4," \ |
| 4837 | -c "Supported Signature Algorithm found: 5," |
| 4838 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4839 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 4840 | run_test "Authentication: client SHA384, server required" \ |
| 4841 | "$P_SRV auth_mode=required" \ |
| 4842 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4843 | key_file=data_files/server6.key \ |
| 4844 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4845 | 0 \ |
| 4846 | -c "Supported Signature Algorithm found: 4," \ |
| 4847 | -c "Supported Signature Algorithm found: 5," |
| 4848 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4849 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4850 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 4851 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4852 | "$P_CLI debug_level=3 crt_file=none \ |
| 4853 | key_file=data_files/server5.key" \ |
| 4854 | 1 \ |
| 4855 | -S "skip write certificate request" \ |
| 4856 | -C "skip parse certificate request" \ |
| 4857 | -c "got a certificate request" \ |
| 4858 | -c "= write certificate$" \ |
| 4859 | -C "skip write certificate$" \ |
| 4860 | -S "x509_verify_cert() returned" \ |
| 4861 | -s "client has no certificate" \ |
| 4862 | -s "! mbedtls_ssl_handshake returned" \ |
| 4863 | -c "! mbedtls_ssl_handshake returned" \ |
| 4864 | -s "No client certification received from the client, but required by the authentication mode" |
| 4865 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4866 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4867 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4868 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4869 | "$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] | 4870 | key_file=data_files/server5.key" \ |
| 4871 | 1 \ |
| 4872 | -S "skip write certificate request" \ |
| 4873 | -C "skip parse certificate request" \ |
| 4874 | -c "got a certificate request" \ |
| 4875 | -C "skip write certificate" \ |
| 4876 | -C "skip write certificate verify" \ |
| 4877 | -S "skip parse certificate verify" \ |
| 4878 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4879 | -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] | 4880 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4881 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4882 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4883 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4884 | # We don't check that the client receives the alert because it might |
| 4885 | # detect that its write end of the connection is closed and abort |
| 4886 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4887 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4888 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 4889 | run_test "Authentication: client cert self-signed and trusted, server required" \ |
| 4890 | "$P_SRV debug_level=3 auth_mode=required ca_file=data_files/server5-selfsigned.crt" \ |
| 4891 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4892 | key_file=data_files/server5.key" \ |
| 4893 | 0 \ |
| 4894 | -S "skip write certificate request" \ |
| 4895 | -C "skip parse certificate request" \ |
| 4896 | -c "got a certificate request" \ |
| 4897 | -C "skip write certificate" \ |
| 4898 | -C "skip write certificate verify" \ |
| 4899 | -S "skip parse certificate verify" \ |
| 4900 | -S "x509_verify_cert() returned" \ |
| 4901 | -S "! The certificate is not correctly signed" \ |
| 4902 | -S "X509 - Certificate verification failed" |
| 4903 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4904 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4905 | run_test "Authentication: client cert not trusted, server required" \ |
| 4906 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4907 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4908 | key_file=data_files/server5.key" \ |
| 4909 | 1 \ |
| 4910 | -S "skip write certificate request" \ |
| 4911 | -C "skip parse certificate request" \ |
| 4912 | -c "got a certificate request" \ |
| 4913 | -C "skip write certificate" \ |
| 4914 | -C "skip write certificate verify" \ |
| 4915 | -S "skip parse certificate verify" \ |
| 4916 | -s "x509_verify_cert() returned" \ |
| 4917 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4918 | -s "! mbedtls_ssl_handshake returned" \ |
| 4919 | -c "! mbedtls_ssl_handshake returned" \ |
| 4920 | -s "X509 - Certificate verification failed" |
| 4921 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4922 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4923 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4924 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4925 | "$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] | 4926 | key_file=data_files/server5.key" \ |
| 4927 | 0 \ |
| 4928 | -S "skip write certificate request" \ |
| 4929 | -C "skip parse certificate request" \ |
| 4930 | -c "got a certificate request" \ |
| 4931 | -C "skip write certificate" \ |
| 4932 | -C "skip write certificate verify" \ |
| 4933 | -S "skip parse certificate verify" \ |
| 4934 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4935 | -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] | 4936 | -S "! mbedtls_ssl_handshake returned" \ |
| 4937 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4938 | -S "X509 - Certificate verification failed" |
| 4939 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4940 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4941 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4942 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 4943 | "$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] | 4944 | key_file=data_files/server5.key" \ |
| 4945 | 0 \ |
| 4946 | -s "skip write certificate request" \ |
| 4947 | -C "skip parse certificate request" \ |
| 4948 | -c "got no certificate request" \ |
| 4949 | -c "skip write certificate" \ |
| 4950 | -c "skip write certificate verify" \ |
| 4951 | -s "skip parse certificate verify" \ |
| 4952 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4953 | -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] | 4954 | -S "! mbedtls_ssl_handshake returned" \ |
| 4955 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4956 | -S "X509 - Certificate verification failed" |
| 4957 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4958 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4959 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4960 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4961 | "$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] | 4962 | 0 \ |
| 4963 | -S "skip write certificate request" \ |
| 4964 | -C "skip parse certificate request" \ |
| 4965 | -c "got a certificate request" \ |
| 4966 | -C "skip write certificate$" \ |
| 4967 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4968 | -c "skip write certificate verify" \ |
| 4969 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4970 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4971 | -S "! mbedtls_ssl_handshake returned" \ |
| 4972 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4973 | -S "X509 - Certificate verification failed" |
| 4974 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4975 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4976 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4977 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4978 | "$O_CLI" \ |
| 4979 | 0 \ |
| 4980 | -S "skip write certificate request" \ |
| 4981 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4982 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4983 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4984 | -S "X509 - Certificate verification failed" |
| 4985 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4986 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4987 | run_test "Authentication: client no cert, openssl server optional" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4988 | "$O_SRV -verify 10 -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4989 | "$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] | 4990 | 0 \ |
| 4991 | -C "skip parse certificate request" \ |
| 4992 | -c "got a certificate request" \ |
| 4993 | -C "skip write certificate$" \ |
| 4994 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4995 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4996 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4997 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4998 | run_test "Authentication: client no cert, openssl server required" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4999 | "$O_SRV -Verify 10 -tls1_2" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5000 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 5001 | 1 \ |
| 5002 | -C "skip parse certificate request" \ |
| 5003 | -c "got a certificate request" \ |
| 5004 | -C "skip write certificate$" \ |
| 5005 | -c "skip write certificate verify" \ |
| 5006 | -c "! mbedtls_ssl_handshake returned" |
| 5007 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 5008 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 5009 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 5010 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 5011 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 5012 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 5013 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 5014 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 5015 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 5016 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 5017 | # 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] | 5018 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5019 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5020 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5021 | run_test "Authentication: server max_int chain, client default" \ |
| 5022 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 5023 | key_file=data_files/dir-maxpath/09.key" \ |
| 5024 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5025 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5026 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5027 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5028 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5029 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5030 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5031 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 5032 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5033 | key_file=data_files/dir-maxpath/10.key" \ |
| 5034 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5035 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5036 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5037 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5038 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5039 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5040 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5041 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 5042 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5043 | key_file=data_files/dir-maxpath/10.key" \ |
| 5044 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 5045 | auth_mode=optional" \ |
| 5046 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5047 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5048 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5049 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5050 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5051 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5052 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 5053 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5054 | key_file=data_files/dir-maxpath/10.key" \ |
| 5055 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 5056 | auth_mode=none" \ |
| 5057 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5058 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5059 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5060 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5061 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5062 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5063 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 5064 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 5065 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5066 | key_file=data_files/dir-maxpath/10.key" \ |
| 5067 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5068 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5069 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5070 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5071 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5072 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5073 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 5074 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 5075 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5076 | key_file=data_files/dir-maxpath/10.key" \ |
| 5077 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5078 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5079 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5080 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5081 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5082 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5083 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 5084 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5085 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5086 | key_file=data_files/dir-maxpath/10.key" \ |
| 5087 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5088 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5089 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5090 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5091 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5092 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5093 | run_test "Authentication: client max_int chain, server required" \ |
| 5094 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5095 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 5096 | key_file=data_files/dir-maxpath/09.key" \ |
| 5097 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5098 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5099 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5100 | # Tests for CA list in CertificateRequest messages |
| 5101 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5102 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5103 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 5104 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5105 | "$P_CLI crt_file=data_files/server6.crt \ |
| 5106 | key_file=data_files/server6.key" \ |
| 5107 | 0 \ |
| 5108 | -s "requested DN" |
| 5109 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5110 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5111 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 5112 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 5113 | "$P_CLI crt_file=data_files/server6.crt \ |
| 5114 | key_file=data_files/server6.key" \ |
| 5115 | 0 \ |
| 5116 | -S "requested DN" |
| 5117 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5118 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5119 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 5120 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 5121 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5122 | key_file=data_files/server5.key" \ |
| 5123 | 1 \ |
| 5124 | -S "requested DN" \ |
| 5125 | -s "x509_verify_cert() returned" \ |
| 5126 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5127 | -s "! mbedtls_ssl_handshake returned" \ |
| 5128 | -c "! mbedtls_ssl_handshake returned" \ |
| 5129 | -s "X509 - Certificate verification failed" |
| 5130 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 5131 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 5132 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5133 | |
| 5134 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5135 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5136 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 5137 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5138 | key_file=data_files/server5.key" \ |
| 5139 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5140 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5141 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5142 | -c "x509_verify_cert() returned" \ |
| 5143 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5144 | -c "! mbedtls_ssl_handshake returned" \ |
| 5145 | -c "X509 - Certificate verification failed" |
| 5146 | |
| 5147 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5148 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5149 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 5150 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5151 | key_file=data_files/server5.key" \ |
| 5152 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 5153 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5154 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5155 | -c "x509_verify_cert() returned" \ |
| 5156 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5157 | -C "! mbedtls_ssl_handshake returned" \ |
| 5158 | -C "X509 - Certificate verification failed" |
| 5159 | |
| 5160 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 5161 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 5162 | # the client informs the server about the supported curves - it does, though, in the |
| 5163 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 5164 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 5165 | # different means to have the server ignoring the client's supported curve list. |
| 5166 | |
| 5167 | requires_config_enabled MBEDTLS_ECP_C |
| 5168 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5169 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5170 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 5171 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5172 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5173 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 5174 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5175 | -c "use CA callback for X.509 CRT verification" \ |
| 5176 | -c "bad certificate (EC key curve)" \ |
| 5177 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5178 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 5179 | |
| 5180 | requires_config_enabled MBEDTLS_ECP_C |
| 5181 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5182 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5183 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 5184 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5185 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5186 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 5187 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5188 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5189 | -c "bad certificate (EC key curve)"\ |
| 5190 | -c "! Certificate verification flags"\ |
| 5191 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 5192 | |
| 5193 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5194 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5195 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 5196 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5197 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5198 | key_file=data_files/server6.key \ |
| 5199 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 5200 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5201 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5202 | -c "Supported Signature Algorithm found: 4," \ |
| 5203 | -c "Supported Signature Algorithm found: 5," |
| 5204 | |
| 5205 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5206 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5207 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 5208 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5209 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5210 | key_file=data_files/server6.key \ |
| 5211 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 5212 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5213 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5214 | -c "Supported Signature Algorithm found: 4," \ |
| 5215 | -c "Supported Signature Algorithm found: 5," |
| 5216 | |
| 5217 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5218 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5219 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 5220 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5221 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 5222 | key_file=data_files/server5.key" \ |
| 5223 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5224 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5225 | -S "skip write certificate request" \ |
| 5226 | -C "skip parse certificate request" \ |
| 5227 | -c "got a certificate request" \ |
| 5228 | -C "skip write certificate" \ |
| 5229 | -C "skip write certificate verify" \ |
| 5230 | -S "skip parse certificate verify" \ |
| 5231 | -s "x509_verify_cert() returned" \ |
| 5232 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5233 | -s "! mbedtls_ssl_handshake returned" \ |
| 5234 | -s "send alert level=2 message=48" \ |
| 5235 | -c "! mbedtls_ssl_handshake returned" \ |
| 5236 | -s "X509 - Certificate verification failed" |
| 5237 | # We don't check that the client receives the alert because it might |
| 5238 | # detect that its write end of the connection is closed and abort |
| 5239 | # before reading the alert message. |
| 5240 | |
| 5241 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5242 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5243 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 5244 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5245 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5246 | key_file=data_files/server5.key" \ |
| 5247 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5248 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5249 | -S "skip write certificate request" \ |
| 5250 | -C "skip parse certificate request" \ |
| 5251 | -c "got a certificate request" \ |
| 5252 | -C "skip write certificate" \ |
| 5253 | -C "skip write certificate verify" \ |
| 5254 | -S "skip parse certificate verify" \ |
| 5255 | -s "x509_verify_cert() returned" \ |
| 5256 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5257 | -s "! mbedtls_ssl_handshake returned" \ |
| 5258 | -c "! mbedtls_ssl_handshake returned" \ |
| 5259 | -s "X509 - Certificate verification failed" |
| 5260 | |
| 5261 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5262 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5263 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 5264 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 5265 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 5266 | key_file=data_files/server5.key" \ |
| 5267 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5268 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5269 | -S "skip write certificate request" \ |
| 5270 | -C "skip parse certificate request" \ |
| 5271 | -c "got a certificate request" \ |
| 5272 | -C "skip write certificate" \ |
| 5273 | -C "skip write certificate verify" \ |
| 5274 | -S "skip parse certificate verify" \ |
| 5275 | -s "x509_verify_cert() returned" \ |
| 5276 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5277 | -S "! mbedtls_ssl_handshake returned" \ |
| 5278 | -C "! mbedtls_ssl_handshake returned" \ |
| 5279 | -S "X509 - Certificate verification failed" |
| 5280 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5281 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5282 | requires_full_size_output_buffer |
| 5283 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5284 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5285 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 5286 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 5287 | key_file=data_files/dir-maxpath/09.key" \ |
| 5288 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5289 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5290 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5291 | -C "X509 - A fatal error occurred" |
| 5292 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5293 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5294 | requires_full_size_output_buffer |
| 5295 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5296 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5297 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 5298 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5299 | key_file=data_files/dir-maxpath/10.key" \ |
| 5300 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5301 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5302 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5303 | -c "X509 - A fatal error occurred" |
| 5304 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5305 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5306 | requires_full_size_output_buffer |
| 5307 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5308 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5309 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 5310 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5311 | key_file=data_files/dir-maxpath/10.key" \ |
| 5312 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 5313 | debug_level=3 auth_mode=optional" \ |
| 5314 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5315 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5316 | -c "X509 - A fatal error occurred" |
| 5317 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5318 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5319 | requires_full_size_output_buffer |
| 5320 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5321 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5322 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 5323 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 5324 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5325 | key_file=data_files/dir-maxpath/10.key" \ |
| 5326 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5327 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5328 | -s "X509 - A fatal error occurred" |
| 5329 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5330 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5331 | requires_full_size_output_buffer |
| 5332 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5333 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5334 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 5335 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5336 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5337 | key_file=data_files/dir-maxpath/10.key" \ |
| 5338 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5339 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5340 | -s "X509 - A fatal error occurred" |
| 5341 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5342 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5343 | requires_full_size_output_buffer |
| 5344 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5345 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5346 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 5347 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5348 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 5349 | key_file=data_files/dir-maxpath/09.key" \ |
| 5350 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5351 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5352 | -S "X509 - A fatal error occurred" |
| 5353 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 5354 | # Tests for certificate selection based on SHA version |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5355 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5356 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5357 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 5358 | "$P_SRV force_version=tls12 crt_file=data_files/server5.crt \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5359 | key_file=data_files/server5.key \ |
| 5360 | crt_file2=data_files/server5-sha1.crt \ |
| 5361 | key_file2=data_files/server5.key" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 5362 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5363 | 0 \ |
| 5364 | -c "signed using.*ECDSA with SHA256" \ |
| 5365 | -C "signed using.*ECDSA with SHA1" |
| 5366 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5367 | # tests for SNI |
| 5368 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5369 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5370 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5371 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5372 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5373 | 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] | 5374 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5375 | 0 \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5376 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 5377 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5378 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5379 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5380 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5381 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5382 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5383 | 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] | 5384 | 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] | 5385 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5386 | 0 \ |
| 5387 | -s "parse ServerName extension" \ |
| 5388 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5389 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5390 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5391 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5392 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5393 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5394 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5395 | 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] | 5396 | 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] | 5397 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5398 | 0 \ |
| 5399 | -s "parse ServerName extension" \ |
| 5400 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5401 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5402 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5403 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5404 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5405 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5406 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5407 | 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] | 5408 | 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] | 5409 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5410 | 1 \ |
| 5411 | -s "parse ServerName extension" \ |
| 5412 | -s "ssl_sni_wrapper() returned" \ |
| 5413 | -s "mbedtls_ssl_handshake returned" \ |
| 5414 | -c "mbedtls_ssl_handshake returned" \ |
| 5415 | -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] | 5416 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5417 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5418 | run_test "SNI: client auth no override: optional" \ |
| 5419 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5420 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5421 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 5422 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5423 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5424 | -S "skip write certificate request" \ |
| 5425 | -C "skip parse certificate request" \ |
| 5426 | -c "got a certificate request" \ |
| 5427 | -C "skip write certificate" \ |
| 5428 | -C "skip write certificate verify" \ |
| 5429 | -S "skip parse certificate verify" |
| 5430 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5431 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5432 | run_test "SNI: client auth override: none -> optional" \ |
| 5433 | "$P_SRV debug_level=3 auth_mode=none \ |
| 5434 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5435 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 5436 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5437 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5438 | -S "skip write certificate request" \ |
| 5439 | -C "skip parse certificate request" \ |
| 5440 | -c "got a certificate request" \ |
| 5441 | -C "skip write certificate" \ |
| 5442 | -C "skip write certificate verify" \ |
| 5443 | -S "skip parse certificate verify" |
| 5444 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5445 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5446 | run_test "SNI: client auth override: optional -> none" \ |
| 5447 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5448 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5449 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 5450 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5451 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5452 | -s "skip write certificate request" \ |
| 5453 | -C "skip parse certificate request" \ |
| 5454 | -c "got no certificate request" \ |
| 5455 | -c "skip write certificate" \ |
| 5456 | -c "skip write certificate verify" \ |
| 5457 | -s "skip parse certificate verify" |
| 5458 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5459 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5460 | run_test "SNI: CA no override" \ |
| 5461 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5462 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5463 | ca_file=data_files/test-ca.crt \ |
| 5464 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 5465 | "$P_CLI debug_level=3 server_name=localhost \ |
| 5466 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5467 | 1 \ |
| 5468 | -S "skip write certificate request" \ |
| 5469 | -C "skip parse certificate request" \ |
| 5470 | -c "got a certificate request" \ |
| 5471 | -C "skip write certificate" \ |
| 5472 | -C "skip write certificate verify" \ |
| 5473 | -S "skip parse certificate verify" \ |
| 5474 | -s "x509_verify_cert() returned" \ |
| 5475 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5476 | -S "The certificate has been revoked (is on a CRL)" |
| 5477 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5478 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5479 | run_test "SNI: CA override" \ |
| 5480 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5481 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5482 | ca_file=data_files/test-ca.crt \ |
| 5483 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 5484 | "$P_CLI debug_level=3 server_name=localhost \ |
| 5485 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5486 | 0 \ |
| 5487 | -S "skip write certificate request" \ |
| 5488 | -C "skip parse certificate request" \ |
| 5489 | -c "got a certificate request" \ |
| 5490 | -C "skip write certificate" \ |
| 5491 | -C "skip write certificate verify" \ |
| 5492 | -S "skip parse certificate verify" \ |
| 5493 | -S "x509_verify_cert() returned" \ |
| 5494 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5495 | -S "The certificate has been revoked (is on a CRL)" |
| 5496 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5497 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5498 | run_test "SNI: CA override with CRL" \ |
| 5499 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5500 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5501 | ca_file=data_files/test-ca.crt \ |
| 5502 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 5503 | "$P_CLI debug_level=3 server_name=localhost \ |
| 5504 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5505 | 1 \ |
| 5506 | -S "skip write certificate request" \ |
| 5507 | -C "skip parse certificate request" \ |
| 5508 | -c "got a certificate request" \ |
| 5509 | -C "skip write certificate" \ |
| 5510 | -C "skip write certificate verify" \ |
| 5511 | -S "skip parse certificate verify" \ |
| 5512 | -s "x509_verify_cert() returned" \ |
| 5513 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5514 | -s "The certificate has been revoked (is on a CRL)" |
| 5515 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5516 | # Tests for SNI and DTLS |
| 5517 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5518 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5519 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5520 | run_test "SNI: DTLS, no SNI callback" \ |
| 5521 | "$P_SRV debug_level=3 dtls=1 \ |
| 5522 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 5523 | "$P_CLI server_name=localhost dtls=1" \ |
| 5524 | 0 \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5525 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 5526 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 5527 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5528 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5529 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5530 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5531 | "$P_SRV debug_level=3 dtls=1 \ |
| 5532 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5533 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5534 | "$P_CLI server_name=localhost dtls=1" \ |
| 5535 | 0 \ |
| 5536 | -s "parse ServerName extension" \ |
| 5537 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5538 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 5539 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5540 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5541 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5542 | run_test "SNI: DTLS, matching cert 2" \ |
| 5543 | "$P_SRV debug_level=3 dtls=1 \ |
| 5544 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5545 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5546 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 5547 | 0 \ |
| 5548 | -s "parse ServerName extension" \ |
| 5549 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5550 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 5551 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5552 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5553 | run_test "SNI: DTLS, no matching cert" \ |
| 5554 | "$P_SRV debug_level=3 dtls=1 \ |
| 5555 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5556 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5557 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 5558 | 1 \ |
| 5559 | -s "parse ServerName extension" \ |
| 5560 | -s "ssl_sni_wrapper() returned" \ |
| 5561 | -s "mbedtls_ssl_handshake returned" \ |
| 5562 | -c "mbedtls_ssl_handshake returned" \ |
| 5563 | -c "SSL - A fatal alert message was received from our peer" |
| 5564 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5565 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5566 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 5567 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5568 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5569 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 5570 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5571 | 0 \ |
| 5572 | -S "skip write certificate request" \ |
| 5573 | -C "skip parse certificate request" \ |
| 5574 | -c "got a certificate request" \ |
| 5575 | -C "skip write certificate" \ |
| 5576 | -C "skip write certificate verify" \ |
| 5577 | -S "skip parse certificate verify" |
| 5578 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5579 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5580 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 5581 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 5582 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5583 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 5584 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5585 | 0 \ |
| 5586 | -S "skip write certificate request" \ |
| 5587 | -C "skip parse certificate request" \ |
| 5588 | -c "got a certificate request" \ |
| 5589 | -C "skip write certificate" \ |
| 5590 | -C "skip write certificate verify" \ |
| 5591 | -S "skip parse certificate verify" |
| 5592 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5593 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5594 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 5595 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5596 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5597 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 5598 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5599 | 0 \ |
| 5600 | -s "skip write certificate request" \ |
| 5601 | -C "skip parse certificate request" \ |
| 5602 | -c "got no certificate request" \ |
| 5603 | -c "skip write certificate" \ |
| 5604 | -c "skip write certificate verify" \ |
| 5605 | -s "skip parse certificate verify" |
| 5606 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5607 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5608 | run_test "SNI: DTLS, CA no override" \ |
| 5609 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5610 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5611 | ca_file=data_files/test-ca.crt \ |
| 5612 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 5613 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5614 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5615 | 1 \ |
| 5616 | -S "skip write certificate request" \ |
| 5617 | -C "skip parse certificate request" \ |
| 5618 | -c "got a certificate request" \ |
| 5619 | -C "skip write certificate" \ |
| 5620 | -C "skip write certificate verify" \ |
| 5621 | -S "skip parse certificate verify" \ |
| 5622 | -s "x509_verify_cert() returned" \ |
| 5623 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5624 | -S "The certificate has been revoked (is on a CRL)" |
| 5625 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5626 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5627 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5628 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5629 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5630 | ca_file=data_files/test-ca.crt \ |
| 5631 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 5632 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5633 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5634 | 0 \ |
| 5635 | -S "skip write certificate request" \ |
| 5636 | -C "skip parse certificate request" \ |
| 5637 | -c "got a certificate request" \ |
| 5638 | -C "skip write certificate" \ |
| 5639 | -C "skip write certificate verify" \ |
| 5640 | -S "skip parse certificate verify" \ |
| 5641 | -S "x509_verify_cert() returned" \ |
| 5642 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5643 | -S "The certificate has been revoked (is on a CRL)" |
| 5644 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5645 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5646 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5647 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5648 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 5649 | ca_file=data_files/test-ca.crt \ |
| 5650 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 5651 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5652 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5653 | 1 \ |
| 5654 | -S "skip write certificate request" \ |
| 5655 | -C "skip parse certificate request" \ |
| 5656 | -c "got a certificate request" \ |
| 5657 | -C "skip write certificate" \ |
| 5658 | -C "skip write certificate verify" \ |
| 5659 | -S "skip parse certificate verify" \ |
| 5660 | -s "x509_verify_cert() returned" \ |
| 5661 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5662 | -s "The certificate has been revoked (is on a CRL)" |
| 5663 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5664 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 5665 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5666 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5667 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5668 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 5669 | "$P_CLI nbio=2 tickets=0" \ |
| 5670 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5671 | -S "mbedtls_ssl_handshake returned" \ |
| 5672 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5673 | -c "Read from server: .* bytes read" |
| 5674 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5675 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5676 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5677 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 5678 | "$P_CLI nbio=2 tickets=0" \ |
| 5679 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5680 | -S "mbedtls_ssl_handshake returned" \ |
| 5681 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5682 | -c "Read from server: .* bytes read" |
| 5683 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5684 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5685 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5686 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 5687 | "$P_CLI nbio=2 tickets=1" \ |
| 5688 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5689 | -S "mbedtls_ssl_handshake returned" \ |
| 5690 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5691 | -c "Read from server: .* bytes read" |
| 5692 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5693 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5694 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5695 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 5696 | "$P_CLI nbio=2 tickets=1" \ |
| 5697 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5698 | -S "mbedtls_ssl_handshake returned" \ |
| 5699 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5700 | -c "Read from server: .* bytes read" |
| 5701 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5702 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5703 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5704 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 5705 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 5706 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5707 | -S "mbedtls_ssl_handshake returned" \ |
| 5708 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5709 | -c "Read from server: .* bytes read" |
| 5710 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5711 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5712 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5713 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 5714 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 5715 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5716 | -S "mbedtls_ssl_handshake returned" \ |
| 5717 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5718 | -c "Read from server: .* bytes read" |
| 5719 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5720 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5721 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5722 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 5723 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 5724 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5725 | -S "mbedtls_ssl_handshake returned" \ |
| 5726 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5727 | -c "Read from server: .* bytes read" |
| 5728 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5729 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 5730 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5731 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5732 | run_test "Event-driven I/O: basic handshake" \ |
| 5733 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 5734 | "$P_CLI event=1 tickets=0" \ |
| 5735 | 0 \ |
| 5736 | -S "mbedtls_ssl_handshake returned" \ |
| 5737 | -C "mbedtls_ssl_handshake returned" \ |
| 5738 | -c "Read from server: .* bytes read" |
| 5739 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5740 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5741 | run_test "Event-driven I/O: client auth" \ |
| 5742 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 5743 | "$P_CLI event=1 tickets=0" \ |
| 5744 | 0 \ |
| 5745 | -S "mbedtls_ssl_handshake returned" \ |
| 5746 | -C "mbedtls_ssl_handshake returned" \ |
| 5747 | -c "Read from server: .* bytes read" |
| 5748 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5749 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5750 | run_test "Event-driven I/O: ticket" \ |
| 5751 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 5752 | "$P_CLI event=1 tickets=1" \ |
| 5753 | 0 \ |
| 5754 | -S "mbedtls_ssl_handshake returned" \ |
| 5755 | -C "mbedtls_ssl_handshake returned" \ |
| 5756 | -c "Read from server: .* bytes read" |
| 5757 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5758 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5759 | run_test "Event-driven I/O: ticket + client auth" \ |
| 5760 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 5761 | "$P_CLI event=1 tickets=1" \ |
| 5762 | 0 \ |
| 5763 | -S "mbedtls_ssl_handshake returned" \ |
| 5764 | -C "mbedtls_ssl_handshake returned" \ |
| 5765 | -c "Read from server: .* bytes read" |
| 5766 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5767 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5768 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 5769 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 5770 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 5771 | 0 \ |
| 5772 | -S "mbedtls_ssl_handshake returned" \ |
| 5773 | -C "mbedtls_ssl_handshake returned" \ |
| 5774 | -c "Read from server: .* bytes read" |
| 5775 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5776 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5777 | run_test "Event-driven I/O: ticket + resume" \ |
| 5778 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 5779 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 5780 | 0 \ |
| 5781 | -S "mbedtls_ssl_handshake returned" \ |
| 5782 | -C "mbedtls_ssl_handshake returned" \ |
| 5783 | -c "Read from server: .* bytes read" |
| 5784 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5785 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5786 | run_test "Event-driven I/O: session-id resume" \ |
| 5787 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 5788 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 5789 | 0 \ |
| 5790 | -S "mbedtls_ssl_handshake returned" \ |
| 5791 | -C "mbedtls_ssl_handshake returned" \ |
| 5792 | -c "Read from server: .* bytes read" |
| 5793 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5794 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5795 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 5796 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 5797 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 5798 | 0 \ |
| 5799 | -c "Read from server: .* bytes read" |
| 5800 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5801 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5802 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 5803 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 5804 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 5805 | 0 \ |
| 5806 | -c "Read from server: .* bytes read" |
| 5807 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5808 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5809 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 5810 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 5811 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 5812 | 0 \ |
| 5813 | -c "Read from server: .* bytes read" |
| 5814 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5815 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5816 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 5817 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 5818 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 5819 | 0 \ |
| 5820 | -c "Read from server: .* bytes read" |
| 5821 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5822 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5823 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 5824 | "$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] | 5825 | "$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] | 5826 | 0 \ |
| 5827 | -c "Read from server: .* bytes read" |
| 5828 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5829 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5830 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 5831 | "$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] | 5832 | "$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] | 5833 | 0 \ |
| 5834 | -c "Read from server: .* bytes read" |
| 5835 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5836 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5837 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 5838 | "$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] | 5839 | "$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] | 5840 | 0 \ |
| 5841 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5842 | |
| 5843 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 5844 | # During session resumption, the client will send its ApplicationData record |
| 5845 | # within the same datagram as the Finished messages. In this situation, the |
| 5846 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 5847 | # because the ApplicationData request has already been queued internally. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5848 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5849 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 5850 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5851 | "$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] | 5852 | "$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] | 5853 | 0 \ |
| 5854 | -c "Read from server: .* bytes read" |
| 5855 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5856 | # Tests for version negotiation |
| 5857 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5858 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5859 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5860 | "$P_SRV" \ |
| 5861 | "$P_CLI" \ |
| 5862 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5863 | -S "mbedtls_ssl_handshake returned" \ |
| 5864 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5865 | -s "Protocol is TLSv1.2" \ |
| 5866 | -c "Protocol is TLSv1.2" |
| 5867 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5868 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 5869 | run_test "Not supported version check: cli TLS 1.0" \ |
| 5870 | "$P_SRV" \ |
| 5871 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 5872 | 1 \ |
| 5873 | -s "Handshake protocol not within min/max boundaries" \ |
| 5874 | -c "Error in protocol version" \ |
| 5875 | -S "Protocol is TLSv1.0" \ |
| 5876 | -C "Handshake was completed" |
| 5877 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5878 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 5879 | run_test "Not supported version check: cli TLS 1.1" \ |
| 5880 | "$P_SRV" \ |
| 5881 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 5882 | 1 \ |
| 5883 | -s "Handshake protocol not within min/max boundaries" \ |
| 5884 | -c "Error in protocol version" \ |
| 5885 | -S "Protocol is TLSv1.1" \ |
| 5886 | -C "Handshake was completed" |
| 5887 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5888 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 5889 | run_test "Not supported version check: srv max TLS 1.0" \ |
| 5890 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 5891 | "$P_CLI" \ |
| 5892 | 1 \ |
| 5893 | -s "Error in protocol version" \ |
| 5894 | -c "Handshake protocol not within min/max boundaries" \ |
| 5895 | -S "Version: TLS1.0" \ |
| 5896 | -C "Protocol is TLSv1.0" |
| 5897 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5898 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 5899 | run_test "Not supported version check: srv max TLS 1.1" \ |
| 5900 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 5901 | "$P_CLI" \ |
| 5902 | 1 \ |
| 5903 | -s "Error in protocol version" \ |
| 5904 | -c "Handshake protocol not within min/max boundaries" \ |
| 5905 | -S "Version: TLS1.1" \ |
| 5906 | -C "Protocol is TLSv1.1" |
| 5907 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5908 | # Tests for ALPN extension |
| 5909 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5910 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5911 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5912 | "$P_SRV debug_level=3" \ |
| 5913 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5914 | 0 \ |
| 5915 | -C "client hello, adding alpn extension" \ |
| 5916 | -S "found alpn extension" \ |
| 5917 | -C "got an alert message, type: \\[2:120]" \ |
| 5918 | -S "server hello, adding alpn extension" \ |
| 5919 | -C "found alpn extension " \ |
| 5920 | -C "Application Layer Protocol is" \ |
| 5921 | -S "Application Layer Protocol is" |
| 5922 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5923 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5924 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5925 | "$P_SRV debug_level=3" \ |
| 5926 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5927 | 0 \ |
| 5928 | -c "client hello, adding alpn extension" \ |
| 5929 | -s "found alpn extension" \ |
| 5930 | -C "got an alert message, type: \\[2:120]" \ |
| 5931 | -S "server hello, adding alpn extension" \ |
| 5932 | -C "found alpn extension " \ |
| 5933 | -c "Application Layer Protocol is (none)" \ |
| 5934 | -S "Application Layer Protocol is" |
| 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 "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5938 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5939 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5940 | 0 \ |
| 5941 | -C "client hello, adding alpn extension" \ |
| 5942 | -S "found alpn extension" \ |
| 5943 | -C "got an alert message, type: \\[2:120]" \ |
| 5944 | -S "server hello, adding alpn extension" \ |
| 5945 | -C "found alpn extension " \ |
| 5946 | -C "Application Layer Protocol is" \ |
| 5947 | -s "Application Layer Protocol is (none)" |
| 5948 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5949 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5950 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5951 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5952 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5953 | 0 \ |
| 5954 | -c "client hello, adding alpn extension" \ |
| 5955 | -s "found alpn extension" \ |
| 5956 | -C "got an alert message, type: \\[2:120]" \ |
| 5957 | -s "server hello, adding alpn extension" \ |
| 5958 | -c "found alpn extension" \ |
| 5959 | -c "Application Layer Protocol is abc" \ |
| 5960 | -s "Application Layer Protocol is abc" |
| 5961 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5962 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5963 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5964 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5965 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5966 | 0 \ |
| 5967 | -c "client hello, adding alpn extension" \ |
| 5968 | -s "found alpn extension" \ |
| 5969 | -C "got an alert message, type: \\[2:120]" \ |
| 5970 | -s "server hello, adding alpn extension" \ |
| 5971 | -c "found alpn extension" \ |
| 5972 | -c "Application Layer Protocol is abc" \ |
| 5973 | -s "Application Layer Protocol is abc" |
| 5974 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5975 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5976 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5977 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5978 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5979 | 0 \ |
| 5980 | -c "client hello, adding alpn extension" \ |
| 5981 | -s "found alpn extension" \ |
| 5982 | -C "got an alert message, type: \\[2:120]" \ |
| 5983 | -s "server hello, adding alpn extension" \ |
| 5984 | -c "found alpn extension" \ |
| 5985 | -c "Application Layer Protocol is 1234" \ |
| 5986 | -s "Application Layer Protocol is 1234" |
| 5987 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5988 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5989 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5990 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 5991 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5992 | 1 \ |
| 5993 | -c "client hello, adding alpn extension" \ |
| 5994 | -s "found alpn extension" \ |
| 5995 | -c "got an alert message, type: \\[2:120]" \ |
| 5996 | -S "server hello, adding alpn extension" \ |
| 5997 | -C "found alpn extension" \ |
| 5998 | -C "Application Layer Protocol is 1234" \ |
| 5999 | -S "Application Layer Protocol is 1234" |
| 6000 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 6001 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6002 | # Tests for keyUsage in leaf certificates, part 1: |
| 6003 | # server-side certificate/suite selection |
| 6004 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6005 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6006 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6007 | "$P_SRV key_file=data_files/server2.key \ |
| 6008 | crt_file=data_files/server2.ku-ds.crt" \ |
| 6009 | "$P_CLI" \ |
| 6010 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 6011 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6012 | |
| 6013 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6014 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6015 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6016 | "$P_SRV key_file=data_files/server2.key \ |
| 6017 | crt_file=data_files/server2.ku-ke.crt" \ |
| 6018 | "$P_CLI" \ |
| 6019 | 0 \ |
| 6020 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 6021 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6022 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6023 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6024 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6025 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6026 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6027 | 1 \ |
| 6028 | -C "Ciphersuite is " |
| 6029 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6030 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6031 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6032 | "$P_SRV key_file=data_files/server5.key \ |
| 6033 | crt_file=data_files/server5.ku-ds.crt" \ |
| 6034 | "$P_CLI" \ |
| 6035 | 0 \ |
| 6036 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 6037 | |
| 6038 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6039 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6040 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6041 | "$P_SRV key_file=data_files/server5.key \ |
| 6042 | crt_file=data_files/server5.ku-ka.crt" \ |
| 6043 | "$P_CLI" \ |
| 6044 | 0 \ |
| 6045 | -c "Ciphersuite is TLS-ECDH-" |
| 6046 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6047 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6048 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6049 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6050 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6051 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6052 | 1 \ |
| 6053 | -C "Ciphersuite is " |
| 6054 | |
| 6055 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6056 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6057 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6058 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6059 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6060 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6061 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6062 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6063 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6064 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6065 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6066 | -C "Processing of the Certificate handshake message failed" \ |
| 6067 | -c "Ciphersuite is TLS-" |
| 6068 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6069 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6070 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6071 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6072 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6073 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6074 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6075 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6076 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6077 | -C "Processing of the Certificate handshake message failed" \ |
| 6078 | -c "Ciphersuite is TLS-" |
| 6079 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6080 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6081 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6082 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6083 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6084 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6085 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6086 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6087 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6088 | -C "Processing of the Certificate handshake message failed" \ |
| 6089 | -c "Ciphersuite is TLS-" |
| 6090 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6091 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6092 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6093 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6094 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6095 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6096 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6097 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6098 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6099 | -c "Processing of the Certificate handshake message failed" \ |
| 6100 | -C "Ciphersuite is TLS-" |
| 6101 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6102 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6103 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6104 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6105 | -cert data_files/server2.ku-ke.crt" \ |
| 6106 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 6107 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6108 | 0 \ |
| 6109 | -c "bad certificate (usage extensions)" \ |
| 6110 | -C "Processing of the Certificate handshake message failed" \ |
| 6111 | -c "Ciphersuite is TLS-" \ |
| 6112 | -c "! Usage does not match the keyUsage extension" |
| 6113 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6114 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6115 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6116 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6117 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6118 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6119 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6120 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6121 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6122 | -C "Processing of the Certificate handshake message failed" \ |
| 6123 | -c "Ciphersuite is TLS-" |
| 6124 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6125 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6126 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6127 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6128 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6129 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6130 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6131 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6132 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6133 | -c "Processing of the Certificate handshake message failed" \ |
| 6134 | -C "Ciphersuite is TLS-" |
| 6135 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6136 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6137 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6138 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6139 | -cert data_files/server2.ku-ds.crt" \ |
| 6140 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 6141 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6142 | 0 \ |
| 6143 | -c "bad certificate (usage extensions)" \ |
| 6144 | -C "Processing of the Certificate handshake message failed" \ |
| 6145 | -c "Ciphersuite is TLS-" \ |
| 6146 | -c "! Usage does not match the keyUsage extension" |
| 6147 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6148 | # Tests for keyUsage in leaf certificates, part 3: |
| 6149 | # server-side checking of client cert |
| 6150 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6151 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6152 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6153 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6154 | "$O_CLI -key data_files/server2.key \ |
| 6155 | -cert data_files/server2.ku-ds.crt" \ |
| 6156 | 0 \ |
| 6157 | -S "bad certificate (usage extensions)" \ |
| 6158 | -S "Processing of the Certificate handshake message failed" |
| 6159 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6160 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6161 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6162 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6163 | "$O_CLI -key data_files/server2.key \ |
| 6164 | -cert data_files/server2.ku-ke.crt" \ |
| 6165 | 0 \ |
| 6166 | -s "bad certificate (usage extensions)" \ |
| 6167 | -S "Processing of the Certificate handshake message failed" |
| 6168 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6169 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6170 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6171 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6172 | "$O_CLI -key data_files/server2.key \ |
| 6173 | -cert data_files/server2.ku-ke.crt" \ |
| 6174 | 1 \ |
| 6175 | -s "bad certificate (usage extensions)" \ |
| 6176 | -s "Processing of the Certificate handshake message failed" |
| 6177 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6178 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6179 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6180 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6181 | "$O_CLI -key data_files/server5.key \ |
| 6182 | -cert data_files/server5.ku-ds.crt" \ |
| 6183 | 0 \ |
| 6184 | -S "bad certificate (usage extensions)" \ |
| 6185 | -S "Processing of the Certificate handshake message failed" |
| 6186 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6187 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6188 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6189 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6190 | "$O_CLI -key data_files/server5.key \ |
| 6191 | -cert data_files/server5.ku-ka.crt" \ |
| 6192 | 0 \ |
| 6193 | -s "bad certificate (usage extensions)" \ |
| 6194 | -S "Processing of the Certificate handshake message failed" |
| 6195 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6196 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 6197 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6198 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6199 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6200 | "$P_SRV key_file=data_files/server5.key \ |
| 6201 | crt_file=data_files/server5.eku-srv.crt" \ |
| 6202 | "$P_CLI" \ |
| 6203 | 0 |
| 6204 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6205 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6206 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6207 | "$P_SRV key_file=data_files/server5.key \ |
| 6208 | crt_file=data_files/server5.eku-srv.crt" \ |
| 6209 | "$P_CLI" \ |
| 6210 | 0 |
| 6211 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6212 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6213 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6214 | "$P_SRV key_file=data_files/server5.key \ |
| 6215 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 6216 | "$P_CLI" \ |
| 6217 | 0 |
| 6218 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6219 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6220 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 6221 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6222 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 6223 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6224 | 1 |
| 6225 | |
| 6226 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 6227 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6228 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6229 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6230 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6231 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6232 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6233 | 0 \ |
| 6234 | -C "bad certificate (usage extensions)" \ |
| 6235 | -C "Processing of the Certificate handshake message failed" \ |
| 6236 | -c "Ciphersuite is TLS-" |
| 6237 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6238 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6239 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6240 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6241 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6242 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6243 | 0 \ |
| 6244 | -C "bad certificate (usage extensions)" \ |
| 6245 | -C "Processing of the Certificate handshake message failed" \ |
| 6246 | -c "Ciphersuite is TLS-" |
| 6247 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6248 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6249 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6250 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6251 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6252 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6253 | 0 \ |
| 6254 | -C "bad certificate (usage extensions)" \ |
| 6255 | -C "Processing of the Certificate handshake message failed" \ |
| 6256 | -c "Ciphersuite is TLS-" |
| 6257 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6258 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6259 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6260 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6261 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6262 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6263 | 1 \ |
| 6264 | -c "bad certificate (usage extensions)" \ |
| 6265 | -c "Processing of the Certificate handshake message failed" \ |
| 6266 | -C "Ciphersuite is TLS-" |
| 6267 | |
| 6268 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 6269 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6270 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6271 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6272 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6273 | "$O_CLI -key data_files/server5.key \ |
| 6274 | -cert data_files/server5.eku-cli.crt" \ |
| 6275 | 0 \ |
| 6276 | -S "bad certificate (usage extensions)" \ |
| 6277 | -S "Processing of the Certificate handshake message failed" |
| 6278 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6279 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6280 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6281 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6282 | "$O_CLI -key data_files/server5.key \ |
| 6283 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 6284 | 0 \ |
| 6285 | -S "bad certificate (usage extensions)" \ |
| 6286 | -S "Processing of the Certificate handshake message failed" |
| 6287 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6288 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6289 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6290 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6291 | "$O_CLI -key data_files/server5.key \ |
| 6292 | -cert data_files/server5.eku-cs_any.crt" \ |
| 6293 | 0 \ |
| 6294 | -S "bad certificate (usage extensions)" \ |
| 6295 | -S "Processing of the Certificate handshake message failed" |
| 6296 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6297 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6298 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6299 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6300 | "$O_CLI -key data_files/server5.key \ |
| 6301 | -cert data_files/server5.eku-cs.crt" \ |
| 6302 | 0 \ |
| 6303 | -s "bad certificate (usage extensions)" \ |
| 6304 | -S "Processing of the Certificate handshake message failed" |
| 6305 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6306 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6307 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6308 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6309 | "$O_CLI -key data_files/server5.key \ |
| 6310 | -cert data_files/server5.eku-cs.crt" \ |
| 6311 | 1 \ |
| 6312 | -s "bad certificate (usage extensions)" \ |
| 6313 | -s "Processing of the Certificate handshake message failed" |
| 6314 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6315 | # Tests for DHM parameters loading |
| 6316 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6317 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6318 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6319 | "$P_SRV" \ |
| 6320 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6321 | debug_level=3" \ |
| 6322 | 0 \ |
| 6323 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 6324 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6325 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6326 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6327 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6328 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 6329 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6330 | debug_level=3" \ |
| 6331 | 0 \ |
| 6332 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 6333 | -c "value of 'DHM: G ' (2 bits)" |
| 6334 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6335 | # Tests for DHM client-side size checking |
| 6336 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6337 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6338 | run_test "DHM size: server default, client default, OK" \ |
| 6339 | "$P_SRV" \ |
| 6340 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6341 | debug_level=1" \ |
| 6342 | 0 \ |
| 6343 | -C "DHM prime too short:" |
| 6344 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6345 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6346 | run_test "DHM size: server default, client 2048, OK" \ |
| 6347 | "$P_SRV" \ |
| 6348 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6349 | debug_level=1 dhmlen=2048" \ |
| 6350 | 0 \ |
| 6351 | -C "DHM prime too short:" |
| 6352 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6353 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6354 | run_test "DHM size: server 1024, client default, OK" \ |
| 6355 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 6356 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6357 | debug_level=1" \ |
| 6358 | 0 \ |
| 6359 | -C "DHM prime too short:" |
| 6360 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6361 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6362 | run_test "DHM size: server 999, client 999, OK" \ |
| 6363 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 6364 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6365 | debug_level=1 dhmlen=999" \ |
| 6366 | 0 \ |
| 6367 | -C "DHM prime too short:" |
| 6368 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6369 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6370 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 6371 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 6372 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6373 | debug_level=1 dhmlen=1000" \ |
| 6374 | 0 \ |
| 6375 | -C "DHM prime too short:" |
| 6376 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6377 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6378 | run_test "DHM size: server 1000, client default, rejected" \ |
| 6379 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 6380 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6381 | debug_level=1" \ |
| 6382 | 1 \ |
| 6383 | -c "DHM prime too short:" |
| 6384 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6385 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6386 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 6387 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 6388 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6389 | debug_level=1 dhmlen=1001" \ |
| 6390 | 1 \ |
| 6391 | -c "DHM prime too short:" |
| 6392 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6393 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6394 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 6395 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 6396 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6397 | debug_level=1 dhmlen=1000" \ |
| 6398 | 1 \ |
| 6399 | -c "DHM prime too short:" |
| 6400 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6401 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6402 | run_test "DHM size: server 998, client 999, rejected" \ |
| 6403 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 6404 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6405 | debug_level=1 dhmlen=999" \ |
| 6406 | 1 \ |
| 6407 | -c "DHM prime too short:" |
| 6408 | |
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 | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6410 | run_test "DHM size: server default, client 2049, rejected" \ |
| 6411 | "$P_SRV" \ |
| 6412 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6413 | debug_level=1 dhmlen=2049" \ |
| 6414 | 1 \ |
| 6415 | -c "DHM prime too short:" |
| 6416 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6417 | # Tests for PSK callback |
| 6418 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6419 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6420 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6421 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 6422 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6423 | psk_identity=foo psk=abc123" \ |
| 6424 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6425 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 6426 | -S "SSL - Unknown identity received" \ |
| 6427 | -S "SSL - Verification of the message MAC failed" |
| 6428 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6429 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6430 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6431 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 6432 | "$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] | 6433 | "$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] | 6434 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6435 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6436 | -C "session hash for extended master secret"\ |
| 6437 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6438 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6439 | -S "SSL - Unknown identity received" \ |
| 6440 | -S "SSL - Verification of the message MAC failed" |
| 6441 | |
| 6442 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6443 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6444 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 6445 | "$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] | 6446 | "$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] | 6447 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6448 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6449 | -C "session hash for extended master secret"\ |
| 6450 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6451 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6452 | -S "SSL - Unknown identity received" \ |
| 6453 | -S "SSL - Verification of the message MAC failed" |
| 6454 | |
| 6455 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6456 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6457 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 6458 | "$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] | 6459 | "$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] | 6460 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6461 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6462 | -c "session hash for extended master secret"\ |
| 6463 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6464 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6465 | -S "SSL - Unknown identity received" \ |
| 6466 | -S "SSL - Verification of the message MAC failed" |
| 6467 | |
| 6468 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6469 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6470 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 6471 | "$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] | 6472 | "$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] | 6473 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6474 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6475 | -c "session hash for extended master secret"\ |
| 6476 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6477 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6478 | -S "SSL - Unknown identity received" \ |
| 6479 | -S "SSL - Verification of the message MAC failed" |
| 6480 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6481 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6482 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 6483 | run_test "PSK callback: opaque rsa-psk on client, no callback" \ |
| 6484 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 6485 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \ |
| 6486 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 6487 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 6488 | -C "session hash for extended master secret"\ |
| 6489 | -S "session hash for extended master secret"\ |
| 6490 | -S "SSL - The handshake negotiation failed" \ |
| 6491 | -S "SSL - Unknown identity received" \ |
| 6492 | -S "SSL - Verification of the message MAC failed" |
| 6493 | |
| 6494 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6495 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6496 | run_test "PSK callback: opaque rsa-psk on client, no callback, SHA-384" \ |
| 6497 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 6498 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 6499 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 6500 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 6501 | -C "session hash for extended master secret"\ |
| 6502 | -S "session hash for extended master secret"\ |
| 6503 | -S "SSL - The handshake negotiation failed" \ |
| 6504 | -S "SSL - Unknown identity received" \ |
| 6505 | -S "SSL - Verification of the message MAC failed" |
| 6506 | |
| 6507 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6508 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6509 | run_test "PSK callback: opaque rsa-psk on client, no callback, EMS" \ |
| 6510 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 6511 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 6512 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 6513 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 6514 | -c "session hash for extended master secret"\ |
| 6515 | -s "session hash for extended master secret"\ |
| 6516 | -S "SSL - The handshake negotiation failed" \ |
| 6517 | -S "SSL - Unknown identity received" \ |
| 6518 | -S "SSL - Verification of the message MAC failed" |
| 6519 | |
| 6520 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6521 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6522 | run_test "PSK callback: opaque rsa-psk on client, no callback, SHA-384, EMS" \ |
| 6523 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 6524 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 6525 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 6526 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 6527 | -c "session hash for extended master secret"\ |
| 6528 | -s "session hash for extended master secret"\ |
| 6529 | -S "SSL - The handshake negotiation failed" \ |
| 6530 | -S "SSL - Unknown identity received" \ |
| 6531 | -S "SSL - Verification of the message MAC failed" |
| 6532 | |
| 6533 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6534 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 6535 | run_test "PSK callback: opaque ecdhe-psk on client, no callback" \ |
| 6536 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 6537 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 6538 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 6539 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 6540 | -C "session hash for extended master secret"\ |
| 6541 | -S "session hash for extended master secret"\ |
| 6542 | -S "SSL - The handshake negotiation failed" \ |
| 6543 | -S "SSL - Unknown identity received" \ |
| 6544 | -S "SSL - Verification of the message MAC failed" |
| 6545 | |
| 6546 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6547 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6548 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384" \ |
| 6549 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 6550 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 6551 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 6552 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 6553 | -C "session hash for extended master secret"\ |
| 6554 | -S "session hash for extended master secret"\ |
| 6555 | -S "SSL - The handshake negotiation failed" \ |
| 6556 | -S "SSL - Unknown identity received" \ |
| 6557 | -S "SSL - Verification of the message MAC failed" |
| 6558 | |
| 6559 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6560 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6561 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, EMS" \ |
| 6562 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 6563 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 6564 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 6565 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 6566 | -c "session hash for extended master secret"\ |
| 6567 | -s "session hash for extended master secret"\ |
| 6568 | -S "SSL - The handshake negotiation failed" \ |
| 6569 | -S "SSL - Unknown identity received" \ |
| 6570 | -S "SSL - Verification of the message MAC failed" |
| 6571 | |
| 6572 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6573 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6574 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384, EMS" \ |
| 6575 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 6576 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 6577 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 6578 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 6579 | -c "session hash for extended master secret"\ |
| 6580 | -s "session hash for extended master secret"\ |
| 6581 | -S "SSL - The handshake negotiation failed" \ |
| 6582 | -S "SSL - Unknown identity received" \ |
| 6583 | -S "SSL - Verification of the message MAC failed" |
| 6584 | |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 6585 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6586 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6587 | run_test "PSK callback: opaque dhe-psk on client, no callback" \ |
| 6588 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 6589 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 6590 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 6591 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 6592 | -C "session hash for extended master secret"\ |
| 6593 | -S "session hash for extended master secret"\ |
| 6594 | -S "SSL - The handshake negotiation failed" \ |
| 6595 | -S "SSL - Unknown identity received" \ |
| 6596 | -S "SSL - Verification of the message MAC failed" |
| 6597 | |
| 6598 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6599 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6600 | run_test "PSK callback: opaque dhe-psk on client, no callback, SHA-384" \ |
| 6601 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 6602 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 6603 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 6604 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 6605 | -C "session hash for extended master secret"\ |
| 6606 | -S "session hash for extended master secret"\ |
| 6607 | -S "SSL - The handshake negotiation failed" \ |
| 6608 | -S "SSL - Unknown identity received" \ |
| 6609 | -S "SSL - Verification of the message MAC failed" |
| 6610 | |
| 6611 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6612 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6613 | run_test "PSK callback: opaque dhe-psk on client, no callback, EMS" \ |
| 6614 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 6615 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 6616 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 6617 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 6618 | -c "session hash for extended master secret"\ |
| 6619 | -s "session hash for extended master secret"\ |
| 6620 | -S "SSL - The handshake negotiation failed" \ |
| 6621 | -S "SSL - Unknown identity received" \ |
| 6622 | -S "SSL - Verification of the message MAC failed" |
| 6623 | |
| 6624 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6625 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6626 | run_test "PSK callback: opaque dhe-psk on client, no callback, SHA-384, EMS" \ |
| 6627 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 6628 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 6629 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 6630 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 6631 | -c "session hash for extended master secret"\ |
| 6632 | -s "session hash for extended master secret"\ |
| 6633 | -S "SSL - The handshake negotiation failed" \ |
| 6634 | -S "SSL - Unknown identity received" \ |
| 6635 | -S "SSL - Verification of the message MAC failed" |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 6636 | |
| 6637 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6638 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6639 | 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] | 6640 | "$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" \ |
| 6641 | "$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] | 6642 | psk_identity=foo psk=abc123" \ |
| 6643 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6644 | -C "session hash for extended master secret"\ |
| 6645 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6646 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6647 | -S "SSL - Unknown identity received" \ |
| 6648 | -S "SSL - Verification of the message MAC failed" |
| 6649 | |
| 6650 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6651 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6652 | 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] | 6653 | "$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" \ |
| 6654 | "$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] | 6655 | psk_identity=foo psk=abc123" \ |
| 6656 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6657 | -C "session hash for extended master secret"\ |
| 6658 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6659 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6660 | -S "SSL - Unknown identity received" \ |
| 6661 | -S "SSL - Verification of the message MAC failed" |
| 6662 | |
| 6663 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6664 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6665 | 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] | 6666 | "$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] | 6667 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6668 | "$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] | 6669 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 6670 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6671 | -c "session hash for extended master secret"\ |
| 6672 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6673 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6674 | -S "SSL - Unknown identity received" \ |
| 6675 | -S "SSL - Verification of the message MAC failed" |
| 6676 | |
| 6677 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6678 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6679 | 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] | 6680 | "$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] | 6681 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6682 | "$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] | 6683 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 6684 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6685 | -c "session hash for extended master secret"\ |
| 6686 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6687 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6688 | -S "SSL - Unknown identity received" \ |
| 6689 | -S "SSL - Verification of the message MAC failed" |
| 6690 | |
| 6691 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6692 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 6693 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback" \ |
| 6694 | "$P_SRV extended_ms=0 debug_level=5 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA" \ |
| 6695 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 6696 | psk_identity=foo psk=abc123" \ |
| 6697 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 6698 | -C "session hash for extended master secret"\ |
| 6699 | -S "session hash for extended master secret"\ |
| 6700 | -S "SSL - The handshake negotiation failed" \ |
| 6701 | -S "SSL - Unknown identity received" \ |
| 6702 | -S "SSL - Verification of the message MAC failed" |
| 6703 | |
| 6704 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6705 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6706 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, SHA-384" \ |
| 6707 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384" \ |
| 6708 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 6709 | psk_identity=foo psk=abc123" \ |
| 6710 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 6711 | -C "session hash for extended master secret"\ |
| 6712 | -S "session hash for extended master secret"\ |
| 6713 | -S "SSL - The handshake negotiation failed" \ |
| 6714 | -S "SSL - Unknown identity received" \ |
| 6715 | -S "SSL - Verification of the message MAC failed" |
| 6716 | |
| 6717 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6718 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6719 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS" \ |
| 6720 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 6721 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 6722 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 6723 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 6724 | 0 \ |
| 6725 | -c "session hash for extended master secret"\ |
| 6726 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 6727 | -S "SSL - The handshake negotiation failed" \ |
| 6728 | -S "SSL - Unknown identity received" \ |
| 6729 | -S "SSL - Verification of the message MAC failed" |
| 6730 | |
| 6731 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6732 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6733 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
| 6734 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 6735 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 6736 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 6737 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 6738 | 0 \ |
| 6739 | -c "session hash for extended master secret"\ |
| 6740 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 6741 | -S "SSL - The handshake negotiation failed" \ |
| 6742 | -S "SSL - Unknown identity received" \ |
| 6743 | -S "SSL - Verification of the message MAC failed" |
| 6744 | |
| 6745 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6746 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 6747 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback" \ |
| 6748 | "$P_SRV extended_ms=0 debug_level=5 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA" \ |
| 6749 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 6750 | psk_identity=foo psk=abc123" \ |
| 6751 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 6752 | -C "session hash for extended master secret"\ |
| 6753 | -S "session hash for extended master secret"\ |
| 6754 | -S "SSL - The handshake negotiation failed" \ |
| 6755 | -S "SSL - Unknown identity received" \ |
| 6756 | -S "SSL - Verification of the message MAC failed" |
| 6757 | |
| 6758 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6759 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6760 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, SHA-384" \ |
| 6761 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384" \ |
| 6762 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 6763 | psk_identity=foo psk=abc123" \ |
| 6764 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 6765 | -C "session hash for extended master secret"\ |
| 6766 | -S "session hash for extended master secret"\ |
| 6767 | -S "SSL - The handshake negotiation failed" \ |
| 6768 | -S "SSL - Unknown identity received" \ |
| 6769 | -S "SSL - Verification of the message MAC failed" |
| 6770 | |
| 6771 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6772 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6773 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS" \ |
| 6774 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 6775 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 6776 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 6777 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 6778 | 0 \ |
| 6779 | -c "session hash for extended master secret"\ |
| 6780 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 6781 | -S "SSL - The handshake negotiation failed" \ |
| 6782 | -S "SSL - Unknown identity received" \ |
| 6783 | -S "SSL - Verification of the message MAC failed" |
| 6784 | |
| 6785 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6786 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6787 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
| 6788 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 6789 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 6790 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 6791 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 6792 | 0 \ |
| 6793 | -c "session hash for extended master secret"\ |
| 6794 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 6795 | -S "SSL - The handshake negotiation failed" \ |
| 6796 | -S "SSL - Unknown identity received" \ |
| 6797 | -S "SSL - Verification of the message MAC failed" |
| 6798 | |
| 6799 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6800 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 6801 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback" \ |
| 6802 | "$P_SRV extended_ms=0 debug_level=5 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA" \ |
| 6803 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 6804 | psk_identity=foo psk=abc123" \ |
| 6805 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 6806 | -C "session hash for extended master secret"\ |
| 6807 | -S "session hash for extended master secret"\ |
| 6808 | -S "SSL - The handshake negotiation failed" \ |
| 6809 | -S "SSL - Unknown identity received" \ |
| 6810 | -S "SSL - Verification of the message MAC failed" |
| 6811 | |
| 6812 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6813 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6814 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, SHA-384" \ |
| 6815 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384" \ |
| 6816 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 6817 | psk_identity=foo psk=abc123" \ |
| 6818 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 6819 | -C "session hash for extended master secret"\ |
| 6820 | -S "session hash for extended master secret"\ |
| 6821 | -S "SSL - The handshake negotiation failed" \ |
| 6822 | -S "SSL - Unknown identity received" \ |
| 6823 | -S "SSL - Verification of the message MAC failed" |
| 6824 | |
| 6825 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6826 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6827 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS" \ |
| 6828 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 6829 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 6830 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 6831 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 6832 | 0 \ |
| 6833 | -c "session hash for extended master secret"\ |
| 6834 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 6835 | -S "SSL - The handshake negotiation failed" \ |
| 6836 | -S "SSL - Unknown identity received" \ |
| 6837 | -S "SSL - Verification of the message MAC failed" |
| 6838 | |
| 6839 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6840 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6841 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
| 6842 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 6843 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 6844 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 6845 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 6846 | 0 \ |
| 6847 | -c "session hash for extended master secret"\ |
| 6848 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 6849 | -S "SSL - The handshake negotiation failed" \ |
| 6850 | -S "SSL - Unknown identity received" \ |
| 6851 | -S "SSL - Verification of the message MAC failed" |
| 6852 | |
| 6853 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6854 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6855 | 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] | 6856 | "$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" \ |
| 6857 | "$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] | 6858 | psk_identity=def psk=beef" \ |
| 6859 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6860 | -C "session hash for extended master secret"\ |
| 6861 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6862 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6863 | -S "SSL - Unknown identity received" \ |
| 6864 | -S "SSL - Verification of the message MAC failed" |
| 6865 | |
| 6866 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6867 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6868 | 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] | 6869 | "$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" \ |
| 6870 | "$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] | 6871 | psk_identity=def psk=beef" \ |
| 6872 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6873 | -C "session hash for extended master secret"\ |
| 6874 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6875 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6876 | -S "SSL - Unknown identity received" \ |
| 6877 | -S "SSL - Verification of the message MAC failed" |
| 6878 | |
| 6879 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6880 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6881 | 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] | 6882 | "$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] | 6883 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6884 | "$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] | 6885 | psk_identity=abc psk=dead extended_ms=1" \ |
| 6886 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6887 | -c "session hash for extended master secret"\ |
| 6888 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6889 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6890 | -S "SSL - Unknown identity received" \ |
| 6891 | -S "SSL - Verification of the message MAC failed" |
| 6892 | |
| 6893 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6894 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6895 | 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] | 6896 | "$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] | 6897 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6898 | "$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] | 6899 | psk_identity=abc psk=dead extended_ms=1" \ |
| 6900 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6901 | -c "session hash for extended master secret"\ |
| 6902 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6903 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6904 | -S "SSL - Unknown identity received" \ |
| 6905 | -S "SSL - Verification of the message MAC failed" |
| 6906 | |
| 6907 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6908 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 6909 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback" \ |
| 6910 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA" \ |
| 6911 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 6912 | psk_identity=def psk=beef" \ |
| 6913 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 6914 | -C "session hash for extended master secret"\ |
| 6915 | -S "session hash for extended master secret"\ |
| 6916 | -S "SSL - The handshake negotiation failed" \ |
| 6917 | -S "SSL - Unknown identity received" \ |
| 6918 | -S "SSL - Verification of the message MAC failed" |
| 6919 | |
| 6920 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6921 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6922 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, SHA-384" \ |
| 6923 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384" \ |
| 6924 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 6925 | psk_identity=def psk=beef" \ |
| 6926 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 6927 | -C "session hash for extended master secret"\ |
| 6928 | -S "session hash for extended master secret"\ |
| 6929 | -S "SSL - The handshake negotiation failed" \ |
| 6930 | -S "SSL - Unknown identity received" \ |
| 6931 | -S "SSL - Verification of the message MAC failed" |
| 6932 | |
| 6933 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6934 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6935 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS" \ |
| 6936 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 6937 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 6938 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 6939 | psk_identity=abc psk=dead extended_ms=1" \ |
| 6940 | 0 \ |
| 6941 | -c "session hash for extended master secret"\ |
| 6942 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 6943 | -S "SSL - The handshake negotiation failed" \ |
| 6944 | -S "SSL - Unknown identity received" \ |
| 6945 | -S "SSL - Verification of the message MAC failed" |
| 6946 | |
| 6947 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6948 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6949 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS, SHA384" \ |
| 6950 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 6951 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 6952 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 6953 | psk_identity=abc psk=dead extended_ms=1" \ |
| 6954 | 0 \ |
| 6955 | -c "session hash for extended master secret"\ |
| 6956 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 6957 | -S "SSL - The handshake negotiation failed" \ |
| 6958 | -S "SSL - Unknown identity received" \ |
| 6959 | -S "SSL - Verification of the message MAC failed" |
| 6960 | |
| 6961 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6962 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 6963 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback" \ |
| 6964 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA" \ |
| 6965 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 6966 | psk_identity=def psk=beef" \ |
| 6967 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 6968 | -C "session hash for extended master secret"\ |
| 6969 | -S "session hash for extended master secret"\ |
| 6970 | -S "SSL - The handshake negotiation failed" \ |
| 6971 | -S "SSL - Unknown identity received" \ |
| 6972 | -S "SSL - Verification of the message MAC failed" |
| 6973 | |
| 6974 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6975 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6976 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, SHA-384" \ |
| 6977 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384" \ |
| 6978 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 6979 | psk_identity=def psk=beef" \ |
| 6980 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 6981 | -C "session hash for extended master secret"\ |
| 6982 | -S "session hash for extended master secret"\ |
| 6983 | -S "SSL - The handshake negotiation failed" \ |
| 6984 | -S "SSL - Unknown identity received" \ |
| 6985 | -S "SSL - Verification of the message MAC failed" |
| 6986 | |
| 6987 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6988 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6989 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS" \ |
| 6990 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 6991 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 6992 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 6993 | psk_identity=abc psk=dead extended_ms=1" \ |
| 6994 | 0 \ |
| 6995 | -c "session hash for extended master secret"\ |
| 6996 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 6997 | -S "SSL - The handshake negotiation failed" \ |
| 6998 | -S "SSL - Unknown identity received" \ |
| 6999 | -S "SSL - Verification of the message MAC failed" |
| 7000 | |
| 7001 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7002 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7003 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS, SHA384" \ |
| 7004 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7005 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7006 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7007 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7008 | 0 \ |
| 7009 | -c "session hash for extended master secret"\ |
| 7010 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7011 | -S "SSL - The handshake negotiation failed" \ |
| 7012 | -S "SSL - Unknown identity received" \ |
| 7013 | -S "SSL - Verification of the message MAC failed" |
| 7014 | |
| 7015 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7016 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7017 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback" \ |
| 7018 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA" \ |
| 7019 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7020 | psk_identity=def psk=beef" \ |
| 7021 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7022 | -C "session hash for extended master secret"\ |
| 7023 | -S "session hash for extended master secret"\ |
| 7024 | -S "SSL - The handshake negotiation failed" \ |
| 7025 | -S "SSL - Unknown identity received" \ |
| 7026 | -S "SSL - Verification of the message MAC failed" |
| 7027 | |
| 7028 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7029 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7030 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, SHA-384" \ |
| 7031 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384" \ |
| 7032 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7033 | psk_identity=def psk=beef" \ |
| 7034 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7035 | -C "session hash for extended master secret"\ |
| 7036 | -S "session hash for extended master secret"\ |
| 7037 | -S "SSL - The handshake negotiation failed" \ |
| 7038 | -S "SSL - Unknown identity received" \ |
| 7039 | -S "SSL - Verification of the message MAC failed" |
| 7040 | |
| 7041 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7042 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7043 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS" \ |
| 7044 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7045 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7046 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7047 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7048 | 0 \ |
| 7049 | -c "session hash for extended master secret"\ |
| 7050 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7051 | -S "SSL - The handshake negotiation failed" \ |
| 7052 | -S "SSL - Unknown identity received" \ |
| 7053 | -S "SSL - Verification of the message MAC failed" |
| 7054 | |
| 7055 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7056 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7057 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS, SHA384" \ |
| 7058 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7059 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7060 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7061 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7062 | 0 \ |
| 7063 | -c "session hash for extended master secret"\ |
| 7064 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7065 | -S "SSL - The handshake negotiation failed" \ |
| 7066 | -S "SSL - Unknown identity received" \ |
| 7067 | -S "SSL - Verification of the message MAC failed" |
| 7068 | |
| 7069 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7070 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7071 | 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] | 7072 | "$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" \ |
| 7073 | "$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] | 7074 | psk_identity=def psk=beef" \ |
| 7075 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7076 | -C "session hash for extended master secret"\ |
| 7077 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7078 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7079 | -S "SSL - Unknown identity received" \ |
| 7080 | -S "SSL - Verification of the message MAC failed" |
| 7081 | |
| 7082 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7083 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7084 | 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] | 7085 | "$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" \ |
| 7086 | "$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] | 7087 | psk_identity=def psk=beef" \ |
| 7088 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7089 | -C "session hash for extended master secret"\ |
| 7090 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7091 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7092 | -S "SSL - Unknown identity received" \ |
| 7093 | -S "SSL - Verification of the message MAC failed" |
| 7094 | |
| 7095 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7096 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7097 | 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] | 7098 | "$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" \ |
| 7099 | "$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] | 7100 | psk_identity=def psk=beef" \ |
| 7101 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7102 | -C "session hash for extended master secret"\ |
| 7103 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7104 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7105 | -S "SSL - Unknown identity received" \ |
| 7106 | -S "SSL - Verification of the message MAC failed" |
| 7107 | |
| 7108 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7109 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7110 | 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] | 7111 | "$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" \ |
| 7112 | "$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] | 7113 | psk_identity=def psk=beef" \ |
| 7114 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7115 | -C "session hash for extended master secret"\ |
| 7116 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7117 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7118 | -S "SSL - Unknown identity received" \ |
| 7119 | -S "SSL - Verification of the message MAC failed" |
| 7120 | |
| 7121 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7122 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7123 | 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] | 7124 | "$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" \ |
| 7125 | "$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] | 7126 | psk_identity=def psk=beef" \ |
| 7127 | 1 \ |
| 7128 | -s "SSL - Verification of the message MAC failed" |
| 7129 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7130 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7131 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 7132 | "$P_SRV" \ |
| 7133 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7134 | psk_identity=foo psk=abc123" \ |
| 7135 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 7136 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7137 | -S "SSL - Unknown identity received" \ |
| 7138 | -S "SSL - Verification of the message MAC failed" |
| 7139 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7140 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7141 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7142 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 7143 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7144 | psk_identity=foo psk=abc123" \ |
| 7145 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7146 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7147 | -s "SSL - Unknown identity received" \ |
| 7148 | -S "SSL - Verification of the message MAC failed" |
| 7149 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7150 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7151 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7152 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7153 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7154 | psk_identity=abc psk=dead" \ |
| 7155 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7156 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7157 | -S "SSL - Unknown identity received" \ |
| 7158 | -S "SSL - Verification of the message MAC failed" |
| 7159 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7160 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7161 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7162 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7163 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7164 | psk_identity=def psk=beef" \ |
| 7165 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7166 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7167 | -S "SSL - Unknown identity received" \ |
| 7168 | -S "SSL - Verification of the message MAC failed" |
| 7169 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7170 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7171 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7172 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7173 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7174 | psk_identity=ghi psk=beef" \ |
| 7175 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7176 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7177 | -s "SSL - Unknown identity received" \ |
| 7178 | -S "SSL - Verification of the message MAC failed" |
| 7179 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7180 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7181 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7182 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7183 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7184 | psk_identity=abc psk=beef" \ |
| 7185 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7186 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7187 | -S "SSL - Unknown identity received" \ |
| 7188 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7189 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7190 | # Tests for EC J-PAKE |
| 7191 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 7192 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7193 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7194 | run_test "ECJPAKE: client not configured" \ |
| 7195 | "$P_SRV debug_level=3" \ |
| 7196 | "$P_CLI debug_level=3" \ |
| 7197 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 7198 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7199 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7200 | -S "found ecjpake kkpp extension" \ |
| 7201 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7202 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 7203 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 7204 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 7205 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7206 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 7207 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7208 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7209 | run_test "ECJPAKE: server not configured" \ |
| 7210 | "$P_SRV debug_level=3" \ |
| 7211 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 7212 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7213 | 1 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 7214 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7215 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7216 | -s "found ecjpake kkpp extension" \ |
| 7217 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7218 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 7219 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 7220 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 7221 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7222 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 7223 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7224 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7225 | run_test "ECJPAKE: working, TLS" \ |
| 7226 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 7227 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 7228 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 7229 | 0 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 7230 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7231 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 7232 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7233 | -s "found ecjpake kkpp extension" \ |
| 7234 | -S "skip ecjpake kkpp extension" \ |
| 7235 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 7236 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 7237 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 7238 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7239 | -S "SSL - Verification of the message MAC failed" |
| 7240 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7241 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7242 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7243 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7244 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 7245 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 7246 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 7247 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7248 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 7249 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7250 | -s "SSL - Verification of the message MAC failed" |
| 7251 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7252 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7253 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7254 | run_test "ECJPAKE: working, DTLS" \ |
| 7255 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 7256 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 7257 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7258 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 7259 | -c "re-using cached ecjpake parameters" \ |
| 7260 | -S "SSL - Verification of the message MAC failed" |
| 7261 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7262 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7263 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 7264 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 7265 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 7266 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 7267 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7268 | 0 \ |
| 7269 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7270 | -S "SSL - Verification of the message MAC failed" |
| 7271 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7272 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7273 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7274 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7275 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 7276 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 7277 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 7278 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7279 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 7280 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7281 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7282 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 7283 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7284 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7285 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 7286 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 7287 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 7288 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 7289 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7290 | 0 |
| 7291 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 7292 | # Test for ClientHello without extensions |
| 7293 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 7294 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7295 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 7296 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 7297 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7298 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 7299 | 0 \ |
| 7300 | -s "dumping 'client hello extensions' (0 bytes)" |
| 7301 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7302 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 7303 | |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 7304 | # The server first reads buffer_size-1 bytes, then reads the remainder. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7305 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7306 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 7307 | "$P_SRV buffer_size=100" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 7308 | "$P_CLI request_size=100" \ |
| 7309 | 0 \ |
| 7310 | -s "Read from client: 100 bytes read$" |
| 7311 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7312 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 7313 | run_test "mbedtls_ssl_get_bytes_avail: extra data (+1)" \ |
| 7314 | "$P_SRV buffer_size=100" \ |
| 7315 | "$P_CLI request_size=101" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 7316 | 0 \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 7317 | -s "Read from client: 101 bytes read (100 + 1)" |
| 7318 | |
| 7319 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7320 | requires_max_content_len 200 |
| 7321 | run_test "mbedtls_ssl_get_bytes_avail: extra data (*2)" \ |
| 7322 | "$P_SRV buffer_size=100" \ |
| 7323 | "$P_CLI request_size=200" \ |
| 7324 | 0 \ |
| 7325 | -s "Read from client: 200 bytes read (100 + 100)" |
| 7326 | |
| 7327 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7328 | run_test "mbedtls_ssl_get_bytes_avail: extra data (max)" \ |
| 7329 | "$P_SRV buffer_size=100" \ |
| 7330 | "$P_CLI request_size=$MAX_CONTENT_LEN" \ |
| 7331 | 0 \ |
| 7332 | -s "Read from client: $MAX_CONTENT_LEN bytes read (100 + $((MAX_CONTENT_LEN - 100)))" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 7333 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7334 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 7335 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7336 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7337 | "$P_SRV force_version=tls12" \ |
| 7338 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 7339 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7340 | 0 \ |
| 7341 | -s "Read from client: 1 bytes read" |
| 7342 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7343 | run_test "Small client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7344 | "$P_SRV force_version=tls12" \ |
| 7345 | "$P_CLI request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7346 | 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] | 7347 | 0 \ |
| 7348 | -s "Read from client: 1 bytes read" |
| 7349 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7350 | run_test "Small client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7351 | "$P_SRV force_version=tls12" \ |
| 7352 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 7353 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 7354 | 0 \ |
| 7355 | -s "Read from client: 1 bytes read" |
| 7356 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7357 | run_test "Small client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7358 | "$P_SRV force_version=tls12" \ |
| 7359 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 7360 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 7361 | 0 \ |
| 7362 | -s "Read from client: 1 bytes read" |
| 7363 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7364 | run_test "Small client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7365 | "$P_SRV force_version=tls12" \ |
| 7366 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 7367 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 7368 | 0 \ |
| 7369 | -s "Read from client: 1 bytes read" |
| 7370 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7371 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 7372 | |
| 7373 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7374 | run_test "Small client packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7375 | "$P_SRV dtls=1 force_version=dtls12" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 7376 | "$P_CLI dtls=1 request_size=1 \ |
| 7377 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7378 | 0 \ |
| 7379 | -s "Read from client: 1 bytes read" |
| 7380 | |
| 7381 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7382 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7383 | "$P_SRV dtls=1 force_version=dtls12 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 7384 | "$P_CLI dtls=1 request_size=1 \ |
| 7385 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7386 | 0 \ |
| 7387 | -s "Read from client: 1 bytes read" |
| 7388 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7389 | # Tests for small server packets |
| 7390 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7391 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7392 | "$P_SRV response_size=1 force_version=tls12" \ |
| 7393 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7394 | 0 \ |
| 7395 | -c "Read from server: 1 bytes read" |
| 7396 | |
| 7397 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7398 | "$P_SRV response_size=1 force_version=tls12" \ |
| 7399 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7400 | 0 \ |
| 7401 | -c "Read from server: 1 bytes read" |
| 7402 | |
| 7403 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7404 | "$P_SRV response_size=1 force_version=tls12" \ |
| 7405 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7406 | 0 \ |
| 7407 | -c "Read from server: 1 bytes read" |
| 7408 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7409 | run_test "Small server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7410 | "$P_SRV response_size=1 force_version=tls12" \ |
| 7411 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7412 | 0 \ |
| 7413 | -c "Read from server: 1 bytes read" |
| 7414 | |
| 7415 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7416 | "$P_SRV response_size=1 force_version=tls12" \ |
| 7417 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7418 | 0 \ |
| 7419 | -c "Read from server: 1 bytes read" |
| 7420 | |
| 7421 | # Tests for small server packets in DTLS |
| 7422 | |
| 7423 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7424 | run_test "Small server packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7425 | "$P_SRV dtls=1 response_size=1 force_version=dtls12" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7426 | "$P_CLI dtls=1 \ |
| 7427 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7428 | 0 \ |
| 7429 | -c "Read from server: 1 bytes read" |
| 7430 | |
| 7431 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7432 | run_test "Small server packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7433 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7434 | "$P_CLI dtls=1 \ |
| 7435 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7436 | 0 \ |
| 7437 | -c "Read from server: 1 bytes read" |
| 7438 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7439 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7440 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7441 | # How many fragments do we expect to write $1 bytes? |
| 7442 | fragments_for_write() { |
| 7443 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 7444 | } |
| 7445 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7446 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7447 | "$P_SRV force_version=tls12" \ |
| 7448 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7449 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7450 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7451 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7452 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7453 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7454 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7455 | "$P_SRV force_version=tls12" \ |
| 7456 | "$P_CLI request_size=16384 etm=0 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7457 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7458 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7459 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7460 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7461 | run_test "Large client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7462 | "$P_SRV force_version=tls12" \ |
| 7463 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 7464 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7465 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7466 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7467 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7468 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7469 | run_test "Large client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7470 | "$P_SRV force_version=tls12" \ |
| 7471 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7472 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 7473 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7474 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7475 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7476 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7477 | run_test "Large client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7478 | "$P_SRV force_version=tls12" \ |
| 7479 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7480 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 7481 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7482 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7483 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7484 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7485 | # The tests below fail when the server's OUT_CONTENT_LEN is less than 16384. |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7486 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7487 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 7488 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7489 | 0 \ |
| 7490 | -c "Read from server: 16384 bytes read" |
| 7491 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7492 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7493 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 7494 | "$P_CLI etm=0 force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7495 | 0 \ |
| 7496 | -s "16384 bytes written in 1 fragments" \ |
| 7497 | -c "Read from server: 16384 bytes read" |
| 7498 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7499 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7500 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 7501 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7502 | 0 \ |
| 7503 | -c "Read from server: 16384 bytes read" |
| 7504 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7505 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7506 | "$P_SRV response_size=16384 trunc_hmac=1 force_version=tls12" \ |
| 7507 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7508 | 0 \ |
| 7509 | -s "16384 bytes written in 1 fragments" \ |
| 7510 | -c "Read from server: 16384 bytes read" |
| 7511 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7512 | run_test "Large server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7513 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 7514 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7515 | 0 \ |
| 7516 | -c "Read from server: 16384 bytes read" |
| 7517 | |
| 7518 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7519 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 7520 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7521 | 0 \ |
| 7522 | -c "Read from server: 16384 bytes read" |
| 7523 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7524 | # Tests for restartable ECC |
| 7525 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7526 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 7527 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7528 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7529 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7530 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7531 | run_test "EC restart: TLS, default" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7532 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7533 | "$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] | 7534 | 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] | 7535 | debug_level=1" \ |
| 7536 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7537 | -C "x509_verify_cert.*4b00" \ |
| 7538 | -C "mbedtls_pk_verify.*4b00" \ |
| 7539 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7540 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7541 | |
| 7542 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7543 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
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 | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7545 | run_test "EC restart: TLS, max_ops=0" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7546 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7547 | "$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] | 7548 | 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] | 7549 | debug_level=1 ec_max_ops=0" \ |
| 7550 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7551 | -C "x509_verify_cert.*4b00" \ |
| 7552 | -C "mbedtls_pk_verify.*4b00" \ |
| 7553 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7554 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7555 | |
| 7556 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7557 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7558 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7559 | run_test "EC restart: TLS, max_ops=65535" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7560 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7561 | "$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] | 7562 | 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] | 7563 | debug_level=1 ec_max_ops=65535" \ |
| 7564 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7565 | -C "x509_verify_cert.*4b00" \ |
| 7566 | -C "mbedtls_pk_verify.*4b00" \ |
| 7567 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7568 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7569 | |
| 7570 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7571 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7572 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7573 | run_test "EC restart: TLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7574 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7575 | "$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] | 7576 | 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] | 7577 | debug_level=1 ec_max_ops=1000" \ |
| 7578 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7579 | -c "x509_verify_cert.*4b00" \ |
| 7580 | -c "mbedtls_pk_verify.*4b00" \ |
| 7581 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7582 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7583 | |
| 7584 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7585 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7586 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7587 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7588 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7589 | crt_file=data_files/server5-badsign.crt \ |
| 7590 | key_file=data_files/server5.key" \ |
| 7591 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7592 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7593 | debug_level=1 ec_max_ops=1000" \ |
| 7594 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7595 | -c "x509_verify_cert.*4b00" \ |
| 7596 | -C "mbedtls_pk_verify.*4b00" \ |
| 7597 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7598 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7599 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 7600 | -c "! mbedtls_ssl_handshake returned" \ |
| 7601 | -c "X509 - Certificate verification failed" |
| 7602 | |
| 7603 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7604 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7605 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7606 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7607 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7608 | crt_file=data_files/server5-badsign.crt \ |
| 7609 | key_file=data_files/server5.key" \ |
| 7610 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7611 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7612 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 7613 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7614 | -c "x509_verify_cert.*4b00" \ |
| 7615 | -c "mbedtls_pk_verify.*4b00" \ |
| 7616 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7617 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7618 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 7619 | -C "! mbedtls_ssl_handshake returned" \ |
| 7620 | -C "X509 - Certificate verification failed" |
| 7621 | |
| 7622 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7623 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7624 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7625 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7626 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7627 | crt_file=data_files/server5-badsign.crt \ |
| 7628 | key_file=data_files/server5.key" \ |
| 7629 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7630 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7631 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 7632 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7633 | -C "x509_verify_cert.*4b00" \ |
| 7634 | -c "mbedtls_pk_verify.*4b00" \ |
| 7635 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7636 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7637 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 7638 | -C "! mbedtls_ssl_handshake returned" \ |
| 7639 | -C "X509 - Certificate verification failed" |
| 7640 | |
| 7641 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7642 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7643 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7644 | run_test "EC restart: DTLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7645 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7646 | "$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] | 7647 | 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] | 7648 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 7649 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7650 | -c "x509_verify_cert.*4b00" \ |
| 7651 | -c "mbedtls_pk_verify.*4b00" \ |
| 7652 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7653 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7654 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7655 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7656 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7657 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7658 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7659 | "$P_SRV curves=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7660 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7661 | debug_level=1 ec_max_ops=1000" \ |
| 7662 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7663 | -c "x509_verify_cert.*4b00" \ |
| 7664 | -c "mbedtls_pk_verify.*4b00" \ |
| 7665 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7666 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7667 | |
| 7668 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7669 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7670 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7671 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 7672 | "$P_SRV curves=secp256r1 psk=abc123" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7673 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7674 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 7675 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7676 | -C "x509_verify_cert.*4b00" \ |
| 7677 | -C "mbedtls_pk_verify.*4b00" \ |
| 7678 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7679 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7680 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7681 | # Tests of asynchronous private key support in SSL |
| 7682 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7683 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7684 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7685 | run_test "SSL async private: sign, delay=0" \ |
| 7686 | "$P_SRV \ |
| 7687 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7688 | "$P_CLI" \ |
| 7689 | 0 \ |
| 7690 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7691 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7692 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7693 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7694 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7695 | run_test "SSL async private: sign, delay=1" \ |
| 7696 | "$P_SRV \ |
| 7697 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7698 | "$P_CLI" \ |
| 7699 | 0 \ |
| 7700 | -s "Async sign callback: using key slot " \ |
| 7701 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7702 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7703 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 7704 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7705 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 7706 | run_test "SSL async private: sign, delay=2" \ |
| 7707 | "$P_SRV \ |
| 7708 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 7709 | "$P_CLI" \ |
| 7710 | 0 \ |
| 7711 | -s "Async sign callback: using key slot " \ |
| 7712 | -U "Async sign callback: using key slot " \ |
| 7713 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 7714 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7715 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7716 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7717 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 7718 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7719 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 7720 | run_test "SSL async private: sign, SNI" \ |
| 7721 | "$P_SRV debug_level=3 \ |
| 7722 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 7723 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 7724 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 7725 | "$P_CLI server_name=polarssl.example" \ |
| 7726 | 0 \ |
| 7727 | -s "Async sign callback: using key slot " \ |
| 7728 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 7729 | -s "parse ServerName extension" \ |
| 7730 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 7731 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 7732 | |
| 7733 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7734 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7735 | run_test "SSL async private: decrypt, delay=0" \ |
| 7736 | "$P_SRV \ |
| 7737 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 7738 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7739 | 0 \ |
| 7740 | -s "Async decrypt callback: using key slot " \ |
| 7741 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7742 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7743 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7744 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7745 | run_test "SSL async private: decrypt, delay=1" \ |
| 7746 | "$P_SRV \ |
| 7747 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7748 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7749 | 0 \ |
| 7750 | -s "Async decrypt callback: using key slot " \ |
| 7751 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7752 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7753 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7754 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7755 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7756 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 7757 | "$P_SRV psk=abc123 \ |
| 7758 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 7759 | "$P_CLI psk=abc123 \ |
| 7760 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 7761 | 0 \ |
| 7762 | -s "Async decrypt callback: using key slot " \ |
| 7763 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7764 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7765 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7766 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7767 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 7768 | "$P_SRV psk=abc123 \ |
| 7769 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7770 | "$P_CLI psk=abc123 \ |
| 7771 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 7772 | 0 \ |
| 7773 | -s "Async decrypt callback: using key slot " \ |
| 7774 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7775 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7776 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7777 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7778 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7779 | run_test "SSL async private: sign callback not present" \ |
| 7780 | "$P_SRV \ |
| 7781 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7782 | "$P_CLI; [ \$? -eq 1 ] && |
| 7783 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7784 | 0 \ |
| 7785 | -S "Async sign callback" \ |
| 7786 | -s "! mbedtls_ssl_handshake returned" \ |
| 7787 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 7788 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 7789 | -s "Successful connection" |
| 7790 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7791 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7792 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7793 | run_test "SSL async private: decrypt callback not present" \ |
| 7794 | "$P_SRV debug_level=1 \ |
| 7795 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 7796 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 7797 | [ \$? -eq 1 ] && $P_CLI" \ |
| 7798 | 0 \ |
| 7799 | -S "Async decrypt callback" \ |
| 7800 | -s "! mbedtls_ssl_handshake returned" \ |
| 7801 | -s "got no RSA private key" \ |
| 7802 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 7803 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7804 | |
| 7805 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7806 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7807 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7808 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7809 | "$P_SRV \ |
| 7810 | async_operations=s async_private_delay1=1 \ |
| 7811 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7812 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7813 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7814 | 0 \ |
| 7815 | -s "Async sign callback: using key slot 0," \ |
| 7816 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7817 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7818 | |
| 7819 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7820 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7821 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7822 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7823 | "$P_SRV \ |
| 7824 | async_operations=s async_private_delay2=1 \ |
| 7825 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7826 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7827 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7828 | 0 \ |
| 7829 | -s "Async sign callback: using key slot 0," \ |
| 7830 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7831 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7832 | |
| 7833 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7834 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7835 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 7836 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7837 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 7838 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7839 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7840 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7841 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7842 | 0 \ |
| 7843 | -s "Async sign callback: using key slot 1," \ |
| 7844 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7845 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7846 | |
| 7847 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7848 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7849 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7850 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7851 | "$P_SRV \ |
| 7852 | async_operations=s async_private_delay1=1 \ |
| 7853 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7854 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7855 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7856 | 0 \ |
| 7857 | -s "Async sign callback: no key matches this certificate." |
| 7858 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7859 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7860 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7861 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7862 | "$P_SRV \ |
| 7863 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7864 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7865 | "$P_CLI" \ |
| 7866 | 1 \ |
| 7867 | -s "Async sign callback: injected error" \ |
| 7868 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 7869 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7870 | -s "! mbedtls_ssl_handshake returned" |
| 7871 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7872 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7873 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7874 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7875 | "$P_SRV \ |
| 7876 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7877 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7878 | "$P_CLI" \ |
| 7879 | 1 \ |
| 7880 | -s "Async sign callback: using key slot " \ |
| 7881 | -S "Async resume" \ |
| 7882 | -s "Async cancel" |
| 7883 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7884 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7885 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7886 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7887 | "$P_SRV \ |
| 7888 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7889 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7890 | "$P_CLI" \ |
| 7891 | 1 \ |
| 7892 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7893 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 7894 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7895 | -s "! mbedtls_ssl_handshake returned" |
| 7896 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7897 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7898 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7899 | run_test "SSL async private: decrypt, error in start" \ |
| 7900 | "$P_SRV \ |
| 7901 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7902 | async_private_error=1" \ |
| 7903 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7904 | 1 \ |
| 7905 | -s "Async decrypt callback: injected error" \ |
| 7906 | -S "Async resume" \ |
| 7907 | -S "Async cancel" \ |
| 7908 | -s "! mbedtls_ssl_handshake returned" |
| 7909 | |
| 7910 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7911 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7912 | run_test "SSL async private: decrypt, cancel after start" \ |
| 7913 | "$P_SRV \ |
| 7914 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7915 | async_private_error=2" \ |
| 7916 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7917 | 1 \ |
| 7918 | -s "Async decrypt callback: using key slot " \ |
| 7919 | -S "Async resume" \ |
| 7920 | -s "Async cancel" |
| 7921 | |
| 7922 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7923 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7924 | run_test "SSL async private: decrypt, error in resume" \ |
| 7925 | "$P_SRV \ |
| 7926 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7927 | async_private_error=3" \ |
| 7928 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7929 | 1 \ |
| 7930 | -s "Async decrypt callback: using key slot " \ |
| 7931 | -s "Async resume callback: decrypt done but injected error" \ |
| 7932 | -S "Async cancel" \ |
| 7933 | -s "! mbedtls_ssl_handshake returned" |
| 7934 | |
| 7935 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7936 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7937 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7938 | "$P_SRV \ |
| 7939 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7940 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7941 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 7942 | 0 \ |
| 7943 | -s "Async cancel" \ |
| 7944 | -s "! mbedtls_ssl_handshake returned" \ |
| 7945 | -s "Async resume" \ |
| 7946 | -s "Successful connection" |
| 7947 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7948 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7949 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7950 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7951 | "$P_SRV \ |
| 7952 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7953 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7954 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 7955 | 0 \ |
| 7956 | -s "! mbedtls_ssl_handshake returned" \ |
| 7957 | -s "Async resume" \ |
| 7958 | -s "Successful connection" |
| 7959 | |
| 7960 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7961 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7962 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7963 | 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] | 7964 | "$P_SRV \ |
| 7965 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 7966 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7967 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7968 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 7969 | [ \$? -eq 1 ] && |
| 7970 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7971 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 7972 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7973 | -S "Async resume" \ |
| 7974 | -s "Async cancel" \ |
| 7975 | -s "! mbedtls_ssl_handshake returned" \ |
| 7976 | -s "Async sign callback: no key matches this certificate." \ |
| 7977 | -s "Successful connection" |
| 7978 | |
| 7979 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7980 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7981 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7982 | 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] | 7983 | "$P_SRV \ |
| 7984 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 7985 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7986 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7987 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 7988 | [ \$? -eq 1 ] && |
| 7989 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7990 | 0 \ |
| 7991 | -s "Async resume" \ |
| 7992 | -s "! mbedtls_ssl_handshake returned" \ |
| 7993 | -s "Async sign callback: no key matches this certificate." \ |
| 7994 | -s "Successful connection" |
| 7995 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7996 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7997 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7998 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7999 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8000 | "$P_SRV \ |
| 8001 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8002 | exchanges=2 renegotiation=1" \ |
| 8003 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 8004 | 0 \ |
| 8005 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8006 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8007 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8008 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8009 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8010 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8011 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8012 | "$P_SRV \ |
| 8013 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8014 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 8015 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 8016 | 0 \ |
| 8017 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8018 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 8019 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8020 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8021 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8022 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8023 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8024 | "$P_SRV \ |
| 8025 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8026 | exchanges=2 renegotiation=1" \ |
| 8027 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 8028 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8029 | 0 \ |
| 8030 | -s "Async decrypt callback: using key slot " \ |
| 8031 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8032 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8033 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8034 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8035 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8036 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8037 | "$P_SRV \ |
| 8038 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8039 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 8040 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 8041 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8042 | 0 \ |
| 8043 | -s "Async decrypt callback: using key slot " \ |
| 8044 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8045 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8046 | # Tests for ECC extensions (rfc 4492) |
| 8047 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8048 | requires_config_enabled MBEDTLS_AES_C |
| 8049 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8050 | requires_config_enabled MBEDTLS_SHA256_C |
| 8051 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8052 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8053 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 8054 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8055 | "$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] | 8056 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 8057 | -C "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8058 | -C "client hello, adding supported_point_formats extension" \ |
| 8059 | -S "found supported elliptic curves extension" \ |
| 8060 | -S "found supported point formats extension" |
| 8061 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8062 | requires_config_enabled MBEDTLS_AES_C |
| 8063 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8064 | requires_config_enabled MBEDTLS_SHA256_C |
| 8065 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8066 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8067 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8068 | "$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] | 8069 | "$P_CLI debug_level=3" \ |
| 8070 | 0 \ |
| 8071 | -C "found supported_point_formats extension" \ |
| 8072 | -S "server hello, supported_point_formats extension" |
| 8073 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8074 | requires_config_enabled MBEDTLS_AES_C |
| 8075 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8076 | requires_config_enabled MBEDTLS_SHA256_C |
| 8077 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8078 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8079 | run_test "Force an ECC ciphersuite in the client side" \ |
| 8080 | "$P_SRV debug_level=3" \ |
| 8081 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 8082 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 8083 | -c "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8084 | -c "client hello, adding supported_point_formats extension" \ |
| 8085 | -s "found supported elliptic curves extension" \ |
| 8086 | -s "found supported point formats extension" |
| 8087 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8088 | requires_config_enabled MBEDTLS_AES_C |
| 8089 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8090 | requires_config_enabled MBEDTLS_SHA256_C |
| 8091 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8092 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8093 | run_test "Force an ECC ciphersuite in the server side" \ |
| 8094 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 8095 | "$P_CLI debug_level=3" \ |
| 8096 | 0 \ |
| 8097 | -c "found supported_point_formats extension" \ |
| 8098 | -s "server hello, supported_point_formats extension" |
| 8099 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8100 | # Tests for DTLS HelloVerifyRequest |
| 8101 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8102 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8103 | run_test "DTLS cookie: enabled" \ |
| 8104 | "$P_SRV dtls=1 debug_level=2" \ |
| 8105 | "$P_CLI dtls=1 debug_level=2" \ |
| 8106 | 0 \ |
| 8107 | -s "cookie verification failed" \ |
| 8108 | -s "cookie verification passed" \ |
| 8109 | -S "cookie verification skipped" \ |
| 8110 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8111 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8112 | -S "SSL - The requested feature is not available" |
| 8113 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8114 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8115 | run_test "DTLS cookie: disabled" \ |
| 8116 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 8117 | "$P_CLI dtls=1 debug_level=2" \ |
| 8118 | 0 \ |
| 8119 | -S "cookie verification failed" \ |
| 8120 | -S "cookie verification passed" \ |
| 8121 | -s "cookie verification skipped" \ |
| 8122 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8123 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8124 | -S "SSL - The requested feature is not available" |
| 8125 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8126 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8127 | run_test "DTLS cookie: default (failing)" \ |
| 8128 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 8129 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 8130 | 1 \ |
| 8131 | -s "cookie verification failed" \ |
| 8132 | -S "cookie verification passed" \ |
| 8133 | -S "cookie verification skipped" \ |
| 8134 | -C "received hello verify request" \ |
| 8135 | -S "hello verification requested" \ |
| 8136 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8137 | |
| 8138 | requires_ipv6 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8139 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8140 | run_test "DTLS cookie: enabled, IPv6" \ |
| 8141 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 8142 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 8143 | 0 \ |
| 8144 | -s "cookie verification failed" \ |
| 8145 | -s "cookie verification passed" \ |
| 8146 | -S "cookie verification skipped" \ |
| 8147 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8148 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8149 | -S "SSL - The requested feature is not available" |
| 8150 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8151 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 8152 | run_test "DTLS cookie: enabled, nbio" \ |
| 8153 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 8154 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 8155 | 0 \ |
| 8156 | -s "cookie verification failed" \ |
| 8157 | -s "cookie verification passed" \ |
| 8158 | -S "cookie verification skipped" \ |
| 8159 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8160 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 8161 | -S "SSL - The requested feature is not available" |
| 8162 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8163 | # Tests for client reconnecting from the same port with DTLS |
| 8164 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8165 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8166 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8167 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8168 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 8169 | "$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] | 8170 | 0 \ |
| 8171 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8172 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8173 | -S "Client initiated reconnection from same port" |
| 8174 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8175 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8176 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8177 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8178 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 8179 | "$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] | 8180 | 0 \ |
| 8181 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8182 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8183 | -s "Client initiated reconnection from same port" |
| 8184 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 8185 | 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] | 8186 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 8187 | 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] | 8188 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 8189 | "$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] | 8190 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8191 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8192 | -s "Client initiated reconnection from same port" |
| 8193 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 8194 | 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] | 8195 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 8196 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 8197 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 8198 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 8199 | 0 \ |
| 8200 | -S "The operation timed out" \ |
| 8201 | -s "Client initiated reconnection from same port" |
| 8202 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8203 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8204 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 8205 | "$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] | 8206 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 8207 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8208 | -s "The operation timed out" \ |
| 8209 | -S "Client initiated reconnection from same port" |
| 8210 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8211 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 8212 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 8213 | -p "$P_PXY inject_clihlo=1" \ |
| 8214 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 8215 | "$P_CLI dtls=1 exchanges=2" \ |
| 8216 | 0 \ |
| 8217 | -s "possible client reconnect from the same port" \ |
| 8218 | -S "Client initiated reconnection from same port" |
| 8219 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8220 | # Tests for various cases of client authentication with DTLS |
| 8221 | # (focused on handshake flows and message parsing) |
| 8222 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8223 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8224 | run_test "DTLS client auth: required" \ |
| 8225 | "$P_SRV dtls=1 auth_mode=required" \ |
| 8226 | "$P_CLI dtls=1" \ |
| 8227 | 0 \ |
| 8228 | -s "Verifying peer X.509 certificate... ok" |
| 8229 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8230 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8231 | run_test "DTLS client auth: optional, client has no cert" \ |
| 8232 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 8233 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 8234 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 8235 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8236 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8237 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 8238 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8239 | "$P_SRV dtls=1 auth_mode=none" \ |
| 8240 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 8241 | 0 \ |
| 8242 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 8243 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8244 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8245 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 8246 | run_test "DTLS wrong PSK: badmac alert" \ |
| 8247 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 8248 | "$P_CLI dtls=1 psk=abc124" \ |
| 8249 | 1 \ |
| 8250 | -s "SSL - Verification of the message MAC failed" \ |
| 8251 | -c "SSL - A fatal alert message was received from our peer" |
| 8252 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 8253 | # Tests for receiving fragmented handshake messages with DTLS |
| 8254 | |
| 8255 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8256 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 8257 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 8258 | "$G_SRV -u --mtu 2048 -a" \ |
| 8259 | "$P_CLI dtls=1 debug_level=2" \ |
| 8260 | 0 \ |
| 8261 | -C "found fragmented DTLS handshake message" \ |
| 8262 | -C "error" |
| 8263 | |
| 8264 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8265 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 8266 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 8267 | "$G_SRV -u --mtu 512" \ |
| 8268 | "$P_CLI dtls=1 debug_level=2" \ |
| 8269 | 0 \ |
| 8270 | -c "found fragmented DTLS handshake message" \ |
| 8271 | -C "error" |
| 8272 | |
| 8273 | requires_gnutls |
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 | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 8275 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 8276 | "$G_SRV -u --mtu 128" \ |
| 8277 | "$P_CLI dtls=1 debug_level=2" \ |
| 8278 | 0 \ |
| 8279 | -c "found fragmented DTLS handshake message" \ |
| 8280 | -C "error" |
| 8281 | |
| 8282 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8283 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 8284 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 8285 | "$G_SRV -u --mtu 128" \ |
| 8286 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 8287 | 0 \ |
| 8288 | -c "found fragmented DTLS handshake message" \ |
| 8289 | -C "error" |
| 8290 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8291 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8292 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8293 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8294 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 8295 | "$G_SRV -u --mtu 256" \ |
| 8296 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 8297 | 0 \ |
| 8298 | -c "found fragmented DTLS handshake message" \ |
| 8299 | -c "client hello, adding renegotiation extension" \ |
| 8300 | -c "found renegotiation extension" \ |
| 8301 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8302 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8303 | -C "error" \ |
| 8304 | -s "Extra-header:" |
| 8305 | |
| 8306 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8307 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8308 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8309 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 8310 | "$G_SRV -u --mtu 256" \ |
| 8311 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 8312 | 0 \ |
| 8313 | -c "found fragmented DTLS handshake message" \ |
| 8314 | -c "client hello, adding renegotiation extension" \ |
| 8315 | -c "found renegotiation extension" \ |
| 8316 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8317 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8318 | -C "error" \ |
| 8319 | -s "Extra-header:" |
| 8320 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8321 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8322 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 8323 | "$O_SRV -dtls -mtu 2048" \ |
| 8324 | "$P_CLI dtls=1 debug_level=2" \ |
| 8325 | 0 \ |
| 8326 | -C "found fragmented DTLS handshake message" \ |
| 8327 | -C "error" |
| 8328 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8329 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8330 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 8331 | "$O_SRV -dtls -mtu 768" \ |
| 8332 | "$P_CLI dtls=1 debug_level=2" \ |
| 8333 | 0 \ |
| 8334 | -c "found fragmented DTLS handshake message" \ |
| 8335 | -C "error" |
| 8336 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8337 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8338 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 8339 | "$O_SRV -dtls -mtu 256" \ |
| 8340 | "$P_CLI dtls=1 debug_level=2" \ |
| 8341 | 0 \ |
| 8342 | -c "found fragmented DTLS handshake message" \ |
| 8343 | -C "error" |
| 8344 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8345 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8346 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 8347 | "$O_SRV -dtls -mtu 256" \ |
| 8348 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 8349 | 0 \ |
| 8350 | -c "found fragmented DTLS handshake message" \ |
| 8351 | -C "error" |
| 8352 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8353 | # Tests for sending fragmented handshake messages with DTLS |
| 8354 | # |
| 8355 | # Use client auth when we need the client to send large messages, |
| 8356 | # and use large cert chains on both sides too (the long chains we have all use |
| 8357 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 8358 | # Sizes reached (UDP payload): |
| 8359 | # - 2037B for server certificate |
| 8360 | # - 1542B for client certificate |
| 8361 | # - 1013B for newsessionticket |
| 8362 | # - all others below 512B |
| 8363 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 8364 | |
| 8365 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8366 | requires_config_enabled MBEDTLS_RSA_C |
| 8367 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8368 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8369 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8370 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8371 | run_test "DTLS fragmenting: none (for reference)" \ |
| 8372 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8373 | crt_file=data_files/server7_int-ca.crt \ |
| 8374 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8375 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8376 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8377 | "$P_CLI dtls=1 debug_level=2 \ |
| 8378 | crt_file=data_files/server8_int-ca2.crt \ |
| 8379 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8380 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8381 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8382 | 0 \ |
| 8383 | -S "found fragmented DTLS handshake message" \ |
| 8384 | -C "found fragmented DTLS handshake message" \ |
| 8385 | -C "error" |
| 8386 | |
| 8387 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8388 | requires_config_enabled MBEDTLS_RSA_C |
| 8389 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8390 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8391 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8392 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8393 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8394 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8395 | crt_file=data_files/server7_int-ca.crt \ |
| 8396 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8397 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8398 | max_frag_len=1024" \ |
| 8399 | "$P_CLI dtls=1 debug_level=2 \ |
| 8400 | crt_file=data_files/server8_int-ca2.crt \ |
| 8401 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8402 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8403 | max_frag_len=2048" \ |
| 8404 | 0 \ |
| 8405 | -S "found fragmented DTLS handshake message" \ |
| 8406 | -c "found fragmented DTLS handshake message" \ |
| 8407 | -C "error" |
| 8408 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 8409 | # With the MFL extension, the server has no way of forcing |
| 8410 | # the client to not exceed a certain MTU; hence, the following |
| 8411 | # test can't be replicated with an MTU proxy such as the one |
| 8412 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8413 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8414 | requires_config_enabled MBEDTLS_RSA_C |
| 8415 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8416 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8417 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8418 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8419 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8420 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8421 | crt_file=data_files/server7_int-ca.crt \ |
| 8422 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8423 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8424 | max_frag_len=512" \ |
| 8425 | "$P_CLI dtls=1 debug_level=2 \ |
| 8426 | crt_file=data_files/server8_int-ca2.crt \ |
| 8427 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8428 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 8429 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8430 | 0 \ |
| 8431 | -S "found fragmented DTLS handshake message" \ |
| 8432 | -c "found fragmented DTLS handshake message" \ |
| 8433 | -C "error" |
| 8434 | |
| 8435 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8436 | requires_config_enabled MBEDTLS_RSA_C |
| 8437 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8438 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8439 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8440 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8441 | 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] | 8442 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 8443 | crt_file=data_files/server7_int-ca.crt \ |
| 8444 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8445 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8446 | max_frag_len=2048" \ |
| 8447 | "$P_CLI dtls=1 debug_level=2 \ |
| 8448 | crt_file=data_files/server8_int-ca2.crt \ |
| 8449 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8450 | hs_timeout=2500-60000 \ |
| 8451 | max_frag_len=1024" \ |
| 8452 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8453 | -S "found fragmented DTLS handshake message" \ |
| 8454 | -c "found fragmented DTLS handshake message" \ |
| 8455 | -C "error" |
| 8456 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8457 | # While not required by the standard defining the MFL extension |
| 8458 | # (according to which it only applies to records, not to datagrams), |
| 8459 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 8460 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 8461 | # to the peer. |
| 8462 | # The next test checks that no datagrams significantly larger than the |
| 8463 | # negotiated MFL are sent. |
| 8464 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8465 | requires_config_enabled MBEDTLS_RSA_C |
| 8466 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8467 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8468 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8469 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8470 | 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] | 8471 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8472 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 8473 | crt_file=data_files/server7_int-ca.crt \ |
| 8474 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8475 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8476 | max_frag_len=2048" \ |
| 8477 | "$P_CLI dtls=1 debug_level=2 \ |
| 8478 | crt_file=data_files/server8_int-ca2.crt \ |
| 8479 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8480 | hs_timeout=2500-60000 \ |
| 8481 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8482 | 0 \ |
| 8483 | -S "found fragmented DTLS handshake message" \ |
| 8484 | -c "found fragmented DTLS handshake message" \ |
| 8485 | -C "error" |
| 8486 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8487 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8488 | requires_config_enabled MBEDTLS_RSA_C |
| 8489 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8490 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8491 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8492 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8493 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8494 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8495 | crt_file=data_files/server7_int-ca.crt \ |
| 8496 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8497 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8498 | max_frag_len=2048" \ |
| 8499 | "$P_CLI dtls=1 debug_level=2 \ |
| 8500 | crt_file=data_files/server8_int-ca2.crt \ |
| 8501 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8502 | hs_timeout=2500-60000 \ |
| 8503 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8504 | 0 \ |
| 8505 | -s "found fragmented DTLS handshake message" \ |
| 8506 | -c "found fragmented DTLS handshake message" \ |
| 8507 | -C "error" |
| 8508 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8509 | # While not required by the standard defining the MFL extension |
| 8510 | # (according to which it only applies to records, not to datagrams), |
| 8511 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 8512 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 8513 | # to the peer. |
| 8514 | # The next test checks that no datagrams significantly larger than the |
| 8515 | # negotiated MFL are sent. |
| 8516 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8517 | requires_config_enabled MBEDTLS_RSA_C |
| 8518 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8519 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8520 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8521 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8522 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 8523 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8524 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8525 | crt_file=data_files/server7_int-ca.crt \ |
| 8526 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8527 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8528 | max_frag_len=2048" \ |
| 8529 | "$P_CLI dtls=1 debug_level=2 \ |
| 8530 | crt_file=data_files/server8_int-ca2.crt \ |
| 8531 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8532 | hs_timeout=2500-60000 \ |
| 8533 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8534 | 0 \ |
| 8535 | -s "found fragmented DTLS handshake message" \ |
| 8536 | -c "found fragmented DTLS handshake message" \ |
| 8537 | -C "error" |
| 8538 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8539 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8540 | requires_config_enabled MBEDTLS_RSA_C |
| 8541 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8542 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8543 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8544 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 8545 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8546 | crt_file=data_files/server7_int-ca.crt \ |
| 8547 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8548 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8549 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8550 | "$P_CLI dtls=1 debug_level=2 \ |
| 8551 | crt_file=data_files/server8_int-ca2.crt \ |
| 8552 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8553 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8554 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8555 | 0 \ |
| 8556 | -S "found fragmented DTLS handshake message" \ |
| 8557 | -C "found fragmented DTLS handshake message" \ |
| 8558 | -C "error" |
| 8559 | |
| 8560 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8561 | requires_config_enabled MBEDTLS_RSA_C |
| 8562 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8563 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8564 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8565 | run_test "DTLS fragmenting: client (MTU)" \ |
| 8566 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8567 | crt_file=data_files/server7_int-ca.crt \ |
| 8568 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8569 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8570 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8571 | "$P_CLI dtls=1 debug_level=2 \ |
| 8572 | crt_file=data_files/server8_int-ca2.crt \ |
| 8573 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8574 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8575 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8576 | 0 \ |
| 8577 | -s "found fragmented DTLS handshake message" \ |
| 8578 | -C "found fragmented DTLS handshake message" \ |
| 8579 | -C "error" |
| 8580 | |
| 8581 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8582 | requires_config_enabled MBEDTLS_RSA_C |
| 8583 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8584 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8585 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8586 | run_test "DTLS fragmenting: server (MTU)" \ |
| 8587 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8588 | crt_file=data_files/server7_int-ca.crt \ |
| 8589 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8590 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8591 | mtu=512" \ |
| 8592 | "$P_CLI dtls=1 debug_level=2 \ |
| 8593 | crt_file=data_files/server8_int-ca2.crt \ |
| 8594 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8595 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8596 | mtu=2048" \ |
| 8597 | 0 \ |
| 8598 | -S "found fragmented DTLS handshake message" \ |
| 8599 | -c "found fragmented DTLS handshake message" \ |
| 8600 | -C "error" |
| 8601 | |
| 8602 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8603 | requires_config_enabled MBEDTLS_RSA_C |
| 8604 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8605 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8606 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8607 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8608 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8609 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8610 | crt_file=data_files/server7_int-ca.crt \ |
| 8611 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8612 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 8613 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8614 | "$P_CLI dtls=1 debug_level=2 \ |
| 8615 | crt_file=data_files/server8_int-ca2.crt \ |
| 8616 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8617 | hs_timeout=2500-60000 \ |
| 8618 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8619 | 0 \ |
| 8620 | -s "found fragmented DTLS handshake message" \ |
| 8621 | -c "found fragmented DTLS handshake message" \ |
| 8622 | -C "error" |
| 8623 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8624 | # 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] | 8625 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8626 | requires_config_enabled MBEDTLS_RSA_C |
| 8627 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8628 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8629 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8630 | requires_config_enabled MBEDTLS_AES_C |
| 8631 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8632 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8633 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8634 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 8635 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 8636 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8637 | crt_file=data_files/server7_int-ca.crt \ |
| 8638 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8639 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 8640 | mtu=512" \ |
| 8641 | "$P_CLI dtls=1 debug_level=2 \ |
| 8642 | crt_file=data_files/server8_int-ca2.crt \ |
| 8643 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8644 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8645 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8646 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8647 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8648 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8649 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8650 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8651 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8652 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8653 | # 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] | 8654 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 8655 | # retransmissions, but in some cases (like both the server and client using |
| 8656 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 8657 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 8658 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8659 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8660 | requires_config_enabled MBEDTLS_RSA_C |
| 8661 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8662 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8663 | requires_config_enabled MBEDTLS_AES_C |
| 8664 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8665 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8666 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 8667 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8668 | -p "$P_PXY mtu=508" \ |
| 8669 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8670 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8671 | key_file=data_files/server7.key \ |
| 8672 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8673 | "$P_CLI dtls=1 debug_level=2 \ |
| 8674 | crt_file=data_files/server8_int-ca2.crt \ |
| 8675 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8676 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8677 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8678 | 0 \ |
| 8679 | -s "found fragmented DTLS handshake message" \ |
| 8680 | -c "found fragmented DTLS handshake message" \ |
| 8681 | -C "error" |
| 8682 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8683 | # 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] | 8684 | only_with_valgrind |
| 8685 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8686 | requires_config_enabled MBEDTLS_RSA_C |
| 8687 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8688 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8689 | requires_config_enabled MBEDTLS_AES_C |
| 8690 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8691 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8692 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 8693 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8694 | -p "$P_PXY mtu=508" \ |
| 8695 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8696 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8697 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8698 | hs_timeout=250-10000" \ |
| 8699 | "$P_CLI dtls=1 debug_level=2 \ |
| 8700 | crt_file=data_files/server8_int-ca2.crt \ |
| 8701 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8702 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8703 | hs_timeout=250-10000" \ |
| 8704 | 0 \ |
| 8705 | -s "found fragmented DTLS handshake message" \ |
| 8706 | -c "found fragmented DTLS handshake message" \ |
| 8707 | -C "error" |
| 8708 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8709 | # 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] | 8710 | # OTOH the client might resend if the server is to slow to reset after sending |
| 8711 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8712 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8713 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8714 | requires_config_enabled MBEDTLS_RSA_C |
| 8715 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8716 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8717 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8718 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8719 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8720 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8721 | crt_file=data_files/server7_int-ca.crt \ |
| 8722 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8723 | hs_timeout=10000-60000 \ |
| 8724 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8725 | "$P_CLI dtls=1 debug_level=2 \ |
| 8726 | crt_file=data_files/server8_int-ca2.crt \ |
| 8727 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8728 | hs_timeout=10000-60000 \ |
| 8729 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8730 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8731 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8732 | -s "found fragmented DTLS handshake message" \ |
| 8733 | -c "found fragmented DTLS handshake message" \ |
| 8734 | -C "error" |
| 8735 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8736 | # 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] | 8737 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 8738 | # OTOH the client might resend if the server is to slow to reset after sending |
| 8739 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8740 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8741 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8742 | requires_config_enabled MBEDTLS_RSA_C |
| 8743 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8744 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8745 | requires_config_enabled MBEDTLS_AES_C |
| 8746 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8747 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8748 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8749 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8750 | -p "$P_PXY mtu=512" \ |
| 8751 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8752 | crt_file=data_files/server7_int-ca.crt \ |
| 8753 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8754 | hs_timeout=10000-60000 \ |
| 8755 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8756 | "$P_CLI dtls=1 debug_level=2 \ |
| 8757 | crt_file=data_files/server8_int-ca2.crt \ |
| 8758 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8759 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8760 | hs_timeout=10000-60000 \ |
| 8761 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8762 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8763 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8764 | -s "found fragmented DTLS handshake message" \ |
| 8765 | -c "found fragmented DTLS handshake message" \ |
| 8766 | -C "error" |
| 8767 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8768 | not_with_valgrind # spurious autoreduction due to timeout |
| 8769 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8770 | requires_config_enabled MBEDTLS_RSA_C |
| 8771 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8772 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8773 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8774 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8775 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8776 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8777 | crt_file=data_files/server7_int-ca.crt \ |
| 8778 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8779 | hs_timeout=10000-60000 \ |
| 8780 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8781 | "$P_CLI dtls=1 debug_level=2 \ |
| 8782 | crt_file=data_files/server8_int-ca2.crt \ |
| 8783 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8784 | hs_timeout=10000-60000 \ |
| 8785 | mtu=1024 nbio=2" \ |
| 8786 | 0 \ |
| 8787 | -S "autoreduction" \ |
| 8788 | -s "found fragmented DTLS handshake message" \ |
| 8789 | -c "found fragmented DTLS handshake message" \ |
| 8790 | -C "error" |
| 8791 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8792 | # 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] | 8793 | not_with_valgrind # spurious autoreduction due to timeout |
| 8794 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8795 | requires_config_enabled MBEDTLS_RSA_C |
| 8796 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8797 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8798 | requires_config_enabled MBEDTLS_AES_C |
| 8799 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8800 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8801 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8802 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 8803 | -p "$P_PXY mtu=512" \ |
| 8804 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8805 | crt_file=data_files/server7_int-ca.crt \ |
| 8806 | key_file=data_files/server7.key \ |
| 8807 | hs_timeout=10000-60000 \ |
| 8808 | mtu=512 nbio=2" \ |
| 8809 | "$P_CLI dtls=1 debug_level=2 \ |
| 8810 | crt_file=data_files/server8_int-ca2.crt \ |
| 8811 | key_file=data_files/server8.key \ |
| 8812 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8813 | hs_timeout=10000-60000 \ |
| 8814 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8815 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8816 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8817 | -s "found fragmented DTLS handshake message" \ |
| 8818 | -c "found fragmented DTLS handshake message" \ |
| 8819 | -C "error" |
| 8820 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8821 | # 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] | 8822 | # This ensures things still work after session_reset(). |
| 8823 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8824 | # Since we don't support reading fragmented ClientHello yet, |
| 8825 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 8826 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8827 | # An autoreduction on the client-side might happen if the server is |
| 8828 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 8829 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8830 | # resumed listening, which would result in a spurious autoreduction. |
| 8831 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8832 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8833 | requires_config_enabled MBEDTLS_RSA_C |
| 8834 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8835 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8836 | requires_config_enabled MBEDTLS_AES_C |
| 8837 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8838 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8839 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8840 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 8841 | -p "$P_PXY mtu=1450" \ |
| 8842 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8843 | crt_file=data_files/server7_int-ca.crt \ |
| 8844 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8845 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8846 | mtu=1450" \ |
| 8847 | "$P_CLI dtls=1 debug_level=2 \ |
| 8848 | crt_file=data_files/server8_int-ca2.crt \ |
| 8849 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8850 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8851 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 8852 | 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] | 8853 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8854 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8855 | -s "found fragmented DTLS handshake message" \ |
| 8856 | -c "found fragmented DTLS handshake message" \ |
| 8857 | -C "error" |
| 8858 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8859 | # An autoreduction on the client-side might happen if the server is |
| 8860 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8861 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8862 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8863 | requires_config_enabled MBEDTLS_RSA_C |
| 8864 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8865 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8866 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8867 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8868 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8869 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8870 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8871 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 8872 | -p "$P_PXY mtu=512" \ |
| 8873 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8874 | crt_file=data_files/server7_int-ca.crt \ |
| 8875 | key_file=data_files/server7.key \ |
| 8876 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8877 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8878 | mtu=512" \ |
| 8879 | "$P_CLI dtls=1 debug_level=2 \ |
| 8880 | crt_file=data_files/server8_int-ca2.crt \ |
| 8881 | key_file=data_files/server8.key \ |
| 8882 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8883 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8884 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8885 | mtu=512" \ |
| 8886 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8887 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8888 | -s "found fragmented DTLS handshake message" \ |
| 8889 | -c "found fragmented DTLS handshake message" \ |
| 8890 | -C "error" |
| 8891 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8892 | # An autoreduction on the client-side might happen if the server is |
| 8893 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8894 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8895 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8896 | requires_config_enabled MBEDTLS_RSA_C |
| 8897 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8898 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8899 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8900 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8901 | requires_config_enabled MBEDTLS_AES_C |
| 8902 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8903 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8904 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8905 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 8906 | -p "$P_PXY mtu=512" \ |
| 8907 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8908 | crt_file=data_files/server7_int-ca.crt \ |
| 8909 | key_file=data_files/server7.key \ |
| 8910 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8911 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8912 | mtu=512" \ |
| 8913 | "$P_CLI dtls=1 debug_level=2 \ |
| 8914 | crt_file=data_files/server8_int-ca2.crt \ |
| 8915 | key_file=data_files/server8.key \ |
| 8916 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8917 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8918 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8919 | mtu=512" \ |
| 8920 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8921 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8922 | -s "found fragmented DTLS handshake message" \ |
| 8923 | -c "found fragmented DTLS handshake message" \ |
| 8924 | -C "error" |
| 8925 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8926 | # An autoreduction on the client-side might happen if the server is |
| 8927 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8928 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8929 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8930 | requires_config_enabled MBEDTLS_RSA_C |
| 8931 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8932 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8933 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8934 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8935 | requires_config_enabled MBEDTLS_AES_C |
| 8936 | requires_config_enabled MBEDTLS_CCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8937 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8938 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8939 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8940 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8941 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8942 | crt_file=data_files/server7_int-ca.crt \ |
| 8943 | key_file=data_files/server7.key \ |
| 8944 | exchanges=2 renegotiation=1 \ |
| 8945 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8946 | hs_timeout=10000-60000 \ |
| 8947 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8948 | "$P_CLI dtls=1 debug_level=2 \ |
| 8949 | crt_file=data_files/server8_int-ca2.crt \ |
| 8950 | key_file=data_files/server8.key \ |
| 8951 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8952 | hs_timeout=10000-60000 \ |
| 8953 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8954 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8955 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8956 | -s "found fragmented DTLS handshake message" \ |
| 8957 | -c "found fragmented DTLS handshake message" \ |
| 8958 | -C "error" |
| 8959 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8960 | # An autoreduction on the client-side might happen if the server is |
| 8961 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8962 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8963 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8964 | requires_config_enabled MBEDTLS_RSA_C |
| 8965 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8966 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8967 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8968 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8969 | requires_config_enabled MBEDTLS_AES_C |
| 8970 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8971 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8972 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8973 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8974 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8975 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8976 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8977 | crt_file=data_files/server7_int-ca.crt \ |
| 8978 | key_file=data_files/server7.key \ |
| 8979 | exchanges=2 renegotiation=1 \ |
| 8980 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8981 | hs_timeout=10000-60000 \ |
| 8982 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8983 | "$P_CLI dtls=1 debug_level=2 \ |
| 8984 | crt_file=data_files/server8_int-ca2.crt \ |
| 8985 | key_file=data_files/server8.key \ |
| 8986 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8987 | hs_timeout=10000-60000 \ |
| 8988 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8989 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8990 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8991 | -s "found fragmented DTLS handshake message" \ |
| 8992 | -c "found fragmented DTLS handshake message" \ |
| 8993 | -C "error" |
| 8994 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8995 | # An autoreduction on the client-side might happen if the server is |
| 8996 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8997 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8998 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8999 | requires_config_enabled MBEDTLS_RSA_C |
| 9000 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9001 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9002 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9003 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9004 | requires_config_enabled MBEDTLS_AES_C |
| 9005 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9006 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9007 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9008 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9009 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9010 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9011 | crt_file=data_files/server7_int-ca.crt \ |
| 9012 | key_file=data_files/server7.key \ |
| 9013 | exchanges=2 renegotiation=1 \ |
| 9014 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9015 | hs_timeout=10000-60000 \ |
| 9016 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9017 | "$P_CLI dtls=1 debug_level=2 \ |
| 9018 | crt_file=data_files/server8_int-ca2.crt \ |
| 9019 | key_file=data_files/server8.key \ |
| 9020 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9021 | hs_timeout=10000-60000 \ |
| 9022 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9023 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9024 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9025 | -s "found fragmented DTLS handshake message" \ |
| 9026 | -c "found fragmented DTLS handshake message" \ |
| 9027 | -C "error" |
| 9028 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9029 | # 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] | 9030 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9031 | requires_config_enabled MBEDTLS_RSA_C |
| 9032 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9033 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9034 | requires_config_enabled MBEDTLS_AES_C |
| 9035 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9036 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9037 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9038 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9039 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 9040 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9041 | "$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] | 9042 | crt_file=data_files/server7_int-ca.crt \ |
| 9043 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9044 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9045 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9046 | crt_file=data_files/server8_int-ca2.crt \ |
| 9047 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9048 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9049 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9050 | 0 \ |
| 9051 | -s "found fragmented DTLS handshake message" \ |
| 9052 | -c "found fragmented DTLS handshake message" \ |
| 9053 | -C "error" |
| 9054 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9055 | # 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] | 9056 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9057 | requires_config_enabled MBEDTLS_RSA_C |
| 9058 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9059 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9060 | requires_config_enabled MBEDTLS_AES_C |
| 9061 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9062 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9063 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9064 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9065 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 9066 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 9067 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9068 | crt_file=data_files/server7_int-ca.crt \ |
| 9069 | key_file=data_files/server7.key \ |
| 9070 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 9071 | "$P_CLI dtls=1 debug_level=2 \ |
| 9072 | crt_file=data_files/server8_int-ca2.crt \ |
| 9073 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9074 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9075 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 9076 | 0 \ |
| 9077 | -s "found fragmented DTLS handshake message" \ |
| 9078 | -c "found fragmented DTLS handshake message" \ |
| 9079 | -C "error" |
| 9080 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9081 | # interop tests for DTLS fragmentating with reliable connection |
| 9082 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9083 | # here and below we just want to test that the we fragment in a way that |
| 9084 | # pleases other implementations, so we don't need the peer to fragment |
| 9085 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9086 | requires_config_enabled MBEDTLS_RSA_C |
| 9087 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 9088 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9089 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9090 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 9091 | "$G_SRV -u" \ |
| 9092 | "$P_CLI dtls=1 debug_level=2 \ |
| 9093 | crt_file=data_files/server8_int-ca2.crt \ |
| 9094 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9095 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9096 | 0 \ |
| 9097 | -c "fragmenting handshake message" \ |
| 9098 | -C "error" |
| 9099 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 9100 | # We use --insecure for the GnuTLS client because it expects |
| 9101 | # the hostname / IP it connects to to be the name used in the |
| 9102 | # certificate obtained from the server. Here, however, it |
| 9103 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 9104 | # as the server name in the certificate. This will make the |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 9105 | # certificate validation fail, but passing --insecure makes |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 9106 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9107 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9108 | requires_config_enabled MBEDTLS_RSA_C |
| 9109 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 9110 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 9111 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9112 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9113 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 9114 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9115 | crt_file=data_files/server7_int-ca.crt \ |
| 9116 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9117 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 9118 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9119 | 0 \ |
| 9120 | -s "fragmenting handshake message" |
| 9121 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9122 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9123 | requires_config_enabled MBEDTLS_RSA_C |
| 9124 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9125 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9126 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 9127 | "$O_SRV -dtls1_2 -verify 10" \ |
| 9128 | "$P_CLI dtls=1 debug_level=2 \ |
| 9129 | crt_file=data_files/server8_int-ca2.crt \ |
| 9130 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9131 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9132 | 0 \ |
| 9133 | -c "fragmenting handshake message" \ |
| 9134 | -C "error" |
| 9135 | |
| 9136 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9137 | requires_config_enabled MBEDTLS_RSA_C |
| 9138 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9139 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9140 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 9141 | "$P_SRV dtls=1 debug_level=2 \ |
| 9142 | crt_file=data_files/server7_int-ca.crt \ |
| 9143 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9144 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9145 | "$O_CLI -dtls1_2" \ |
| 9146 | 0 \ |
| 9147 | -s "fragmenting handshake message" |
| 9148 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9149 | # interop tests for DTLS fragmentating with unreliable connection |
| 9150 | # |
| 9151 | # again we just want to test that the we fragment in a way that |
| 9152 | # pleases other implementations, so we don't need the peer to fragment |
| 9153 | requires_gnutls_next |
| 9154 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9155 | requires_config_enabled MBEDTLS_RSA_C |
| 9156 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9157 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9158 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9159 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 9160 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9161 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9162 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9163 | crt_file=data_files/server8_int-ca2.crt \ |
| 9164 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9165 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9166 | 0 \ |
| 9167 | -c "fragmenting handshake message" \ |
| 9168 | -C "error" |
| 9169 | |
| 9170 | requires_gnutls_next |
| 9171 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9172 | requires_config_enabled MBEDTLS_RSA_C |
| 9173 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9174 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9175 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9176 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 9177 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9178 | "$P_SRV dtls=1 debug_level=2 \ |
| 9179 | crt_file=data_files/server7_int-ca.crt \ |
| 9180 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9181 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9182 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9183 | 0 \ |
| 9184 | -s "fragmenting handshake message" |
| 9185 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9186 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 9187 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9188 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9189 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 9190 | ## (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] | 9191 | skip_next_test |
| 9192 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9193 | requires_config_enabled MBEDTLS_RSA_C |
| 9194 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9195 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9196 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9197 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 9198 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9199 | "$O_SRV -dtls1_2 -verify 10" \ |
| 9200 | "$P_CLI dtls=1 debug_level=2 \ |
| 9201 | crt_file=data_files/server8_int-ca2.crt \ |
| 9202 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9203 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9204 | 0 \ |
| 9205 | -c "fragmenting handshake message" \ |
| 9206 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9207 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9208 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9209 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9210 | requires_config_enabled MBEDTLS_RSA_C |
| 9211 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9212 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9213 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9214 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 9215 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9216 | "$P_SRV dtls=1 debug_level=2 \ |
| 9217 | crt_file=data_files/server7_int-ca.crt \ |
| 9218 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9219 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9220 | "$O_CLI -dtls1_2" \ |
| 9221 | 0 \ |
| 9222 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9223 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9224 | # Tests for DTLS-SRTP (RFC 5764) |
| 9225 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9226 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9227 | run_test "DTLS-SRTP all profiles supported" \ |
| 9228 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9229 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9230 | 0 \ |
| 9231 | -s "found use_srtp extension" \ |
| 9232 | -s "found srtp profile" \ |
| 9233 | -s "selected srtp profile" \ |
| 9234 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9235 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9236 | -c "client hello, adding use_srtp extension" \ |
| 9237 | -c "found use_srtp extension" \ |
| 9238 | -c "found srtp profile" \ |
| 9239 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9240 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9241 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9242 | -C "error" |
| 9243 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9244 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9245 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9246 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9247 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 9248 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9249 | "$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] | 9250 | 0 \ |
| 9251 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9252 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 9253 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9254 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9255 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9256 | -c "client hello, adding use_srtp extension" \ |
| 9257 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9258 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9259 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9260 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9261 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9262 | -C "error" |
| 9263 | |
| 9264 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9265 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9266 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9267 | "$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] | 9268 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9269 | 0 \ |
| 9270 | -s "found use_srtp extension" \ |
| 9271 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9272 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9273 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9274 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9275 | -c "client hello, adding use_srtp extension" \ |
| 9276 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9277 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9278 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9279 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9280 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9281 | -C "error" |
| 9282 | |
| 9283 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9284 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9285 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 9286 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9287 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9288 | 0 \ |
| 9289 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9290 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9291 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9292 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9293 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9294 | -c "client hello, adding use_srtp extension" \ |
| 9295 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9296 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9297 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9298 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9299 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9300 | -C "error" |
| 9301 | |
| 9302 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9303 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9304 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 9305 | "$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] | 9306 | "$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] | 9307 | 0 \ |
| 9308 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9309 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9310 | -S "selected srtp profile" \ |
| 9311 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9312 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9313 | -c "client hello, adding use_srtp extension" \ |
| 9314 | -C "found use_srtp extension" \ |
| 9315 | -C "found srtp profile" \ |
| 9316 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9317 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9318 | -C "error" |
| 9319 | |
| 9320 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9321 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9322 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 9323 | "$P_SRV dtls=1 debug_level=3" \ |
| 9324 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9325 | 0 \ |
| 9326 | -s "found use_srtp extension" \ |
| 9327 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9328 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9329 | -c "client hello, adding use_srtp extension" \ |
| 9330 | -C "found use_srtp extension" \ |
| 9331 | -C "found srtp profile" \ |
| 9332 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9333 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9334 | -C "error" |
| 9335 | |
| 9336 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9337 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9338 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 9339 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 9340 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9341 | 0 \ |
| 9342 | -s "found use_srtp extension" \ |
| 9343 | -s "found srtp profile" \ |
| 9344 | -s "selected srtp profile" \ |
| 9345 | -s "server hello, adding use_srtp extension" \ |
| 9346 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9347 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9348 | -c "client hello, adding use_srtp extension" \ |
| 9349 | -c "found use_srtp extension" \ |
| 9350 | -c "found srtp profile" \ |
| 9351 | -c "selected srtp profile" \ |
| 9352 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9353 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9354 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9355 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 9356 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9357 | -C "error" |
| 9358 | |
| 9359 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9360 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9361 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 9362 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9363 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9364 | 0 \ |
| 9365 | -s "found use_srtp extension" \ |
| 9366 | -s "found srtp profile" \ |
| 9367 | -s "selected srtp profile" \ |
| 9368 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9369 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 9370 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9371 | -S "dumping 'using mki' (8 bytes)" \ |
| 9372 | -c "client hello, adding use_srtp extension" \ |
| 9373 | -c "found use_srtp extension" \ |
| 9374 | -c "found srtp profile" \ |
| 9375 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9376 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 9377 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9378 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9379 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9380 | -C "dumping 'received mki' (8 bytes)" \ |
| 9381 | -C "error" |
| 9382 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9383 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9384 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9385 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 9386 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9387 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 9388 | 0 \ |
| 9389 | -s "found use_srtp extension" \ |
| 9390 | -s "found srtp profile" \ |
| 9391 | -s "selected srtp profile" \ |
| 9392 | -s "server hello, adding use_srtp extension" \ |
| 9393 | -s "DTLS-SRTP key material is"\ |
| 9394 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 9395 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 9396 | |
| 9397 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9398 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9399 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 9400 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9401 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 9402 | 0 \ |
| 9403 | -s "found use_srtp extension" \ |
| 9404 | -s "found srtp profile" \ |
| 9405 | -s "selected srtp profile" \ |
| 9406 | -s "server hello, adding use_srtp extension" \ |
| 9407 | -s "DTLS-SRTP key material is"\ |
| 9408 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 9409 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 9410 | |
| 9411 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9412 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9413 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 9414 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9415 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 9416 | 0 \ |
| 9417 | -s "found use_srtp extension" \ |
| 9418 | -s "found srtp profile" \ |
| 9419 | -s "selected srtp profile" \ |
| 9420 | -s "server hello, adding use_srtp extension" \ |
| 9421 | -s "DTLS-SRTP key material is"\ |
| 9422 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 9423 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 9424 | |
| 9425 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9426 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9427 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 9428 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9429 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 9430 | 0 \ |
| 9431 | -s "found use_srtp extension" \ |
| 9432 | -s "found srtp profile" \ |
| 9433 | -s "selected srtp profile" \ |
| 9434 | -s "server hello, adding use_srtp extension" \ |
| 9435 | -s "DTLS-SRTP key material is"\ |
| 9436 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 9437 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 9438 | |
| 9439 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9440 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9441 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 9442 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9443 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 9444 | 0 \ |
| 9445 | -s "found use_srtp extension" \ |
| 9446 | -s "found srtp profile" \ |
| 9447 | -s "selected srtp profile" \ |
| 9448 | -s "server hello, adding use_srtp extension" \ |
| 9449 | -s "DTLS-SRTP key material is"\ |
| 9450 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 9451 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 9452 | |
| 9453 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9454 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9455 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 9456 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 9457 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 9458 | 0 \ |
| 9459 | -s "found use_srtp extension" \ |
| 9460 | -s "found srtp profile" \ |
| 9461 | -S "selected srtp profile" \ |
| 9462 | -S "server hello, adding use_srtp extension" \ |
| 9463 | -S "DTLS-SRTP key material is"\ |
| 9464 | -C "SRTP Extension negotiated, profile" |
| 9465 | |
| 9466 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9467 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9468 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 9469 | "$P_SRV dtls=1 debug_level=3" \ |
| 9470 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 9471 | 0 \ |
| 9472 | -s "found use_srtp extension" \ |
| 9473 | -S "server hello, adding use_srtp extension" \ |
| 9474 | -S "DTLS-SRTP key material is"\ |
| 9475 | -C "SRTP Extension negotiated, profile" |
| 9476 | |
| 9477 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9478 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9479 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 9480 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 9481 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9482 | 0 \ |
| 9483 | -c "client hello, adding use_srtp extension" \ |
| 9484 | -c "found use_srtp extension" \ |
| 9485 | -c "found srtp profile" \ |
| 9486 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 9487 | -c "DTLS-SRTP key material is"\ |
| 9488 | -C "error" |
| 9489 | |
| 9490 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9491 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9492 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 9493 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 9494 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9495 | 0 \ |
| 9496 | -c "client hello, adding use_srtp extension" \ |
| 9497 | -c "found use_srtp extension" \ |
| 9498 | -c "found srtp profile" \ |
| 9499 | -c "selected srtp profile" \ |
| 9500 | -c "DTLS-SRTP key material is"\ |
| 9501 | -C "error" |
| 9502 | |
| 9503 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9504 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9505 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 9506 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 9507 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9508 | 0 \ |
| 9509 | -c "client hello, adding use_srtp extension" \ |
| 9510 | -c "found use_srtp extension" \ |
| 9511 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9512 | -c "selected srtp profile" \ |
| 9513 | -c "DTLS-SRTP key material is"\ |
| 9514 | -C "error" |
| 9515 | |
| 9516 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9517 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9518 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 9519 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 9520 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9521 | 0 \ |
| 9522 | -c "client hello, adding use_srtp extension" \ |
| 9523 | -c "found use_srtp extension" \ |
| 9524 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9525 | -c "selected srtp profile" \ |
| 9526 | -c "DTLS-SRTP key material is"\ |
| 9527 | -C "error" |
| 9528 | |
| 9529 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9530 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9531 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 9532 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 9533 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9534 | 0 \ |
| 9535 | -c "client hello, adding use_srtp extension" \ |
| 9536 | -c "found use_srtp extension" \ |
| 9537 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9538 | -c "selected srtp profile" \ |
| 9539 | -c "DTLS-SRTP key material is"\ |
| 9540 | -C "error" |
| 9541 | |
| 9542 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9543 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9544 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 9545 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 9546 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 9547 | 0 \ |
| 9548 | -c "client hello, adding use_srtp extension" \ |
| 9549 | -C "found use_srtp extension" \ |
| 9550 | -C "found srtp profile" \ |
| 9551 | -C "selected srtp profile" \ |
| 9552 | -C "DTLS-SRTP key material is"\ |
| 9553 | -C "error" |
| 9554 | |
| 9555 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9556 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9557 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 9558 | "$O_SRV -dtls" \ |
| 9559 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9560 | 0 \ |
| 9561 | -c "client hello, adding use_srtp extension" \ |
| 9562 | -C "found use_srtp extension" \ |
| 9563 | -C "found srtp profile" \ |
| 9564 | -C "selected srtp profile" \ |
| 9565 | -C "DTLS-SRTP key material is"\ |
| 9566 | -C "error" |
| 9567 | |
| 9568 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9569 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9570 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 9571 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 9572 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9573 | 0 \ |
| 9574 | -c "client hello, adding use_srtp extension" \ |
| 9575 | -c "found use_srtp extension" \ |
| 9576 | -c "found srtp profile" \ |
| 9577 | -c "selected srtp profile" \ |
| 9578 | -c "DTLS-SRTP key material is"\ |
| 9579 | -c "DTLS-SRTP no mki value negotiated"\ |
| 9580 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9581 | -C "dumping 'received mki' (8 bytes)" \ |
| 9582 | -C "error" |
| 9583 | |
| 9584 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9585 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9586 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9587 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9588 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9589 | "$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] | 9590 | 0 \ |
| 9591 | -s "found use_srtp extension" \ |
| 9592 | -s "found srtp profile" \ |
| 9593 | -s "selected srtp profile" \ |
| 9594 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9595 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9596 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 9597 | |
| 9598 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9599 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9600 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9601 | 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] | 9602 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9603 | "$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] | 9604 | 0 \ |
| 9605 | -s "found use_srtp extension" \ |
| 9606 | -s "found srtp profile" \ |
| 9607 | -s "selected srtp profile" \ |
| 9608 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9609 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9610 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 9611 | |
| 9612 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9613 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9614 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9615 | 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] | 9616 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9617 | "$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] | 9618 | 0 \ |
| 9619 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9620 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9621 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9622 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9623 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9624 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 9625 | |
| 9626 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9627 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9628 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9629 | 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] | 9630 | "$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] | 9631 | "$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] | 9632 | 0 \ |
| 9633 | -s "found use_srtp extension" \ |
| 9634 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9635 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9636 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9637 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9638 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 9639 | |
| 9640 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9641 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9642 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9643 | 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] | 9644 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9645 | "$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] | 9646 | 0 \ |
| 9647 | -s "found use_srtp extension" \ |
| 9648 | -s "found srtp profile" \ |
| 9649 | -s "selected srtp profile" \ |
| 9650 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9651 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9652 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 9653 | |
| 9654 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9655 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9656 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9657 | 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] | 9658 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 9659 | "$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] | 9660 | 0 \ |
| 9661 | -s "found use_srtp extension" \ |
| 9662 | -s "found srtp profile" \ |
| 9663 | -S "selected srtp profile" \ |
| 9664 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9665 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9666 | -C "SRTP profile:" |
| 9667 | |
| 9668 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9669 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9670 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9671 | 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] | 9672 | "$P_SRV dtls=1 debug_level=3" \ |
| 9673 | "$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] | 9674 | 0 \ |
| 9675 | -s "found use_srtp extension" \ |
| 9676 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9677 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9678 | -C "SRTP profile:" |
| 9679 | |
| 9680 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9681 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9682 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9683 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 9684 | "$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" \ |
| 9685 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9686 | 0 \ |
| 9687 | -c "client hello, adding use_srtp extension" \ |
| 9688 | -c "found use_srtp extension" \ |
| 9689 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9690 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9691 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9692 | -C "error" |
| 9693 | |
| 9694 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9695 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9696 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9697 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 9698 | "$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" \ |
| 9699 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9700 | 0 \ |
| 9701 | -c "client hello, adding use_srtp extension" \ |
| 9702 | -c "found use_srtp extension" \ |
| 9703 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9704 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9705 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9706 | -C "error" |
| 9707 | |
| 9708 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9709 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9710 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9711 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 9712 | "$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" \ |
| 9713 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9714 | 0 \ |
| 9715 | -c "client hello, adding use_srtp extension" \ |
| 9716 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9717 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9718 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9719 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9720 | -C "error" |
| 9721 | |
| 9722 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9723 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9724 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9725 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 9726 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9727 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9728 | 0 \ |
| 9729 | -c "client hello, adding use_srtp extension" \ |
| 9730 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9731 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9732 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9733 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9734 | -C "error" |
| 9735 | |
| 9736 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9737 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9738 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9739 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 9740 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9741 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9742 | 0 \ |
| 9743 | -c "client hello, adding use_srtp extension" \ |
| 9744 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9745 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9746 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9747 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9748 | -C "error" |
| 9749 | |
| 9750 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9751 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9752 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9753 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 9754 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9755 | "$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] | 9756 | 0 \ |
| 9757 | -c "client hello, adding use_srtp extension" \ |
| 9758 | -C "found use_srtp extension" \ |
| 9759 | -C "found srtp profile" \ |
| 9760 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9761 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9762 | -C "error" |
| 9763 | |
| 9764 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9765 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9766 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9767 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 9768 | "$G_SRV -u" \ |
| 9769 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9770 | 0 \ |
| 9771 | -c "client hello, adding use_srtp extension" \ |
| 9772 | -C "found use_srtp extension" \ |
| 9773 | -C "found srtp profile" \ |
| 9774 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9775 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9776 | -C "error" |
| 9777 | |
| 9778 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9779 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9780 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9781 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 9782 | "$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" \ |
| 9783 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9784 | 0 \ |
| 9785 | -c "client hello, adding use_srtp extension" \ |
| 9786 | -c "found use_srtp extension" \ |
| 9787 | -c "found srtp profile" \ |
| 9788 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9789 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 9790 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9791 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9792 | -c "dumping 'received mki' (8 bytes)" \ |
| 9793 | -C "error" |
| 9794 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 9795 | # Tests for specific things with "unreliable" UDP connection |
| 9796 | |
| 9797 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9798 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 9799 | run_test "DTLS proxy: reference" \ |
| 9800 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9801 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 9802 | "$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] | 9803 | 0 \ |
| 9804 | -C "replayed record" \ |
| 9805 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 9806 | -C "Buffer record from epoch" \ |
| 9807 | -S "Buffer record from epoch" \ |
| 9808 | -C "ssl_buffer_message" \ |
| 9809 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 9810 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9811 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 9812 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9813 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 9814 | -c "HTTP/1.0 200 OK" |
| 9815 | |
| 9816 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9817 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9818 | run_test "DTLS proxy: duplicate every packet" \ |
| 9819 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9820 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 9821 | "$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] | 9822 | 0 \ |
| 9823 | -c "replayed record" \ |
| 9824 | -s "replayed record" \ |
| 9825 | -c "record from another epoch" \ |
| 9826 | -s "record from another epoch" \ |
| 9827 | -S "resend" \ |
| 9828 | -s "Extra-header:" \ |
| 9829 | -c "HTTP/1.0 200 OK" |
| 9830 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9831 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9832 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 9833 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9834 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 9835 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9836 | 0 \ |
| 9837 | -c "replayed record" \ |
| 9838 | -S "replayed record" \ |
| 9839 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9840 | -s "record from another epoch" \ |
| 9841 | -c "resend" \ |
| 9842 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9843 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9844 | -c "HTTP/1.0 200 OK" |
| 9845 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9846 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9847 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 9848 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9849 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 9850 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9851 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9852 | -c "next record in same datagram" \ |
| 9853 | -s "next record in same datagram" |
| 9854 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9855 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9856 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 9857 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9858 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 9859 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9860 | 0 \ |
| 9861 | -c "next record in same datagram" \ |
| 9862 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9863 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9864 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9865 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 9866 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9867 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 9868 | "$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] | 9869 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9870 | -c "discarding invalid record (mac)" \ |
| 9871 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9872 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9873 | -c "HTTP/1.0 200 OK" \ |
| 9874 | -S "too many records with bad MAC" \ |
| 9875 | -S "Verification of the message MAC failed" |
| 9876 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9877 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9878 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 9879 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9880 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 9881 | "$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] | 9882 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9883 | -C "discarding invalid record (mac)" \ |
| 9884 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9885 | -S "Extra-header:" \ |
| 9886 | -C "HTTP/1.0 200 OK" \ |
| 9887 | -s "too many records with bad MAC" \ |
| 9888 | -s "Verification of the message MAC failed" |
| 9889 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9890 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9891 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 9892 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9893 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 9894 | "$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] | 9895 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9896 | -c "discarding invalid record (mac)" \ |
| 9897 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9898 | -s "Extra-header:" \ |
| 9899 | -c "HTTP/1.0 200 OK" \ |
| 9900 | -S "too many records with bad MAC" \ |
| 9901 | -S "Verification of the message MAC failed" |
| 9902 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9903 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9904 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 9905 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9906 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 9907 | "$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] | 9908 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9909 | -c "discarding invalid record (mac)" \ |
| 9910 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9911 | -s "Extra-header:" \ |
| 9912 | -c "HTTP/1.0 200 OK" \ |
| 9913 | -s "too many records with bad MAC" \ |
| 9914 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9915 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9916 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9917 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 9918 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 9919 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 9920 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9921 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9922 | -c "record from another epoch" \ |
| 9923 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9924 | -s "Extra-header:" \ |
| 9925 | -c "HTTP/1.0 200 OK" |
| 9926 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 9927 | # Tests for reordering support with DTLS |
| 9928 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 9929 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9930 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9931 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 9932 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9933 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9934 | hs_timeout=2500-60000" \ |
| 9935 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9936 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 9937 | 0 \ |
| 9938 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9939 | -c "Next handshake message has been buffered - load"\ |
| 9940 | -S "Buffering HS message" \ |
| 9941 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9942 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9943 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9944 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9945 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 9946 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 9947 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9948 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9949 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 9950 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9951 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9952 | hs_timeout=2500-60000" \ |
| 9953 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9954 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9955 | 0 \ |
| 9956 | -c "Buffering HS message" \ |
| 9957 | -c "found fragmented DTLS handshake message"\ |
| 9958 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 9959 | -c "Next handshake message has been buffered - load"\ |
| 9960 | -S "Buffering HS message" \ |
| 9961 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9962 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9963 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9964 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 9965 | -S "Remember CCS message" |
| 9966 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9967 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 9968 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 9969 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 9970 | # while keeping the ServerKeyExchange. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 9971 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9972 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9973 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9974 | 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] | 9975 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9976 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9977 | hs_timeout=2500-60000" \ |
| 9978 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9979 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9980 | 0 \ |
| 9981 | -c "Buffering HS message" \ |
| 9982 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9983 | -C "attempt to make space by freeing buffered messages" \ |
| 9984 | -S "Buffering HS message" \ |
| 9985 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9986 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9987 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9988 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9989 | -S "Remember CCS message" |
| 9990 | |
| 9991 | # The size constraints ensure that the delayed certificate message can't |
| 9992 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 9993 | # when dropping it first. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 9994 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9995 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 9996 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9997 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9998 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 9999 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10000 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10001 | hs_timeout=2500-60000" \ |
| 10002 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10003 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10004 | 0 \ |
| 10005 | -c "Buffering HS message" \ |
| 10006 | -c "attempt to make space by freeing buffered future messages" \ |
| 10007 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10008 | -S "Buffering HS message" \ |
| 10009 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10010 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10011 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10012 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10013 | -S "Remember CCS message" |
| 10014 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10015 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10016 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10017 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 10018 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10019 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 10020 | hs_timeout=2500-60000" \ |
| 10021 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10022 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10023 | 0 \ |
| 10024 | -C "Buffering HS message" \ |
| 10025 | -C "Next handshake message has been buffered - load"\ |
| 10026 | -s "Buffering HS message" \ |
| 10027 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10028 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10029 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10030 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10031 | -S "Remember CCS message" |
| 10032 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10033 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10034 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10035 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 10036 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10037 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10038 | hs_timeout=2500-60000" \ |
| 10039 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10040 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10041 | 0 \ |
| 10042 | -C "Buffering HS message" \ |
| 10043 | -C "Next handshake message has been buffered - load"\ |
| 10044 | -S "Buffering HS message" \ |
| 10045 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10046 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10047 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10048 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10049 | -S "Remember CCS message" |
| 10050 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10051 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10052 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10053 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 10054 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10055 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10056 | hs_timeout=2500-60000" \ |
| 10057 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10058 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10059 | 0 \ |
| 10060 | -C "Buffering HS message" \ |
| 10061 | -C "Next handshake message has been buffered - load"\ |
| 10062 | -S "Buffering HS message" \ |
| 10063 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10064 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10065 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10066 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10067 | -s "Remember CCS message" |
| 10068 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10069 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10070 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10071 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10072 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10073 | hs_timeout=2500-60000" \ |
| 10074 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10075 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 10076 | 0 \ |
| 10077 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10078 | -s "Found buffered record from current epoch - load" \ |
| 10079 | -c "Buffer record from epoch 1" \ |
| 10080 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10081 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10082 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 10083 | # from the server are delayed, so that the encrypted Finished message |
| 10084 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 10085 | # in afterwards, the encrypted Finished message must be freed in order |
| 10086 | # to make space for the NewSessionTicket to be reassembled. |
| 10087 | # This works only in very particular circumstances: |
| 10088 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 10089 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 10090 | # the encrypted Finished message. |
| 10091 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 10092 | # needs to be fragmented. |
| 10093 | # - All messages sent by the server must be small enough to be either sent |
| 10094 | # without fragmentation or be reassembled within the bounds of |
| 10095 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 10096 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 10097 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 10098 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10099 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10100 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 10101 | -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] | 10102 | "$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] | 10103 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 10104 | 0 \ |
| 10105 | -s "Buffer record from epoch 1" \ |
| 10106 | -s "Found buffered record from current epoch - load" \ |
| 10107 | -c "Buffer record from epoch 1" \ |
| 10108 | -C "Found buffered record from current epoch - load" \ |
| 10109 | -c "Enough space available after freeing future epoch record" |
| 10110 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 10111 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 10112 | |
| 10113 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10114 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10115 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 10116 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10117 | "$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] | 10118 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10119 | "$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] | 10120 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10121 | 0 \ |
| 10122 | -s "Extra-header:" \ |
| 10123 | -c "HTTP/1.0 200 OK" |
| 10124 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10125 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10126 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10127 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 10128 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10129 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 10130 | "$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] | 10131 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10132 | 0 \ |
| 10133 | -s "Extra-header:" \ |
| 10134 | -c "HTTP/1.0 200 OK" |
| 10135 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10136 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10137 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10138 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 10139 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10140 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 10141 | "$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] | 10142 | 0 \ |
| 10143 | -s "Extra-header:" \ |
| 10144 | -c "HTTP/1.0 200 OK" |
| 10145 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10146 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10147 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10148 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 10149 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10150 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 10151 | "$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] | 10152 | 0 \ |
| 10153 | -s "Extra-header:" \ |
| 10154 | -c "HTTP/1.0 200 OK" |
| 10155 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10156 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10157 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10158 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 10159 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10160 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 10161 | "$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] | 10162 | 0 \ |
| 10163 | -s "Extra-header:" \ |
| 10164 | -c "HTTP/1.0 200 OK" |
| 10165 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10166 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10167 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10168 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 10169 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10170 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 10171 | "$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] | 10172 | 0 \ |
| 10173 | -s "Extra-header:" \ |
| 10174 | -c "HTTP/1.0 200 OK" |
| 10175 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10176 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10177 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10178 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 10179 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10180 | "$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] | 10181 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10182 | "$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] | 10183 | 0 \ |
| 10184 | -s "Extra-header:" \ |
| 10185 | -c "HTTP/1.0 200 OK" |
| 10186 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10187 | client_needs_more_time 4 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10188 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 10189 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 10190 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 10191 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10192 | "$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] | 10193 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10194 | "$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] | 10195 | 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] | 10196 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10197 | 0 \ |
| 10198 | -s "a session has been resumed" \ |
| 10199 | -c "a session has been resumed" \ |
| 10200 | -s "Extra-header:" \ |
| 10201 | -c "HTTP/1.0 200 OK" |
| 10202 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10203 | client_needs_more_time 4 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10204 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 10205 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 10206 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 10207 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10208 | "$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] | 10209 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10210 | "$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] | 10211 | 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] | 10212 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 10213 | 0 \ |
| 10214 | -s "a session has been resumed" \ |
| 10215 | -c "a session has been resumed" \ |
| 10216 | -s "Extra-header:" \ |
| 10217 | -c "HTTP/1.0 200 OK" |
| 10218 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10219 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10220 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10221 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10222 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 10223 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10224 | "$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] | 10225 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10226 | "$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] | 10227 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 10228 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10229 | 0 \ |
| 10230 | -c "=> renegotiate" \ |
| 10231 | -s "=> renegotiate" \ |
| 10232 | -s "Extra-header:" \ |
| 10233 | -c "HTTP/1.0 200 OK" |
| 10234 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10235 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10236 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10237 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10238 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 10239 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10240 | "$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] | 10241 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10242 | "$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] | 10243 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10244 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10245 | 0 \ |
| 10246 | -c "=> renegotiate" \ |
| 10247 | -s "=> renegotiate" \ |
| 10248 | -s "Extra-header:" \ |
| 10249 | -c "HTTP/1.0 200 OK" |
| 10250 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10251 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10252 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10253 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10254 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 10255 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10256 | "$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] | 10257 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10258 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10259 | "$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] | 10260 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10261 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10262 | 0 \ |
| 10263 | -c "=> renegotiate" \ |
| 10264 | -s "=> renegotiate" \ |
| 10265 | -s "Extra-header:" \ |
| 10266 | -c "HTTP/1.0 200 OK" |
| 10267 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10268 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10269 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10270 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10271 | 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] | 10272 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10273 | "$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] | 10274 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10275 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10276 | "$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] | 10277 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10278 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10279 | 0 \ |
| 10280 | -c "=> renegotiate" \ |
| 10281 | -s "=> renegotiate" \ |
| 10282 | -s "Extra-header:" \ |
| 10283 | -c "HTTP/1.0 200 OK" |
| 10284 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 10285 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 10286 | ## all versions installed on the CI machines), reported here: |
| 10287 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 10288 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 10289 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 10290 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10291 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10292 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10293 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10294 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 10295 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 10296 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10297 | "$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] | 10298 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 10299 | -c "HTTP/1.0 200 OK" |
| 10300 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 10301 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10302 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10303 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10304 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10305 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 10306 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 10307 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10308 | "$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] | 10309 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10310 | -c "HTTP/1.0 200 OK" |
| 10311 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 10312 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10313 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10314 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10315 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10316 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 10317 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 10318 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10319 | "$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] | 10320 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10321 | -c "HTTP/1.0 200 OK" |
| 10322 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 10323 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10324 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10325 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10326 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10327 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 10328 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 10329 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10330 | "$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] | 10331 | 0 \ |
| 10332 | -s "Extra-header:" \ |
| 10333 | -c "Extra-header:" |
| 10334 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10335 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10336 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10337 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10338 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10339 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 10340 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10341 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10342 | "$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] | 10343 | 0 \ |
| 10344 | -s "Extra-header:" \ |
| 10345 | -c "Extra-header:" |
| 10346 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10347 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10348 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10349 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10350 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10351 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 10352 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10353 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10354 | "$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] | 10355 | 0 \ |
| 10356 | -s "Extra-header:" \ |
| 10357 | -c "Extra-header:" |
| 10358 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10359 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 10360 | run_test "export keys functionality" \ |
| 10361 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 10362 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 10363 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 10364 | -c "EAP-TLS key material is:"\ |
| 10365 | -s "EAP-TLS key material is:"\ |
| 10366 | -c "EAP-TLS IV is:" \ |
| 10367 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 10368 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 10369 | # openssl feature tests: check if tls1.3 exists. |
| 10370 | requires_openssl_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 10371 | run_test "TLS 1.3: Test openssl tls1_3 feature" \ |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 10372 | "$O_NEXT_SRV -tls1_3 -msg" \ |
| 10373 | "$O_NEXT_CLI -tls1_3 -msg" \ |
| 10374 | 0 \ |
| 10375 | -c "TLS 1.3" \ |
| 10376 | -s "TLS 1.3" |
| 10377 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 10378 | # 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] | 10379 | requires_gnutls_tls1_3 |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 10380 | requires_gnutls_next_no_ticket |
| 10381 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 10382 | run_test "TLS 1.3: Test gnutls tls1_3 feature" \ |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 10383 | "$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] | 10384 | "$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] | 10385 | 0 \ |
| 10386 | -s "Version: TLS1.3" \ |
| 10387 | -c "Version: TLS1.3" |
| 10388 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 10389 | # TLS1.3 test cases |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 10390 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10391 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 10392 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 10393 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10394 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 10395 | run_test "TLS 1.3: minimal feature sets - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 10396 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10397 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 10398 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10399 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 10400 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 10401 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 10402 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 10403 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 10404 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 10405 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 10406 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 10407 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 10408 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 10409 | -c "<= ssl_tls13_process_server_hello" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 10410 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10411 | -c "ECDH curve: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 10412 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10413 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 10414 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10415 | -c "=> parse certificate verify" \ |
| 10416 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 10417 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 10418 | -c "<= parse finished message" \ |
Gilles Peskine | c63a1e0 | 2022-01-13 01:10:24 +0100 | [diff] [blame] | 10419 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 10420 | -c "HTTP/1.0 200 ok" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 10421 | |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 10422 | requires_gnutls_tls1_3 |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 10423 | requires_gnutls_next_no_ticket |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10424 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 10425 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 10426 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10427 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 10428 | run_test "TLS 1.3: minimal feature sets - gnutls" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 10429 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --disable-client-cert" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10430 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 10431 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10432 | -s "SERVER HELLO was queued" \ |
| 10433 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 10434 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 10435 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 10436 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 10437 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 10438 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 10439 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 10440 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 10441 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 10442 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 10443 | -c "<= ssl_tls13_process_server_hello" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 10444 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10445 | -c "ECDH curve: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 10446 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10447 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 10448 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10449 | -c "=> parse certificate verify" \ |
| 10450 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 10451 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 10452 | -c "<= parse finished message" \ |
Gilles Peskine | 860429f | 2022-02-12 00:44:48 +0100 | [diff] [blame] | 10453 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 10454 | -c "HTTP/1.0 200 OK" |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 10455 | |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 10456 | requires_openssl_tls1_3 |
| 10457 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10458 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10459 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10460 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10461 | requires_config_enabled MBEDTLS_SSL_ALPN |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 10462 | run_test "TLS 1.3: alpn - openssl" \ |
| 10463 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -alpn h2" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10464 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 10465 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10466 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 10467 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 10468 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 10469 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 10470 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 10471 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 10472 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 10473 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 10474 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 10475 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 10476 | -c "<= ssl_tls13_process_server_hello" \ |
| 10477 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10478 | -c "ECDH curve: x25519" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 10479 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10480 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 10481 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10482 | -c "=> parse certificate verify" \ |
| 10483 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 10484 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 10485 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10486 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 10487 | -c "HTTP/1.0 200 ok" \ |
| 10488 | -c "Application Layer Protocol is h2" |
| 10489 | |
| 10490 | requires_gnutls_tls1_3 |
| 10491 | requires_gnutls_next_no_ticket |
| 10492 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10493 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10494 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10495 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10496 | requires_config_enabled MBEDTLS_SSL_ALPN |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 10497 | run_test "TLS 1.3: alpn - gnutls" \ |
| 10498 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --disable-client-cert --alpn=h2" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10499 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 10500 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10501 | -s "SERVER HELLO was queued" \ |
| 10502 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 10503 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 10504 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 10505 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 10506 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 10507 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 10508 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 10509 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 10510 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 10511 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 10512 | -c "<= ssl_tls13_process_server_hello" \ |
| 10513 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10514 | -c "ECDH curve: x25519" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 10515 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10516 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 10517 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 10518 | -c "=> parse certificate verify" \ |
| 10519 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 10520 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 10521 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10522 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 10523 | -c "HTTP/1.0 200 OK" \ |
| 10524 | -c "Application Layer Protocol is h2" |
| 10525 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10526 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 10527 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10528 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10529 | skip_handshake_stage_check |
| 10530 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 10531 | 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] | 10532 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0 -d 4" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10533 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10534 | 1 \ |
| 10535 | -s "Client's version: 3.3" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10536 | -S "Version: TLS1.0" \ |
| 10537 | -C "Protocol is TLSv1.0" |
| 10538 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10539 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 10540 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10541 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10542 | skip_handshake_stage_check |
| 10543 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 10544 | 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] | 10545 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1 -d 4" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10546 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10547 | 1 \ |
| 10548 | -s "Client's version: 3.3" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10549 | -S "Version: TLS1.1" \ |
| 10550 | -C "Protocol is TLSv1.1" |
| 10551 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10552 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 10553 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10554 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10555 | skip_handshake_stage_check |
| 10556 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 10557 | 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] | 10558 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2 -d 4" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10559 | "$P_CLI force_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10560 | 1 \ |
| 10561 | -s "Client's version: 3.3" \ |
| 10562 | -c "is a fatal alert message (msg 40)" \ |
| 10563 | -S "Version: TLS1.2" \ |
| 10564 | -C "Protocol is TLSv1.2" |
| 10565 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10566 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 10567 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10568 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10569 | skip_handshake_stage_check |
| 10570 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 10571 | 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] | 10572 | "$O_NEXT_SRV -msg -tls1" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10573 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10574 | 1 \ |
| 10575 | -s "fatal protocol_version" \ |
| 10576 | -c "is a fatal alert message (msg 70)" \ |
| 10577 | -S "Version: TLS1.0" \ |
| 10578 | -C "Protocol : TLSv1.0" |
| 10579 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10580 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 10581 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10582 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10583 | skip_handshake_stage_check |
| 10584 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 10585 | 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] | 10586 | "$O_NEXT_SRV -msg -tls1_1" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10587 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10588 | 1 \ |
| 10589 | -s "fatal protocol_version" \ |
| 10590 | -c "is a fatal alert message (msg 70)" \ |
| 10591 | -S "Version: TLS1.1" \ |
| 10592 | -C "Protocol : TLSv1.1" |
| 10593 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 10594 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 10595 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10596 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10597 | skip_handshake_stage_check |
| 10598 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 10599 | 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] | 10600 | "$O_NEXT_SRV -msg -tls1_2" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10601 | "$P_CLI force_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 10602 | 1 \ |
| 10603 | -s "fatal protocol_version" \ |
| 10604 | -c "is a fatal alert message (msg 70)" \ |
| 10605 | -S "Version: TLS1.2" \ |
| 10606 | -C "Protocol : TLSv1.2" |
| 10607 | |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 10608 | requires_openssl_tls1_3 |
| 10609 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10610 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10611 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10612 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10613 | run_test "TLS 1.3: Client authentication, no client certificate - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10614 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -verify 10" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10615 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 10616 | 0 \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 10617 | -c "got a certificate request" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10618 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10619 | -s "TLS 1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10620 | -c "HTTP/1.0 200 ok" \ |
| 10621 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10622 | |
| 10623 | requires_gnutls_tls1_3 |
| 10624 | requires_gnutls_next_no_ticket |
| 10625 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10626 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10627 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10628 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10629 | run_test "TLS 1.3: Client authentication, no client certificate - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10630 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --verify-client-cert" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10631 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10632 | 0 \ |
| 10633 | -c "got a certificate request" \ |
| 10634 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE"\ |
| 10635 | -s "Version: TLS1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10636 | -c "HTTP/1.0 200 OK" \ |
| 10637 | -c "Protocol is TLSv1.3" |
| 10638 | |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 10639 | |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 10640 | requires_openssl_tls1_3 |
| 10641 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10642 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10643 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10644 | run_test "TLS 1.3: Client authentication, no server middlebox compat - openssl" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 10645 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 -no_middlebox" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10646 | "$P_CLI debug_level=4 crt_file=data_files/cli2.crt key_file=data_files/cli2.key" \ |
Jerry Yu | c19884f | 2022-01-29 10:44:44 +0800 | [diff] [blame] | 10647 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 10648 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 10649 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10650 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10651 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 10652 | |
| 10653 | requires_gnutls_tls1_3 |
| 10654 | requires_gnutls_next_no_ticket |
| 10655 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10656 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10657 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10658 | run_test "TLS 1.3: Client authentication, no server middlebox compat - gnutls" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 10659 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10660 | "$P_CLI debug_level=3 crt_file=data_files/cli2.crt \ |
Jerry Yu | 25e0ddc | 2022-01-29 10:33:13 +0800 | [diff] [blame] | 10661 | key_file=data_files/cli2.key" \ |
Jerry Yu | c19884f | 2022-01-29 10:44:44 +0800 | [diff] [blame] | 10662 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 10663 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 10664 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10665 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10666 | -c "Protocol is TLSv1.3" |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 10667 | |
| 10668 | requires_openssl_tls1_3 |
| 10669 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10670 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10671 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10672 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10673 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10674 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10675 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp256r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10676 | key_file=data_files/ecdsa_secp256r1.key" \ |
| 10677 | 0 \ |
| 10678 | -c "got a certificate request" \ |
| 10679 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10680 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10681 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10682 | |
| 10683 | requires_gnutls_tls1_3 |
| 10684 | requires_gnutls_next_no_ticket |
| 10685 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10686 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10687 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10688 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10689 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10690 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10691 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp256r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10692 | key_file=data_files/ecdsa_secp256r1.key" \ |
| 10693 | 0 \ |
| 10694 | -c "got a certificate request" \ |
| 10695 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10696 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10697 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10698 | |
| 10699 | requires_openssl_tls1_3 |
| 10700 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10701 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10702 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10703 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10704 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10705 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10706 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp384r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10707 | key_file=data_files/ecdsa_secp384r1.key" \ |
| 10708 | 0 \ |
| 10709 | -c "got a certificate request" \ |
| 10710 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10711 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10712 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10713 | |
| 10714 | requires_gnutls_tls1_3 |
| 10715 | requires_gnutls_next_no_ticket |
| 10716 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10717 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10718 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10719 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10720 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10721 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10722 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp384r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10723 | key_file=data_files/ecdsa_secp384r1.key" \ |
| 10724 | 0 \ |
| 10725 | -c "got a certificate request" \ |
| 10726 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10727 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10728 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10729 | |
| 10730 | requires_openssl_tls1_3 |
| 10731 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10732 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10733 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10734 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10735 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10736 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10737 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10738 | key_file=data_files/ecdsa_secp521r1.key" \ |
| 10739 | 0 \ |
| 10740 | -c "got a certificate request" \ |
| 10741 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10742 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10743 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10744 | |
| 10745 | requires_gnutls_tls1_3 |
| 10746 | requires_gnutls_next_no_ticket |
| 10747 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10748 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10749 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10750 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10751 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10752 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10753 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10754 | key_file=data_files/ecdsa_secp521r1.key" \ |
| 10755 | 0 \ |
| 10756 | -c "got a certificate request" \ |
| 10757 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10758 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10759 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10760 | |
| 10761 | requires_openssl_tls1_3 |
| 10762 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10763 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10764 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10765 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10766 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10767 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10768 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10769 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 10770 | 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] | 10771 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10772 | -c "got a certificate request" \ |
| 10773 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10774 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 10775 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10776 | |
| 10777 | requires_gnutls_tls1_3 |
| 10778 | requires_gnutls_next_no_ticket |
| 10779 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10780 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10781 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10782 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10783 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10784 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10785 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10786 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 10787 | 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] | 10788 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 10789 | -c "got a certificate request" \ |
| 10790 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 10791 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 10792 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 10793 | |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 10794 | requires_openssl_tls1_3 |
| 10795 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10796 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10797 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10798 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10799 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 10800 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - openssl" \ |
| 10801 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 10802 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 10803 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384" \ |
| 10804 | 0 \ |
| 10805 | -c "got a certificate request" \ |
| 10806 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10807 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10808 | -c "Protocol is TLSv1.3" |
| 10809 | |
| 10810 | requires_gnutls_tls1_3 |
| 10811 | requires_gnutls_next_no_ticket |
| 10812 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10813 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10814 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10815 | requires_config_enabled MBEDTLS_RSA_C |
| 10816 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10817 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - gnutls" \ |
| 10818 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 10819 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 10820 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384" \ |
| 10821 | 0 \ |
| 10822 | -c "got a certificate request" \ |
| 10823 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10824 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10825 | -c "Protocol is TLSv1.3" |
| 10826 | |
| 10827 | requires_openssl_tls1_3 |
| 10828 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10829 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10830 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10831 | requires_config_enabled MBEDTLS_RSA_C |
| 10832 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10833 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - openssl" \ |
| 10834 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 10835 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 10836 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512" \ |
| 10837 | 0 \ |
| 10838 | -c "got a certificate request" \ |
| 10839 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10840 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10841 | -c "Protocol is TLSv1.3" |
| 10842 | |
| 10843 | requires_gnutls_tls1_3 |
| 10844 | requires_gnutls_next_no_ticket |
| 10845 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10846 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10847 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10848 | requires_config_enabled MBEDTLS_RSA_C |
| 10849 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10850 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - gnutls" \ |
| 10851 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 10852 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 10853 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512" \ |
| 10854 | 0 \ |
| 10855 | -c "got a certificate request" \ |
| 10856 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10857 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10858 | -c "Protocol is TLSv1.3" |
| 10859 | |
| 10860 | requires_openssl_tls1_3 |
| 10861 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10862 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10863 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10864 | requires_config_enabled MBEDTLS_RSA_C |
| 10865 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | ccb005e | 2022-02-22 17:38:34 +0800 | [diff] [blame] | 10866 | 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] | 10867 | "$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] | 10868 | -sigalgs ecdsa_secp256r1_sha256" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10869 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 10870 | 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] | 10871 | 1 \ |
| 10872 | -c "got a certificate request" \ |
| 10873 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10874 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 10875 | -c "signature algorithm not in received or offered list." \ |
Andrzej Kurek | 5c65c57 | 2022-04-13 14:28:52 -0400 | [diff] [blame] | 10876 | -C "unknown pk type" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 10877 | |
| 10878 | requires_gnutls_tls1_3 |
| 10879 | requires_gnutls_next_no_ticket |
| 10880 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10881 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10882 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10883 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 10884 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10885 | run_test "TLS 1.3: Client authentication, client alg not in server list - gnutls" \ |
| 10886 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:-SIGN-ALL:+SIGN-ECDSA-SECP256R1-SHA256:%NO_TICKETS" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 10887 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 10888 | 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] | 10889 | 1 \ |
| 10890 | -c "got a certificate request" \ |
| 10891 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10892 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 10893 | -c "signature algorithm not in received or offered list." \ |
Andrzej Kurek | 5c65c57 | 2022-04-13 14:28:52 -0400 | [diff] [blame] | 10894 | -C "unknown pk type" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 10895 | |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 10896 | # Test using an opaque private key for client authentication |
| 10897 | requires_openssl_tls1_3 |
| 10898 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10899 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10900 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10901 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 10902 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - openssl" \ |
| 10903 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 -no_middlebox" \ |
| 10904 | "$P_CLI debug_level=4 crt_file=data_files/cli2.crt key_file=data_files/cli2.key key_opaque=1" \ |
| 10905 | 0 \ |
| 10906 | -c "got a certificate request" \ |
| 10907 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10908 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10909 | -c "Protocol is TLSv1.3" |
| 10910 | |
| 10911 | requires_gnutls_tls1_3 |
| 10912 | requires_gnutls_next_no_ticket |
| 10913 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10914 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10915 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10916 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 10917 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - gnutls" \ |
| 10918 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \ |
| 10919 | "$P_CLI debug_level=3 crt_file=data_files/cli2.crt \ |
| 10920 | key_file=data_files/cli2.key key_opaque=1" \ |
| 10921 | 0 \ |
| 10922 | -c "got a certificate request" \ |
| 10923 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10924 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10925 | -c "Protocol is TLSv1.3" |
| 10926 | |
| 10927 | requires_openssl_tls1_3 |
| 10928 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10929 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10930 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10931 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10932 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 10933 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - openssl" \ |
| 10934 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 10935 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp256r1.crt \ |
| 10936 | key_file=data_files/ecdsa_secp256r1.key key_opaque=1" \ |
| 10937 | 0 \ |
| 10938 | -c "got a certificate request" \ |
| 10939 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10940 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10941 | -c "Protocol is TLSv1.3" |
| 10942 | |
| 10943 | requires_gnutls_tls1_3 |
| 10944 | requires_gnutls_next_no_ticket |
| 10945 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10946 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10947 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10948 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10949 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 10950 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - gnutls" \ |
| 10951 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 10952 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp256r1.crt \ |
| 10953 | key_file=data_files/ecdsa_secp256r1.key key_opaque=1" \ |
| 10954 | 0 \ |
| 10955 | -c "got a certificate request" \ |
| 10956 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10957 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10958 | -c "Protocol is TLSv1.3" |
| 10959 | |
| 10960 | requires_openssl_tls1_3 |
| 10961 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10962 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10963 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10964 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10965 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 10966 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - openssl" \ |
| 10967 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 10968 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp384r1.crt \ |
| 10969 | key_file=data_files/ecdsa_secp384r1.key key_opaque=1" \ |
| 10970 | 0 \ |
| 10971 | -c "got a certificate request" \ |
| 10972 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10973 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10974 | -c "Protocol is TLSv1.3" |
| 10975 | |
| 10976 | requires_gnutls_tls1_3 |
| 10977 | requires_gnutls_next_no_ticket |
| 10978 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10979 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10980 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10981 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10982 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 10983 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - gnutls" \ |
| 10984 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 10985 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp384r1.crt \ |
| 10986 | key_file=data_files/ecdsa_secp384r1.key key_opaque=1" \ |
| 10987 | 0 \ |
| 10988 | -c "got a certificate request" \ |
| 10989 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 10990 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 10991 | -c "Protocol is TLSv1.3" |
| 10992 | |
| 10993 | requires_openssl_tls1_3 |
| 10994 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 10995 | requires_config_enabled MBEDTLS_DEBUG_C |
| 10996 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 10997 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 10998 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 10999 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - openssl" \ |
| 11000 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11001 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 11002 | key_file=data_files/ecdsa_secp521r1.key key_opaque=1" \ |
| 11003 | 0 \ |
| 11004 | -c "got a certificate request" \ |
| 11005 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11006 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11007 | -c "Protocol is TLSv1.3" |
| 11008 | |
| 11009 | requires_gnutls_tls1_3 |
| 11010 | requires_gnutls_next_no_ticket |
| 11011 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11012 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11013 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11014 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11015 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11016 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - gnutls" \ |
| 11017 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11018 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 11019 | key_file=data_files/ecdsa_secp521r1.key key_opaque=1" \ |
| 11020 | 0 \ |
| 11021 | -c "got a certificate request" \ |
| 11022 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11023 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11024 | -c "Protocol is TLSv1.3" |
| 11025 | |
| 11026 | requires_openssl_tls1_3 |
| 11027 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11028 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11029 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11030 | requires_config_enabled MBEDTLS_RSA_C |
| 11031 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11032 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11033 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - openssl" \ |
| 11034 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11035 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
| 11036 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256 key_opaque=1" \ |
| 11037 | 0 \ |
| 11038 | -c "got a certificate request" \ |
| 11039 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11040 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11041 | -c "Protocol is TLSv1.3" |
| 11042 | |
| 11043 | requires_gnutls_tls1_3 |
| 11044 | requires_gnutls_next_no_ticket |
| 11045 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11046 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11047 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11048 | requires_config_enabled MBEDTLS_RSA_C |
| 11049 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11050 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11051 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - gnutls" \ |
| 11052 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11053 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
| 11054 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256 key_opaque=1" \ |
| 11055 | 0 \ |
| 11056 | -c "got a certificate request" \ |
| 11057 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11058 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11059 | -c "Protocol is TLSv1.3" |
| 11060 | |
| 11061 | requires_openssl_tls1_3 |
| 11062 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11063 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11064 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11065 | requires_config_enabled MBEDTLS_RSA_C |
| 11066 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11067 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11068 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - openssl" \ |
| 11069 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11070 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 11071 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384 key_opaque=1" \ |
| 11072 | 0 \ |
| 11073 | -c "got a certificate request" \ |
| 11074 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11075 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11076 | -c "Protocol is TLSv1.3" |
| 11077 | |
| 11078 | requires_gnutls_tls1_3 |
| 11079 | requires_gnutls_next_no_ticket |
| 11080 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11081 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11082 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11083 | requires_config_enabled MBEDTLS_RSA_C |
| 11084 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11085 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11086 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - gnutls" \ |
| 11087 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11088 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 11089 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384 key_opaque=1" \ |
| 11090 | 0 \ |
| 11091 | -c "got a certificate request" \ |
| 11092 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11093 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11094 | -c "Protocol is TLSv1.3" |
| 11095 | |
| 11096 | requires_openssl_tls1_3 |
| 11097 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11098 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11099 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11100 | requires_config_enabled MBEDTLS_RSA_C |
| 11101 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11102 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11103 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - openssl" \ |
| 11104 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11105 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 11106 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512 key_opaque=1" \ |
| 11107 | 0 \ |
| 11108 | -c "got a certificate request" \ |
| 11109 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11110 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11111 | -c "Protocol is TLSv1.3" |
| 11112 | |
| 11113 | requires_gnutls_tls1_3 |
| 11114 | requires_gnutls_next_no_ticket |
| 11115 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11116 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11117 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11118 | requires_config_enabled MBEDTLS_RSA_C |
| 11119 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11120 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11121 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - gnutls" \ |
| 11122 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11123 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 11124 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512 key_opaque=1" \ |
| 11125 | 0 \ |
| 11126 | -c "got a certificate request" \ |
| 11127 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11128 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11129 | -c "Protocol is TLSv1.3" |
| 11130 | |
| 11131 | requires_openssl_tls1_3 |
| 11132 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11133 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11134 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11135 | requires_config_enabled MBEDTLS_RSA_C |
| 11136 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11137 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11138 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - openssl" \ |
| 11139 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 |
| 11140 | -sigalgs ecdsa_secp256r1_sha256" \ |
| 11141 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 11142 | key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512 key_opaque=1" \ |
| 11143 | 1 \ |
| 11144 | -c "got a certificate request" \ |
| 11145 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11146 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11147 | -c "signature algorithm not in received or offered list." \ |
| 11148 | -C "unkown pk type" |
| 11149 | |
| 11150 | requires_gnutls_tls1_3 |
| 11151 | requires_gnutls_next_no_ticket |
| 11152 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11153 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11154 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11155 | requires_config_enabled MBEDTLS_RSA_C |
| 11156 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11157 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11158 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - gnutls" \ |
| 11159 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:-SIGN-ALL:+SIGN-ECDSA-SECP256R1-SHA256:%NO_TICKETS" \ |
| 11160 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 11161 | key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512 key_opaque=1" \ |
| 11162 | 1 \ |
| 11163 | -c "got a certificate request" \ |
| 11164 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11165 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11166 | -c "signature algorithm not in received or offered list." \ |
| 11167 | -C "unkown pk type" |
| 11168 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11169 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11170 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11171 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11172 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 11173 | requires_openssl_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11174 | run_test "TLS 1.3: HRR check, ciphersuite TLS_AES_128_GCM_SHA256 - openssl" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 11175 | "$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" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11176 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 11177 | 0 \ |
| 11178 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 11179 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11180 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11181 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 11182 | -c "HTTP/1.0 200 ok" |
| 11183 | |
| 11184 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11185 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11186 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11187 | requires_config_enabled MBEDTLS_SSL_CLI_C |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 11188 | requires_openssl_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11189 | run_test "TLS 1.3: HRR check, ciphersuite TLS_AES_256_GCM_SHA384 - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11190 | "$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" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11191 | "$P_CLI debug_level=4" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 11192 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 11193 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 11194 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11195 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11196 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 11197 | -c "HTTP/1.0 200 ok" |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 11198 | |
Gilles Peskine | 2ecf4ff | 2022-04-13 19:08:38 +0200 | [diff] [blame] | 11199 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 11200 | requires_gnutls_tls1_3 |
| 11201 | requires_gnutls_next_no_ticket |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11202 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11203 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11204 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11205 | run_test "TLS 1.3: HRR check, ciphersuite TLS_AES_128_GCM_SHA256 - gnutls" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 11206 | "$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" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11207 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 11208 | 0 \ |
| 11209 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 11210 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11211 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11212 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 11213 | -c "HTTP/1.0 200 OK" |
| 11214 | |
Gilles Peskine | 2ecf4ff | 2022-04-13 19:08:38 +0200 | [diff] [blame] | 11215 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 11216 | requires_gnutls_tls1_3 |
| 11217 | requires_gnutls_next_no_ticket |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 11218 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11219 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11220 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11221 | run_test "TLS 1.3: HRR check, ciphersuite TLS_AES_256_GCM_SHA384 - gnutls" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 11222 | "$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" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11223 | "$P_CLI debug_level=4" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 11224 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 11225 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 11226 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11227 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11228 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 11229 | -c "HTTP/1.0 200 OK" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11230 | |
Jerry Yu | 155493d | 2022-04-25 13:30:18 +0800 | [diff] [blame] | 11231 | requires_openssl_tls1_3 |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 11232 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 11233 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 11234 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 11235 | run_test "TLS 1.3: Server side check - openssl" \ |
XiaokangQian | c4b8c99 | 2022-04-07 11:31:38 +0000 | [diff] [blame] | 11236 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 11237 | "$O_NEXT_CLI -msg -debug -tls1_3 -no_middlebox" \ |
Jerry Yu | 4d8567f | 2022-04-17 10:57:57 +0800 | [diff] [blame] | 11238 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 11239 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 11240 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11241 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 11242 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 11243 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11244 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 11245 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
Jerry Yu | 155493d | 2022-04-25 13:30:18 +0800 | [diff] [blame] | 11246 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 11247 | |
Jerry Yu | 5491f85 | 2022-05-23 22:36:16 +0800 | [diff] [blame] | 11248 | # Skip this test before openssl exit code issue fixed |
| 11249 | # On fail, openssl return different exit code on OpenCI and internal CI for |
| 11250 | # this test. |
| 11251 | skip_next_test |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 11252 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11253 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11254 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 11255 | requires_openssl_tls1_3 |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 11256 | run_test "TLS 1.3: Server side check - openssl with client authentication" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 11257 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
Jerry Yu | 7eaadae | 2022-05-23 14:53:27 +0800 | [diff] [blame] | 11258 | "$O_NEXT_CLI -msg -debug -cert data_files/server5.crt -key data_files/server5.key -tls1_3 -no_middlebox" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 11259 | 1 \ |
| 11260 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 11261 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11262 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11263 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11264 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 11265 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11266 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 11267 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 11268 | -s "=> parse client hello" \ |
| 11269 | -s "<= parse client hello" |
| 11270 | |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 11271 | requires_gnutls_tls1_3 |
| 11272 | requires_gnutls_next_no_ticket |
| 11273 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 11274 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 11275 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 11276 | run_test "TLS 1.3: Server side check - gnutls" \ |
XiaokangQian | c4b8c99 | 2022-04-07 11:31:38 +0000 | [diff] [blame] | 11277 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
XiaokangQian | 3f84d5d | 2022-04-19 06:36:17 +0000 | [diff] [blame] | 11278 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 11279 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 11280 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 11281 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11282 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 11283 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 11284 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11285 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 11286 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11287 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 11288 | -c "HTTP/1.0 200 OK" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 11289 | |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 11290 | requires_gnutls_tls1_3 |
| 11291 | requires_gnutls_next_no_ticket |
| 11292 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11293 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11294 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 11295 | run_test "TLS 1.3: Server side check - gnutls with client authentication" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 11296 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
| 11297 | "$G_NEXT_CLI localhost -d 4 --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V" \ |
| 11298 | 1 \ |
| 11299 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 11300 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11301 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11302 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11303 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 11304 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11305 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 11306 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 11307 | -s "=> parse client hello" \ |
| 11308 | -s "<= parse client hello" |
| 11309 | |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 11310 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11311 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11312 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Jerry Yu | 955ddd7 | 2022-04-22 22:27:33 +0800 | [diff] [blame] | 11313 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 11314 | run_test "TLS 1.3: Server side check - mbedtls" \ |
| 11315 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
| 11316 | "$P_CLI debug_level=4 force_version=tls13" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 11317 | 0 \ |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 11318 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 11319 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11320 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 11321 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 11322 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 11323 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11324 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11325 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11326 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 11327 | -c "HTTP/1.0 200 OK" |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 11328 | |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 11329 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11330 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11331 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 11332 | requires_config_enabled MBEDTLS_SSL_CLI_C |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 11333 | run_test "TLS 1.3: Server side check - mbedtls with client authentication" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 11334 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
| 11335 | "$P_CLI debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13" \ |
| 11336 | 1 \ |
| 11337 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 11338 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11339 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11340 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 11341 | -s "=> write certificate request" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 11342 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 11343 | -s "=> parse client hello" \ |
| 11344 | -s "<= parse client hello" |
| 11345 | |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 11346 | |
| 11347 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11348 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11349 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 11350 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11351 | run_test "TLS 1.3: server: HRR check - mbedtls" \ |
| 11352 | "$P_SRV debug_level=4 force_version=tls13 curves=secp384r1" \ |
| 11353 | "$P_CLI debug_level=4 force_version=tls13 curves=secp256r1,secp384r1" \ |
Jerry Yu | 36becb1 | 2022-05-12 16:57:20 +0800 | [diff] [blame] | 11354 | 0 \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 11355 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 11356 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11357 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11358 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
| 11359 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11360 | -s "selected_group: secp384r1" \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 11361 | -s "=> write hello retry request" \ |
| 11362 | -s "<= write hello retry request" |
| 11363 | |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 11364 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11365 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11366 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 11367 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11368 | run_test "TLS 1.3: Server side check, no server certificate available" \ |
| 11369 | "$P_SRV debug_level=4 crt_file=none key_file=none force_version=tls13" \ |
| 11370 | "$P_CLI debug_level=4 force_version=tls13" \ |
| 11371 | 1 \ |
| 11372 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11373 | -s "No certificate available." |
| 11374 | |
Gilles Peskine | 2baaf60 | 2022-01-07 15:46:12 +0100 | [diff] [blame] | 11375 | for i in opt-testcases/*.sh |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 11376 | do |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 11377 | TEST_SUITE_NAME=${i##*/} |
| 11378 | TEST_SUITE_NAME=${TEST_SUITE_NAME%.*} |
| 11379 | . "$i" |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 11380 | done |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 11381 | unset TEST_SUITE_NAME |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 11382 | |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11383 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11384 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11385 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11386 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11387 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 11388 | 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] | 11389 | "$O_NEXT_SRV -msg -tls1_3 -no_middlebox -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11390 | "$P_CLI debug_level=3" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11391 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11392 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11393 | -c "HTTP/1.0 200 ok" |
| 11394 | |
| 11395 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11396 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11397 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11398 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11399 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 11400 | 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] | 11401 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11402 | "$P_CLI debug_level=3" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11403 | 1 \ |
| 11404 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 11405 | |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 11406 | requires_gnutls_tls1_3 |
| 11407 | requires_gnutls_next_no_ticket |
| 11408 | requires_gnutls_next_disable_tls13_compat |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11409 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 11410 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11411 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11412 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 11413 | run_test "TLS 1.3 m->G both peers do not support middlebox compatibility" \ |
| 11414 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE --disable-client-cert" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11415 | "$P_CLI debug_level=3" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 11416 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11417 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 11418 | -c "HTTP/1.0 200 OK" |
| 11419 | |
| 11420 | requires_gnutls_tls1_3 |
| 11421 | requires_gnutls_next_no_ticket |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11422 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 11423 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11424 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11425 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 11426 | run_test "TLS 1.3 m->G server with middlebox compat support, not client" \ |
| 11427 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --disable-client-cert" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11428 | "$P_CLI debug_level=3" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 11429 | 1 \ |
| 11430 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 11431 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 11432 | # Test heap memory usage after handshake |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11433 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 11434 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 11435 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 11436 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11437 | requires_max_content_len 16384 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 11438 | run_tests_memory_after_hanshake |
| 11439 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 11440 | # Final report |
| 11441 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 11442 | echo "------------------------------------------------------------------------" |
| 11443 | |
| 11444 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 11445 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 11446 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 11447 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 11448 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 11449 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 11450 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 11451 | |
| 11452 | exit $FAILS |